Import Cobalt 20.master.0.248273
diff --git a/src/base/METADATA b/src/base/METADATA
new file mode 100644
index 0000000..bc1bf40
--- /dev/null
+++ b/src/base/METADATA
@@ -0,0 +1,20 @@
+name: "base"
+description:
+  "Subtree at base."
+
+third_party {
+  url {
+    type: LOCAL_SOURCE
+    value: "/third_party/chromium/base_mirror"
+  }
+  url {
+    type: GIT
+    value: "https://chromium.googlesource.com/chromium/src/base"
+  }
+  version: "2fb7110f70453ccb8951428611330d95c496f3cd"
+  last_upgrade_date {
+    year: 2018
+    month: 10
+    day: 8
+  }
+}
diff --git a/src/base/trace_event/memory_usage_estimator.h b/src/base/trace_event/memory_usage_estimator.h
index a8fdccf..8692b91 100644
--- a/src/base/trace_event/memory_usage_estimator.h
+++ b/src/base/trace_event/memory_usage_estimator.h
@@ -302,7 +302,7 @@
       /*std::forward_list,*/ std::list, std::set, std::multiset>();
 }
 
-#if __cplusplus < 201402L
+#if defined(STARBOARD)
 template <class T>
 struct EMUCaller<
     T,
@@ -310,7 +310,7 @@
                             std::is_trivially_destructible<T>::value>::type> {
   static size_t Call(const T& value) { return 0; }
 };
-#else
+#else   // defined(STARBOARD)
 // Work around MSVS bug. For some reason constexpr function doesn't work.
 // However variable template does.
 template <typename T>
@@ -324,7 +324,7 @@
     std::enable_if_t<!HasEMU<T>::value && IsKnownNonAllocatingType_v<T>>> {
   static size_t Call(const T& value) { return 0; }
 };
-#endif
+#endif  // defined(STARBOARD)
 
 }  // namespace internal
 
diff --git a/src/build/file_exists.py b/src/build/file_exists.py
index 9af5d79..319628e 100644
--- a/src/build/file_exists.py
+++ b/src/build/file_exists.py
@@ -12,15 +12,16 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
-"""Writes True if the argument is a file."""
+"""Writes "1" if the argument is a file, otherwise "0"."""
 
 import os.path
 import sys
 
+
 def main():
-  sys.stdout.write(str(os.path.isfile(sys.argv[1])))
+  sys.stdout.write("1" if os.path.isfile(sys.argv[1]) else "0")
   return 0
 
-if __name__ == '__main__':
+
+if __name__ == "__main__":
   sys.exit(main())
diff --git a/src/cobalt/CHANGELOG.md b/src/cobalt/CHANGELOG.md
index 01a2817..a51fee8 100644
--- a/src/cobalt/CHANGELOG.md
+++ b/src/cobalt/CHANGELOG.md
@@ -207,6 +207,9 @@
      setting (in `cobalt/extension/graphics.h`) to allow a platform to indicate a
      minimum framerate causing Cobalt to rerender the display even if nothing has
      changed after the specified interval.
+   - Removed old embedded screen reader from Cobalt source code, all platforms
+     should use the new JavaScript screen reader updated and shipped from YouTube
+     now.
 
 ### Version 20.lts.3
  - **Improvements and Bug Fixes**
diff --git a/src/cobalt/base/token.cc b/src/cobalt/base/token.cc
index 53cce72..825cb50 100644
--- a/src/cobalt/base/token.cc
+++ b/src/cobalt/base/token.cc
@@ -15,7 +15,6 @@
 #include "cobalt/base/token.h"
 
 #include <set>
-#include <vector>
 
 #include "base/logging.h"
 #include "base/memory/singleton.h"
@@ -43,10 +42,9 @@
  private:
   friend struct base::DefaultSingletonTraits<TokenStorage>;
 
-  TokenStorage()
-      : hash_table_(Token::kHashSlotCount * Token::kStringsPerSlot) {}
+  TokenStorage() {}
 
-  std::vector<std::string> hash_table_;
+  std::string hash_table_[Token::kHashSlotCount * Token::kStringsPerSlot];
   // The collision table contains Tokens whose hash values collide with one of
   // the existing Token.  This should happen very rare.
   std::set<std::string> collision_table_;
diff --git a/src/cobalt/black_box_tests/black_box_tests.py b/src/cobalt/black_box_tests/black_box_tests.py
index 09954c0..fb5d552 100644
--- a/src/cobalt/black_box_tests/black_box_tests.py
+++ b/src/cobalt/black_box_tests/black_box_tests.py
@@ -114,7 +114,8 @@
       output_file=None,
       out_directory=launcher_params.out_directory,
       loader_platform=launcher_params.loader_platform,
-      loader_config=launcher_params.loader_config)
+      loader_config=launcher_params.loader_config,
+      loader_out_directory=launcher_params.loader_out_directory)
 
   test_targets = _TESTS_NO_SIGNAL
 
@@ -139,7 +140,8 @@
                proxy_address=None,
                proxy_port=None,
                test_name=None,
-               wpt_http_port=None):
+               wpt_http_port=None,
+               device_ips=None):
     logging.basicConfig(level=logging.DEBUG)
 
     # Setup global variables used by test cases.
@@ -170,6 +172,7 @@
 
     self.proxy_port = proxy_port
     self.test_name = test_name
+    self.device_ips = device_ips
 
     # Test domains used in web platform tests to be resolved to the server
     # binding address.
@@ -188,7 +191,8 @@
     logging.info('Using proxy port: %s', self.proxy_port)
 
     with ProxyServer(
-        port=self.proxy_port, host_resolve_map=self.host_resolve_map):
+        port=self.proxy_port, host_resolve_map=self.host_resolve_map,
+        client_ips=self.device_ips):
       if self.test_name:
         suite = unittest.TestLoader().loadTestsFromModule(
             importlib.import_module(_TEST_DIR_PATH + self.test_name))
@@ -217,7 +221,7 @@
         for sock in socks:
           result = sock[1].connect_ex((sock[0], port))
           if result == SOCKET_SUCCESS:
-            ununsed = False
+            unused = False
             break
         if unused:
           return port
@@ -258,11 +262,17 @@
       help=('Port used to create the web platform test http'
             'server. If not specified, a random free port is'
             'used.'))
+  parser.add_argument(
+      '--device_ips',
+      default=None,
+      nargs='*',
+      help=('IPs of test devices that will be allowed to connect. If not'
+            'specified, all IPs will be allowed to connect.'))
   args, _ = parser.parse_known_args()
 
   test_object = BlackBoxTests(args.server_binding_address, args.proxy_address,
                               args.proxy_port, args.test_name,
-                              args.wpt_http_port)
+                              args.wpt_http_port, args.device_ips)
   sys.exit(test_object.Run())
 
 
diff --git a/src/cobalt/black_box_tests/proxy_server.py b/src/cobalt/black_box_tests/proxy_server.py
index ee29a39..5b51830 100644
--- a/src/cobalt/black_box_tests/proxy_server.py
+++ b/src/cobalt/black_box_tests/proxy_server.py
@@ -24,15 +24,16 @@
 import os
 import signal
 import subprocess
-import sys
-SRC_DIR = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)
 import tempfile
 import time
 
+SRC_DIR = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)
+
 
 class ProxyServer(object):
 
-  def __init__(self, hostname='0.0.0.0', port='8000', host_resolve_map=None):
+  def __init__(self, hostname='0.0.0.0', port='8000', host_resolve_map=None,
+               client_ips=None):
     self.command = [
         'python',
         os.path.join(SRC_DIR, 'third_party', 'proxy_py', 'proxy.py'),
@@ -42,10 +43,14 @@
     self.host_resolver_path = None
 
     if host_resolve_map:
-        with tempfile.NamedTemporaryFile(delete=False) as hosts:
-            json.dump(host_resolve_map, hosts)
-        self.host_resolver_path = hosts.name
-        self.command += ['--host_resolver', self.host_resolver_path]
+      with tempfile.NamedTemporaryFile(delete=False) as hosts:
+        json.dump(host_resolve_map, hosts)
+      self.host_resolver_path = hosts.name
+      self.command += ['--host_resolver', self.host_resolver_path]
+
+    if client_ips:
+      self.command += ['--client_ips']
+      self.command += client_ips
 
   def __enter__(self):
     self.proc = subprocess.Popen(self.command)
@@ -55,4 +60,4 @@
   def __exit__(self, exc_type, exc_value, traceback):
     self.proc.send_signal(signal.SIGINT)
     if self.host_resolver_path:
-        os.unlink(self.host_resolver_path)
+      os.unlink(self.host_resolver_path)
diff --git a/src/cobalt/black_box_tests/tests/web_platform_tests.py b/src/cobalt/black_box_tests/tests/web_platform_tests.py
index c2a1609..6eabeaa 100644
--- a/src/cobalt/black_box_tests/tests/web_platform_tests.py
+++ b/src/cobalt/black_box_tests/tests/web_platform_tests.py
@@ -71,6 +71,7 @@
           out_directory=self.launcher_params.out_directory,
           env_variables={'ASAN_OPTIONS': 'intercept_tls_get_addr=0'},
           loader_platform=self.launcher_params.loader_platform,
-          loader_config=self.launcher_params.loader_config)
+          loader_config=self.launcher_params.loader_config,
+          loader_out_directory=self.launcher_params.loader_out_directory)
       status = launcher.Run()
       self.assertEqual(status, 0)
diff --git a/src/cobalt/browser/browser.gyp b/src/cobalt/browser/browser.gyp
index bc81212..3c32571 100644
--- a/src/cobalt/browser/browser.gyp
+++ b/src/cobalt/browser/browser.gyp
@@ -15,7 +15,7 @@
 {
   'variables': {
     'sb_pedantic_warnings': 1,
-    'has_updater%' : '<!(python ../../build/file_exists.py <(DEPTH)/cobalt/updater/updater.gyp)',
+    'has_updater%' : '<!(python <(DEPTH)/build/file_exists.py <(DEPTH)/cobalt/updater/updater.gyp)',
   },
   'targets': [
     {
@@ -203,7 +203,7 @@
             'COBALT_MESH_CACHE_SIZE_IN_BYTES=<(mesh_cache_size_in_bytes)',
           ],
         }],
-        ['sb_evergreen == 1 and has_updater == "True"', {
+        ['sb_evergreen == 1 and has_updater == 1', {
           'dependencies': [
             '<(DEPTH)/cobalt/updater/updater.gyp:updater',
           ],
diff --git a/src/cobalt/build/build.id b/src/cobalt/build/build.id
index 689d9d7..4b76bcd 100644
--- a/src/cobalt/build/build.id
+++ b/src/cobalt/build/build.id
@@ -1 +1 @@
-246192
\ No newline at end of file
+248273
\ No newline at end of file
diff --git a/src/cobalt/debug/remote/devtools/METADATA b/src/cobalt/debug/remote/devtools/METADATA
new file mode 100644
index 0000000..fae5e46
--- /dev/null
+++ b/src/cobalt/debug/remote/devtools/METADATA
@@ -0,0 +1,20 @@
+name: "devtools"
+description:
+  "Subtree at cobalt/debug/remote/devtools."
+
+third_party {
+  url {
+    type: LOCAL_SOURCE
+    value: "/third_party/chromium/devtools_mirror"
+  }
+  url {
+    type: GIT
+    value: "https://chromium.googlesource.com/chromium/src/third_party/blink/renderer/devtools"
+  }
+  version: "fc673662ca9017b56bfdf0f961591f8e87a27346"
+  last_upgrade_date {
+    year: 2018
+    month: 7
+    day: 3
+  }
+}
diff --git a/src/cobalt/debug/remote/devtools/front_end/accessibility/AXBreadcrumbsPane.js b/src/cobalt/debug/remote/devtools/front_end/accessibility/AXBreadcrumbsPane.js
index 34708e0..9075c5e 100644
--- a/src/cobalt/debug/remote/devtools/front_end/accessibility/AXBreadcrumbsPane.js
+++ b/src/cobalt/debug/remote/devtools/front_end/accessibility/AXBreadcrumbsPane.js
@@ -112,7 +112,7 @@
   _onKeyDown(event) {
     if (!this._preselectedBreadcrumb)
       return;
-    if (!event.path.some(element => element === this._preselectedBreadcrumb.element()))
+    if (!event.composedPath().some(element => element === this._preselectedBreadcrumb.element()))
       return;
     if (event.shiftKey || event.metaKey || event.ctrlKey)
       return;
diff --git a/src/cobalt/debug/remote/devtools/front_end/accessibility/AccessibilityNodeView.js b/src/cobalt/debug/remote/devtools/front_end/accessibility/AccessibilityNodeView.js
index f0c0a2e..9bb5329 100644
--- a/src/cobalt/debug/remote/devtools/front_end/accessibility/AccessibilityNodeView.js
+++ b/src/cobalt/debug/remote/devtools/front_end/accessibility/AccessibilityNodeView.js
@@ -151,7 +151,7 @@
    * @return {!Element}
    */
   static createExclamationMark(tooltip) {
-    const exclamationElement = createElement('label', 'dt-icon-label');
+    const exclamationElement = createElement('span', 'dt-icon-label');
     exclamationElement.type = 'smallicon-warning';
     exclamationElement.title = tooltip;
     return exclamationElement;
diff --git a/src/cobalt/debug/remote/devtools/front_end/accessibility/accessibilityNode.css b/src/cobalt/debug/remote/devtools/front_end/accessibility/accessibilityNode.css
index a6e59ca..7b624a9 100644
--- a/src/cobalt/debug/remote/devtools/front_end/accessibility/accessibilityNode.css
+++ b/src/cobalt/debug/remote/devtools/front_end/accessibility/accessibilityNode.css
@@ -47,7 +47,7 @@
     padding-left: 4px;
 }
 
-.tree-outline label[is=dt-icon-label] {
+.tree-outline span[is=dt-icon-label] {
     position: relative;
     left: -11px;
 }
@@ -74,7 +74,7 @@
     left: -2px;
 }
 
-.tree-outline label[is=dt-icon-label] + .ax-name {
+.tree-outline span[is=dt-icon-label] + .ax-name {
     margin-left: -11px;
 }
 
diff --git a/src/cobalt/debug/remote/devtools/front_end/changes/changesView.css b/src/cobalt/debug/remote/devtools/front_end/changes/changesView.css
index 8d3ad90..552e9ec 100644
--- a/src/cobalt/debug/remote/devtools/front_end/changes/changesView.css
+++ b/src/cobalt/debug/remote/devtools/front_end/changes/changesView.css
@@ -3,14 +3,15 @@
  * Use of this source code is governed by a BSD-style license that can be
  * found in the LICENSE file.
  */
-.insertion-point-main{
+[slot=insertion-point-main]{
     flex-direction: column;
     display: flex;
 }
 
-.insertion-point-sidebar {
+[slot=insertion-point-sidebar] {
     overflow: auto;
 }
+
 .editor-container{
     flex: 1;
 }
diff --git a/src/cobalt/debug/remote/devtools/front_end/console/ConsoleViewMessage.js b/src/cobalt/debug/remote/devtools/front_end/console/ConsoleViewMessage.js
index fdc9790..ee0d012 100644
--- a/src/cobalt/debug/remote/devtools/front_end/console/ConsoleViewMessage.js
+++ b/src/cobalt/debug/remote/devtools/front_end/console/ConsoleViewMessage.js
@@ -1179,7 +1179,7 @@
       return;
 
     if (!this._repeatCountElement) {
-      this._repeatCountElement = createElementWithClass('label', 'console-message-repeat-count', 'dt-small-bubble');
+      this._repeatCountElement = createElementWithClass('span', 'console-message-repeat-count', 'dt-small-bubble');
       switch (this._message.level) {
         case SDK.ConsoleMessage.MessageLevel.Warning:
           this._repeatCountElement.type = 'warning';
diff --git a/src/cobalt/debug/remote/devtools/front_end/console_counters/WarningErrorCounter.js b/src/cobalt/debug/remote/devtools/front_end/console_counters/WarningErrorCounter.js
index b51e2ef..b17e8ae 100644
--- a/src/cobalt/debug/remote/devtools/front_end/console_counters/WarningErrorCounter.js
+++ b/src/cobalt/debug/remote/devtools/front_end/console_counters/WarningErrorCounter.js
@@ -39,7 +39,7 @@
    */
   _createItem(shadowRoot, iconType) {
     const item = createElementWithClass('span', 'counter-item');
-    const icon = item.createChild('label', '', 'dt-icon-label');
+    const icon = item.createChild('span', '', 'dt-icon-label');
     icon.type = iconType;
     const text = icon.createChild('span');
     shadowRoot.appendChild(item);
diff --git a/src/cobalt/debug/remote/devtools/front_end/console_counters/errorWarningCounter.css b/src/cobalt/debug/remote/devtools/front_end/console_counters/errorWarningCounter.css
index d6ad447..ee6de7a 100644
--- a/src/cobalt/debug/remote/devtools/front_end/console_counters/errorWarningCounter.css
+++ b/src/cobalt/debug/remote/devtools/front_end/console_counters/errorWarningCounter.css
@@ -18,10 +18,6 @@
     margin-left: 6px;
 }
 
-.counter-item label {
-    cursor: inherit;
-}
-
 .counter-item.counter-item-first {
     margin-left: 0;
 }
diff --git a/src/cobalt/debug/remote/devtools/front_end/dom_extension/DOMExtension.js b/src/cobalt/debug/remote/devtools/front_end/dom_extension/DOMExtension.js
index baa2879..ae9eb89 100644
--- a/src/cobalt/debug/remote/devtools/front_end/dom_extension/DOMExtension.js
+++ b/src/cobalt/debug/remote/devtools/front_end/dom_extension/DOMExtension.js
@@ -270,10 +270,12 @@
  */
 Node.prototype.hasSelection = function() {
   // TODO(luoe): use contains(node, {includeShadow: true}) when it is fixed for shadow dom.
-  const contents = this.querySelectorAll('content');
-  for (const content of contents) {
-    if (Array.prototype.some.call(content.getDistributedNodes(), node => node.hasSelection()))
-      return true;
+  if (this instanceof Element) {
+    const slots = this.querySelectorAll('slot');
+    for (const slot of slots) {
+      if (Array.prototype.some.call(slot.assignedNodes(), node => node.hasSelection()))
+        return true;
+    }
   }
 
   const selection = this.getComponentSelection();
@@ -299,10 +301,11 @@
  * @param {string} tagName
  * @param {string=} customElementType
  * @return {!Element}
+ * @suppress {checkTypes}
  * @suppressGlobalPropertiesCheck
  */
 function createElement(tagName, customElementType) {
-  return document.createElement(tagName, customElementType || '');
+  return document.createElement(tagName, {is: customElementType});
 }
 
 /**
@@ -318,10 +321,11 @@
  * @param {string} elementName
  * @param {string=} className
  * @param {string=} customElementType
+ * @suppress {checkTypes}
  * @return {!Element}
  */
 Document.prototype.createElementWithClass = function(elementName, className, customElementType) {
-  const element = this.createElement(elementName, customElementType || '');
+  const element = this.createElement(elementName, {is: customElementType});
   if (className)
     element.className = className;
   return element;
@@ -651,7 +655,7 @@
   if (this.shadowRoot)
     return this.shadowRoot;
 
-  const distributedNodes = this.getDistributedNodes ? this.getDistributedNodes() : [];
+  const distributedNodes = this instanceof HTMLSlotElement ? this.assignedNodes() : [];
 
   if (distributedNodes.length)
     return distributedNodes[0];
@@ -668,7 +672,7 @@
     if (sibling)
       return sibling;
 
-    node = insertionPoint(node) || node.parentNodeOrShadowHost();
+    node = node.assignedSlot || node.parentNodeOrShadowHost();
   }
 
   /**
@@ -676,10 +680,9 @@
    * @return {?Node}
    */
   function nextSibling(node) {
-    const parent = insertionPoint(node);
-    if (!parent)
+    if (!node.assignedSlot)
       return node.nextSibling;
-    const distributedNodes = parent.getDistributedNodes ? parent.getDistributedNodes() : [];
+    const distributedNodes = node.assignedSlot.assignedNodes();
 
     const position = Array.prototype.indexOf.call(distributedNodes, node);
     if (position + 1 < distributedNodes.length)
@@ -687,15 +690,6 @@
     return null;
   }
 
-  /**
-   * @param {!Node} node
-   * @return {?Node}
-   */
-  function insertionPoint(node) {
-    const insertionPoints = node.getDestinationInsertionPoints ? node.getDestinationInsertionPoints() : [];
-    return insertionPoints.length > 0 ? insertionPoints[insertionPoints.length - 1] : null;
-  }
-
   return null;
 };
 
diff --git a/src/cobalt/debug/remote/devtools/front_end/elements/ElementsSidebarPane.js b/src/cobalt/debug/remote/devtools/front_end/elements/ElementsSidebarPane.js
index 5676b09..1f76f3d 100644
--- a/src/cobalt/debug/remote/devtools/front_end/elements/ElementsSidebarPane.js
+++ b/src/cobalt/debug/remote/devtools/front_end/elements/ElementsSidebarPane.js
@@ -5,8 +5,11 @@
  * @unrestricted
  */
 Elements.ElementsSidebarPane = class extends UI.VBox {
-  constructor() {
-    super(true);
+  /**
+   * @param {boolean=} delegatesFocus
+   */
+  constructor(delegatesFocus) {
+    super(true, delegatesFocus);
     this.element.classList.add('flex-none');
     this._computedStyleModel = new Elements.ComputedStyleModel();
     this._computedStyleModel.addEventListener(
diff --git a/src/cobalt/debug/remote/devtools/front_end/elements/StylesSidebarPane.js b/src/cobalt/debug/remote/devtools/front_end/elements/StylesSidebarPane.js
index 2845ba4..7a10535 100644
--- a/src/cobalt/debug/remote/devtools/front_end/elements/StylesSidebarPane.js
+++ b/src/cobalt/debug/remote/devtools/front_end/elements/StylesSidebarPane.js
@@ -29,10 +29,9 @@
 
 Elements.StylesSidebarPane = class extends Elements.ElementsSidebarPane {
   constructor() {
-    super();
+    super(true /* delegatesFocus */);
     this.setMinimumSize(96, 26);
     this.registerRequiredCSS('elements/stylesSidebarPane.css');
-    this.element.tabIndex = -1;
 
     Common.moduleSetting('colorFormat').addChangeListener(this.update.bind(this));
     Common.moduleSetting('textEditorIndent').addChangeListener(this.update.bind(this));
@@ -94,7 +93,7 @@
    * @return {!Element}
    */
   static createExclamationMark(property) {
-    const exclamationElement = createElement('label', 'dt-icon-label');
+    const exclamationElement = createElement('span', 'dt-icon-label');
     exclamationElement.className = 'exclamation-mark';
     if (!Elements.StylesSidebarPane.ignoreErrorsForProperty(property))
       exclamationElement.type = 'smallicon-warning';
diff --git a/src/cobalt/debug/remote/devtools/front_end/elements/classesPaneWidget.css b/src/cobalt/debug/remote/devtools/front_end/elements/classesPaneWidget.css
index ee810fe..01aec13 100644
--- a/src/cobalt/debug/remote/devtools/front_end/elements/classesPaneWidget.css
+++ b/src/cobalt/debug/remote/devtools/front_end/elements/classesPaneWidget.css
@@ -16,7 +16,7 @@
     justify-content: flex-start;
 }
 
-.styles-element-classes-pane label {
+.styles-element-classes-pane [is=dt-checkbox] {
     margin-right: 15px;
 }
 
diff --git a/src/cobalt/debug/remote/devtools/front_end/emulation/DeviceModeView.js b/src/cobalt/debug/remote/devtools/front_end/emulation/DeviceModeView.js
index e77cf26..144a61b 100644
--- a/src/cobalt/debug/remote/devtools/front_end/emulation/DeviceModeView.js
+++ b/src/cobalt/debug/remote/devtools/front_end/emulation/DeviceModeView.js
@@ -74,7 +74,7 @@
     this._bottomResizerElement.title = Common.UIString('Double-click for full height');
 
     this._pageArea = this._screenArea.createChild('div', 'device-mode-page-area');
-    this._pageArea.createChild('content');
+    this._pageArea.createChild('slot');
   }
 
   _populatePresetsContainer() {
diff --git a/src/cobalt/debug/remote/devtools/front_end/emulation/sensors.css b/src/cobalt/debug/remote/devtools/front_end/emulation/sensors.css
index 03c1311..6960e86 100644
--- a/src/cobalt/debug/remote/devtools/front_end/emulation/sensors.css
+++ b/src/cobalt/debug/remote/devtools/front_end/emulation/sensors.css
@@ -9,10 +9,6 @@
     display: block;
 }
 
-.sensors-view label {
-    margin-bottom: 10px;
-}
-
 .sensors-view input {
     width: 100%;
     max-width: 100px;
diff --git a/src/cobalt/debug/remote/devtools/front_end/inline_editor/CSSShadowEditor.js b/src/cobalt/debug/remote/devtools/front_end/inline_editor/CSSShadowEditor.js
index ddaa9f8..83b8b1a 100644
--- a/src/cobalt/debug/remote/devtools/front_end/inline_editor/CSSShadowEditor.js
+++ b/src/cobalt/debug/remote/devtools/front_end/inline_editor/CSSShadowEditor.js
@@ -68,7 +68,7 @@
    * @return {!Element}
    */
   _createSlider(field) {
-    const slider = UI.createSliderLabel(0, InlineEditor.CSSShadowEditor.maxRange, -1);
+    const slider = UI.createSlider(0, InlineEditor.CSSShadowEditor.maxRange, -1);
     slider.addEventListener('input', this._onSliderInput.bind(this), false);
     field.appendChild(slider);
     return slider;
diff --git a/src/cobalt/debug/remote/devtools/front_end/inline_editor/ColorSwatch.js b/src/cobalt/debug/remote/devtools/front_end/inline_editor/ColorSwatch.js
index 5f5eb0b..2dfc68a 100644
--- a/src/cobalt/debug/remote/devtools/front_end/inline_editor/ColorSwatch.js
+++ b/src/cobalt/debug/remote/devtools/front_end/inline_editor/ColorSwatch.js
@@ -7,6 +7,17 @@
 InlineEditor.ColorSwatch = class extends HTMLSpanElement {
   constructor() {
     super();
+    const root = UI.createShadowRootWithCoreStyles(this, 'inline_editor/colorSwatch.css');
+
+    this._iconElement = root.createChild('span', 'color-swatch');
+    this._iconElement.title = Common.UIString('Shift-click to change color format');
+    this._swatchInner = this._iconElement.createChild('span', 'color-swatch-inner');
+    this._swatchInner.addEventListener('dblclick', e => e.consume(), false);
+    this._swatchInner.addEventListener('mousedown', e => e.consume(), false);
+    this._swatchInner.addEventListener('click', this._handleClick.bind(this), true);
+
+    root.createChild('slot');
+    this._colorValueElement = this.createChild('span');
   }
 
   /**
@@ -15,11 +26,11 @@
   static create() {
     if (!InlineEditor.ColorSwatch._constructor) {
       InlineEditor.ColorSwatch._constructor =
-          UI.registerCustomElement('span', 'color-swatch', InlineEditor.ColorSwatch.prototype);
+          UI.registerCustomElement('span', 'color-swatch', InlineEditor.ColorSwatch);
     }
 
 
-    return /** @type {!InlineEditor.ColorSwatch} */ (new InlineEditor.ColorSwatch._constructor());
+    return /** @type {!InlineEditor.ColorSwatch} */ (InlineEditor.ColorSwatch._constructor());
   }
 
   /**
@@ -134,23 +145,6 @@
   }
 
   /**
-   * @override
-   */
-  createdCallback() {
-    const root = UI.createShadowRootWithCoreStyles(this, 'inline_editor/colorSwatch.css');
-
-    this._iconElement = root.createChild('span', 'color-swatch');
-    this._iconElement.title = Common.UIString('Shift-click to change color format');
-    this._swatchInner = this._iconElement.createChild('span', 'color-swatch-inner');
-    this._swatchInner.addEventListener('dblclick', e => e.consume(), false);
-    this._swatchInner.addEventListener('mousedown', e => e.consume(), false);
-    this._swatchInner.addEventListener('click', this._handleClick.bind(this), true);
-
-    root.createChild('content');
-    this._colorValueElement = this.createChild('span');
-  }
-
-  /**
    * @param {!Event} event
    */
   _handleClick(event) {
@@ -168,6 +162,11 @@
 InlineEditor.BezierSwatch = class extends HTMLSpanElement {
   constructor() {
     super();
+    const root = UI.createShadowRootWithCoreStyles(this, 'inline_editor/bezierSwatch.css');
+    this._iconElement = UI.Icon.create('smallicon-bezier', 'bezier-swatch-icon');
+    root.appendChild(this._iconElement);
+    this._textElement = this.createChild('span');
+    root.createChild('slot');
   }
 
   /**
@@ -176,11 +175,11 @@
   static create() {
     if (!InlineEditor.BezierSwatch._constructor) {
       InlineEditor.BezierSwatch._constructor =
-          UI.registerCustomElement('span', 'bezier-swatch', InlineEditor.BezierSwatch.prototype);
+          UI.registerCustomElement('span', 'bezier-swatch', InlineEditor.BezierSwatch);
     }
 
 
-    return /** @type {!InlineEditor.BezierSwatch} */ (new InlineEditor.BezierSwatch._constructor());
+    return /** @type {!InlineEditor.BezierSwatch} */ (InlineEditor.BezierSwatch._constructor());
   }
 
   /**
@@ -210,17 +209,6 @@
   iconElement() {
     return this._iconElement;
   }
-
-  /**
-   * @override
-   */
-  createdCallback() {
-    const root = UI.createShadowRootWithCoreStyles(this, 'inline_editor/bezierSwatch.css');
-    this._iconElement = UI.Icon.create('smallicon-bezier', 'bezier-swatch-icon');
-    root.appendChild(this._iconElement);
-    this._textElement = this.createChild('span');
-    root.createChild('content');
-  }
 };
 
 /**
@@ -229,6 +217,11 @@
 InlineEditor.CSSShadowSwatch = class extends HTMLSpanElement {
   constructor() {
     super();
+    const root = UI.createShadowRootWithCoreStyles(this, 'inline_editor/cssShadowSwatch.css');
+    this._iconElement = UI.Icon.create('smallicon-shadow', 'shadow-swatch-icon');
+    root.appendChild(this._iconElement);
+    root.createChild('slot');
+    this._contentElement = this.createChild('span');
   }
 
   /**
@@ -237,10 +230,10 @@
   static create() {
     if (!InlineEditor.CSSShadowSwatch._constructor) {
       InlineEditor.CSSShadowSwatch._constructor =
-          UI.registerCustomElement('span', 'css-shadow-swatch', InlineEditor.CSSShadowSwatch.prototype);
+          UI.registerCustomElement('span', 'css-shadow-swatch', InlineEditor.CSSShadowSwatch);
     }
 
-    return /** @type {!InlineEditor.CSSShadowSwatch} */ (new InlineEditor.CSSShadowSwatch._constructor());
+    return /** @type {!InlineEditor.CSSShadowSwatch} */ (InlineEditor.CSSShadowSwatch._constructor());
   }
 
   /**
@@ -290,15 +283,4 @@
   colorSwatch() {
     return this._colorSwatch;
   }
-
-  /**
-   * @override
-   */
-  createdCallback() {
-    const root = UI.createShadowRootWithCoreStyles(this, 'inline_editor/cssShadowSwatch.css');
-    this._iconElement = UI.Icon.create('smallicon-shadow', 'shadow-swatch-icon');
-    root.appendChild(this._iconElement);
-    root.createChild('content');
-    this._contentElement = this.createChild('span');
-  }
 };
diff --git a/src/cobalt/debug/remote/devtools/front_end/inspector_main/renderingOptions.css b/src/cobalt/debug/remote/devtools/front_end/inspector_main/renderingOptions.css
index 77eeb51..b478b44 100644
--- a/src/cobalt/debug/remote/devtools/front_end/inspector_main/renderingOptions.css
+++ b/src/cobalt/debug/remote/devtools/front_end/inspector_main/renderingOptions.css
@@ -8,7 +8,7 @@
     padding: 12px;
  }
 
-label {
+[is=dt-checkbox] {
     margin: 0px 0px 10px 0px;
     flex: none;
 }
diff --git a/src/cobalt/debug/remote/devtools/front_end/layers_test_runner/LayersTestRunner.js b/src/cobalt/debug/remote/devtools/front_end/layers_test_runner/LayersTestRunner.js
index d5c69d7..20e51c3 100644
--- a/src/cobalt/debug/remote/devtools/front_end/layers_test_runner/LayersTestRunner.js
+++ b/src/cobalt/debug/remote/devtools/front_end/layers_test_runner/LayersTestRunner.js
@@ -106,7 +106,8 @@
     screenY: totalOffset.top - element.scrollTop + offsetY,
     clientX: totalOffset.left + offsetX,
     clientY: totalOffset.top + offsetY,
-    button: button
+    button: button,
+    composed: true
   };
 
   if (eventType === 'mouseout') {
diff --git a/src/cobalt/debug/remote/devtools/front_end/network/RequestHeadersView.js b/src/cobalt/debug/remote/devtools/front_end/network/RequestHeadersView.js
index 5c5b4de..2d9ee3e 100644
--- a/src/cobalt/debug/remote/devtools/front_end/network/RequestHeadersView.js
+++ b/src/cobalt/debug/remote/devtools/front_end/network/RequestHeadersView.js
@@ -379,7 +379,7 @@
       statusCodeFragment.createChild('div', 'header-name').textContent = Common.UIString('Status Code') + ': ';
       statusCodeFragment.createChild('span', 'header-separator');
 
-      const statusCodeImage = statusCodeFragment.createChild('label', 'resource-status-image', 'dt-icon-label');
+      const statusCodeImage = statusCodeFragment.createChild('span', 'resource-status-image', 'dt-icon-label');
       statusCodeImage.title = this._request.statusCode + ' ' + this._request.statusText;
 
       if (this._request.statusCode < 300 || this._request.statusCode === 304)
@@ -440,7 +440,7 @@
     if (provisionalHeaders) {
       const cautionText = Common.UIString('Provisional headers are shown');
       const cautionFragment = createDocumentFragment();
-      cautionFragment.createChild('label', '', 'dt-icon-label').type = 'smallicon-warning';
+      cautionFragment.createChild('span', '', 'dt-icon-label').type = 'smallicon-warning';
       cautionFragment.createChild('div', 'caution').textContent = cautionText;
       const cautionTreeElement = new UI.TreeElement(cautionFragment);
       cautionTreeElement.selectable = false;
diff --git a/src/cobalt/debug/remote/devtools/front_end/network/networkConfigView.css b/src/cobalt/debug/remote/devtools/front_end/network/networkConfigView.css
index 5c9f81f..6377126 100644
--- a/src/cobalt/debug/remote/devtools/front_end/network/networkConfigView.css
+++ b/src/cobalt/debug/remote/devtools/front_end/network/networkConfigView.css
@@ -57,11 +57,11 @@
     line-height: 20px;
 }
 
-.network-config-ua label[is="dt-radio"].checked > * {
+.network-config-ua span[is="dt-radio"].checked > * {
     display: none
 }
 
-.network-config-ua input:not(.dt-radio-button) {
+.network-config-ua input {
     display: block;
     width: calc(100% - 20px);
     max-width: 250px;
diff --git a/src/cobalt/debug/remote/devtools/front_end/network/networkLogView.css b/src/cobalt/debug/remote/devtools/front_end/network/networkLogView.css
index b7240de..bf39802 100644
--- a/src/cobalt/debug/remote/devtools/front_end/network/networkLogView.css
+++ b/src/cobalt/debug/remote/devtools/front_end/network/networkLogView.css
@@ -44,7 +44,7 @@
     overflow: hidden;
 }
 
-.network-summary-bar label[is=dt-icon-label] {
+.network-summary-bar span[is=dt-icon-label] {
     margin-right: 6px;
 }
 
diff --git a/src/cobalt/debug/remote/devtools/front_end/object_ui/ObjectPropertiesSection.js b/src/cobalt/debug/remote/devtools/front_end/object_ui/ObjectPropertiesSection.js
index 88a7f85..5cdc53f 100644
--- a/src/cobalt/debug/remote/devtools/front_end/object_ui/ObjectPropertiesSection.js
+++ b/src/cobalt/debug/remote/devtools/front_end/object_ui/ObjectPropertiesSection.js
@@ -426,7 +426,7 @@
    * @param {!Array.<!SDK.RemoteObjectProperty>=} extraProperties
    */
   constructor(object, linkifier, emptyPlaceholder, ignoreHasOwnProperty, extraProperties) {
-    const contentElement = createElement('content');
+    const contentElement = createElement('slot');
     super(contentElement);
 
     this._object = object;
diff --git a/src/cobalt/debug/remote/devtools/front_end/profiler/profilesPanel.css b/src/cobalt/debug/remote/devtools/front_end/profiler/profilesPanel.css
index eab0f1d..4a5384a 100644
--- a/src/cobalt/debug/remote/devtools/front_end/profiler/profilesPanel.css
+++ b/src/cobalt/debug/remote/devtools/front_end/profiler/profilesPanel.css
@@ -128,7 +128,7 @@
     margin: 0 0 5px 0;
 }
 
-.profile-launcher-view-content label {
+.profile-launcher-view-content [is=dt-radio] {
     font-size: 13px;
 }
 
@@ -165,7 +165,7 @@
     margin-left: 22px;
 }
 
-.profile-launcher-view-content p label {
+.profile-launcher-view-content p [is=dt-checkbox] {
     display: flex;
 }
 
@@ -190,7 +190,7 @@
     to { background-color: rgba(255, 255, 120, 0); }
 }
 
-.profile-canvas-decoration label[is=dt-icon-label] {
+.profile-canvas-decoration span[is=dt-icon-label] {
     margin-right: 4px;
 }
 
diff --git a/src/cobalt/debug/remote/devtools/front_end/resources/ApplicationCacheItemsView.js b/src/cobalt/debug/remote/devtools/front_end/resources/ApplicationCacheItemsView.js
index 6c2373b..4f9dcfd 100644
--- a/src/cobalt/debug/remote/devtools/front_end/resources/ApplicationCacheItemsView.js
+++ b/src/cobalt/debug/remote/devtools/front_end/resources/ApplicationCacheItemsView.js
@@ -38,9 +38,9 @@
     this._deleteButton.setVisible(false);
     this._deleteButton.addEventListener(UI.ToolbarButton.Events.Click, this._deleteButtonClicked, this);
 
-    this._connectivityIcon = createElement('label', 'dt-icon-label');
+    this._connectivityIcon = createElement('span', 'dt-icon-label');
     this._connectivityIcon.style.margin = '0 2px 0 5px';
-    this._statusIcon = createElement('label', 'dt-icon-label');
+    this._statusIcon = createElement('span', 'dt-icon-label');
     this._statusIcon.style.margin = '0 2px 0 5px';
 
     this._frameId = frameId;
diff --git a/src/cobalt/debug/remote/devtools/front_end/security/SecurityPanel.js b/src/cobalt/debug/remote/devtools/front_end/security/SecurityPanel.js
index 44f890f..693249d 100644
--- a/src/cobalt/debug/remote/devtools/front_end/security/SecurityPanel.js
+++ b/src/cobalt/debug/remote/devtools/front_end/security/SecurityPanel.js
@@ -78,7 +78,7 @@
       return text;
     }
 
-    const highlightedUrl = createElement('span', 'url-text');
+    const highlightedUrl = createElement('span');
 
     const scheme = url.substr(0, index);
     const content = url.substr(index + schemeSeparator.length);
diff --git a/src/cobalt/debug/remote/devtools/front_end/settings/settingsScreen.css b/src/cobalt/debug/remote/devtools/front_end/settings/settingsScreen.css
index 47c80a7..9989041 100644
--- a/src/cobalt/debug/remote/devtools/front_end/settings/settingsScreen.css
+++ b/src/cobalt/debug/remote/devtools/front_end/settings/settingsScreen.css
@@ -211,15 +211,11 @@
     margin-left: 10px;
 }
 
-.settings-indent-labels label {
-    padding-left: 10px;
-}
-
 .settings-experiment-hidden {
     display: none;
 }
 
-.settings-experiment-hidden label {
+.settings-experiment-hidden [is=dt-checkbox] {
     background-color: #ddd;
 }
 
diff --git a/src/cobalt/debug/remote/devtools/front_end/sources/UISourceCodeFrame.js b/src/cobalt/debug/remote/devtools/front_end/sources/UISourceCodeFrame.js
index 47de620..27ee88e 100644
--- a/src/cobalt/debug/remote/devtools/front_end/sources/UISourceCodeFrame.js
+++ b/src/cobalt/debug/remote/devtools/front_end/sources/UISourceCodeFrame.js
@@ -582,7 +582,7 @@
     this._icon = this.element.createChild('label', '', 'dt-icon-label');
     this._icon.type = Sources.UISourceCodeFrame._iconClassPerLevel[message.level()];
     this._repeatCountElement =
-        this.element.createChild('label', 'text-editor-row-message-repeat-count hidden', 'dt-small-bubble');
+        this.element.createChild('span', 'text-editor-row-message-repeat-count hidden', 'dt-small-bubble');
     this._repeatCountElement.type = Sources.UISourceCodeFrame._bubbleTypePerLevel[message.level()];
     const linesContainer = this.element.createChild('div');
     const lines = this._message.text().split('\n');
@@ -634,7 +634,7 @@
     this._decoration = createElementWithClass('div', 'text-editor-line-decoration');
     this._decoration._messageBucket = this;
     this._wave = this._decoration.createChild('div', 'text-editor-line-decoration-wave');
-    this._icon = this._wave.createChild('label', 'text-editor-line-decoration-icon', 'dt-icon-label');
+    this._icon = this._wave.createChild('span', 'text-editor-line-decoration-icon', 'dt-icon-label');
     /** @type {?number} */
     this._decorationStartColumn = null;
 
diff --git a/src/cobalt/debug/remote/devtools/front_end/sources/sourcesPanel.css b/src/cobalt/debug/remote/devtools/front_end/sources/sourcesPanel.css
index 4b49787..17d4d4a 100644
--- a/src/cobalt/debug/remote/devtools/front_end/sources/sourcesPanel.css
+++ b/src/cobalt/debug/remote/devtools/front_end/sources/sourcesPanel.css
@@ -50,7 +50,7 @@
     margin-top: 0;
 }
 
-.scripts-debug-toolbar-drawer > label {
+.scripts-debug-toolbar-drawer > [is=dt-checkbox] {
     display: flex;
     padding-left: 3px;
     height: 28px;
diff --git a/src/cobalt/debug/remote/devtools/front_end/timeline/TimelineHistoryManager.js b/src/cobalt/debug/remote/devtools/front_end/timeline/TimelineHistoryManager.js
index 7bd3fc0..ecd5308 100644
--- a/src/cobalt/debug/remote/devtools/front_end/timeline/TimelineHistoryManager.js
+++ b/src/cobalt/debug/remote/devtools/front_end/timeline/TimelineHistoryManager.js
@@ -426,12 +426,11 @@
    * @param {!UI.Action} action
    */
   constructor(action) {
-    super(createElementWithClass('button', 'dropdown-button'));
-    const shadowRoot = UI.createShadowRootWithCoreStyles(this.element, 'timeline/historyToolbarButton.css');
-
-    this._contentElement = shadowRoot.createChild('span', 'content');
+    super(createElementWithClass('button', 'history-dropdown-button'));
+    UI.appendStyle(this.element, 'timeline/historyToolbarButton.css');
+    this._contentElement = this.element.createChild('span', 'content');
     const dropdownArrowIcon = UI.Icon.create('smallicon-triangle-down');
-    shadowRoot.appendChild(dropdownArrowIcon);
+    this.element.appendChild(dropdownArrowIcon);
     this.element.addEventListener('click', () => void action.execute(), false);
     this.setEnabled(action.enabled());
     action.addEventListener(UI.Action.Events.Enabled, event => this.setEnabled(/** @type {boolean} */ (event.data)));
diff --git a/src/cobalt/debug/remote/devtools/front_end/timeline/historyToolbarButton.css b/src/cobalt/debug/remote/devtools/front_end/timeline/historyToolbarButton.css
index f66188b..0259abf 100644
--- a/src/cobalt/debug/remote/devtools/front_end/timeline/historyToolbarButton.css
+++ b/src/cobalt/debug/remote/devtools/front_end/timeline/historyToolbarButton.css
@@ -4,18 +4,18 @@
  * found in the LICENSE file.
  */
 
-:host {
+.history-dropdown-button {
   width: 160px;
   height: 26px;
   text-align: left;
   display: flex;
 }
 
-:host([disabled]) {
+.history-dropdown-button[disabled] {
   opacity: .5;
 }
 
-.content {
+.history-dropdown-button > .content {
   padding-right: 5px;
   overflow: hidden;
   text-overflow: ellipsis;
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/HistoryInput.js b/src/cobalt/debug/remote/devtools/front_end/ui/HistoryInput.js
index b5cefa7..81784fc 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/HistoryInput.js
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/HistoryInput.js
@@ -5,24 +5,21 @@
  * @unrestricted
  */
 UI.HistoryInput = class extends HTMLInputElement {
+  constructor() {
+    super();
+    this._history = [''];
+    this._historyPosition = 0;
+    this.addEventListener('keydown', this._onKeyDown.bind(this), false);
+    this.addEventListener('input', this._onInput.bind(this), false);
+  }
   /**
    * @return {!UI.HistoryInput}
    */
   static create() {
     if (!UI.HistoryInput._constructor)
-      UI.HistoryInput._constructor = UI.registerCustomElement('input', 'history-input', UI.HistoryInput.prototype);
+      UI.HistoryInput._constructor = UI.registerCustomElement('input', 'history-input', UI.HistoryInput);
 
-    return /** @type {!UI.HistoryInput} */ (new UI.HistoryInput._constructor());
-  }
-
-  /**
-   * @override
-   */
-  createdCallback() {
-    this._history = [''];
-    this._historyPosition = 0;
-    this.addEventListener('keydown', this._onKeyDown.bind(this), false);
-    this.addEventListener('input', this._onInput.bind(this), false);
+    return /** @type {!UI.HistoryInput} */ (UI.HistoryInput._constructor());
   }
 
   /**
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/Icon.js b/src/cobalt/debug/remote/devtools/front_end/ui/Icon.js
index 9ba57c8..2df6469 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/Icon.js
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/Icon.js
@@ -2,14 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-/**
- * @constructor
- * @extends {HTMLSpanElement}
- */
 UI.Icon = class extends HTMLSpanElement {
   constructor() {
     super();
-    throw new Error('icon must be created via factory method.');
+    /** @type {?UI.Icon.Descriptor} */
+    this._descriptor = null;
+    /** @type {?UI.Icon.SpriteSheet} */
+    this._spriteSheet = null;
+    /** @type {string} */
+    this._iconType = '';
   }
 
   /**
@@ -19,9 +20,9 @@
    */
   static create(iconType, className) {
     if (!UI.Icon._constructor)
-      UI.Icon._constructor = UI.registerCustomElement('span', 'ui-icon', UI.Icon.prototype);
+      UI.Icon._constructor = UI.registerCustomElement('span', 'ui-icon', UI.Icon);
 
-    const icon = /** @type {!UI.Icon} */ (new UI.Icon._constructor());
+    const icon = /** @type {!UI.Icon} */ (UI.Icon._constructor());
     if (className)
       icon.className = className;
     if (iconType)
@@ -30,18 +31,6 @@
   }
 
   /**
-   * @override
-   */
-  createdCallback() {
-    /** @type {?UI.Icon.Descriptor} */
-    this._descriptor = null;
-    /** @type {?UI.Icon.SpriteSheet} */
-    this._spriteSheet = null;
-    /** @type {string} */
-    this._iconType = '';
-  }
-
-  /**
    * @param {string} iconType
    */
   setIconType(iconType) {
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/ListWidget.js b/src/cobalt/debug/remote/devtools/front_end/ui/ListWidget.js
index c11ae3a..0ba4777 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/ListWidget.js
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/ListWidget.js
@@ -9,12 +9,11 @@
    * @param {!UI.ListWidget.Delegate<T>} delegate
    */
   constructor(delegate) {
-    super(true);
+    super(true, true /* delegatesFocus */);
     this.registerRequiredCSS('ui/listWidget.css');
     this._delegate = delegate;
 
     this._list = this.contentElement.createChild('div', 'list');
-    this.element.tabIndex = -1;
 
     this._lastSeparator = false;
     /** @type {?UI.ElementFocusRestorer} */
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/SearchableView.js b/src/cobalt/debug/remote/devtools/front_end/ui/SearchableView.js
index a0fa78f..f03af0f 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/SearchableView.js
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/SearchableView.js
@@ -46,7 +46,7 @@
     this._setting = settingName ? Common.settings.createSetting(settingName, {}) : null;
     this._replaceable = false;
 
-    this.contentElement.createChild('content');
+    this.contentElement.createChild('slot');
     this._footerElementContainer = this.contentElement.createChild('div', 'search-bar hidden');
     this._footerElementContainer.style.order = 100;
     this._footerElement = this._footerElementContainer.createChild('div', 'toolbar-search');
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/SoftDropDown.js b/src/cobalt/debug/remote/devtools/front_end/ui/SoftDropDown.js
index 88e8e97..6d21c34 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/SoftDropDown.js
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/SoftDropDown.js
@@ -16,10 +16,10 @@
     this._model = model;
 
     this.element = createElementWithClass('button', 'soft-dropdown');
-    const shadowRoot = UI.createShadowRootWithCoreStyles(this.element, 'ui/softDropDownButton.css');
-    this._titleElement = shadowRoot.createChild('span', 'title');
+    UI.appendStyle(this.element, 'ui/softDropDownButton.css');
+    this._titleElement = this.element.createChild('span', 'title');
     const dropdownArrowIcon = UI.Icon.create('smallicon-triangle-down');
-    shadowRoot.appendChild(dropdownArrowIcon);
+    this.element.appendChild(dropdownArrowIcon);
 
     this._glassPane = new UI.GlassPane();
     this._glassPane.setMarginBehavior(UI.GlassPane.MarginBehavior.NoMargin);
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/SplitWidget.js b/src/cobalt/debug/remote/devtools/front_end/ui/SplitWidget.js
index f0b55ed..950b230 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/SplitWidget.js
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/SplitWidget.js
@@ -46,10 +46,10 @@
     this.contentElement.classList.add('shadow-split-widget');
     this._mainElement =
         this.contentElement.createChild('div', 'shadow-split-widget-contents shadow-split-widget-main vbox');
-    this._mainElement.createChild('content').select = '.insertion-point-main';
+    this._mainElement.createChild('slot').name = 'insertion-point-main';
     this._sidebarElement =
         this.contentElement.createChild('div', 'shadow-split-widget-contents shadow-split-widget-sidebar vbox');
-    this._sidebarElement.createChild('content').select = '.insertion-point-sidebar';
+    this._sidebarElement.createChild('slot').name = 'insertion-point-sidebar';
     this._resizerElement = this.contentElement.createChild('div', 'shadow-split-widget-resizer');
     this._resizerElementSize = null;
 
@@ -165,8 +165,7 @@
       this._mainWidget.detach();
     this._mainWidget = widget;
     if (widget) {
-      widget.element.classList.add('insertion-point-main');
-      widget.element.classList.remove('insertion-point-sidebar');
+      widget.element.slot = 'insertion-point-main';
       if (this._showMode === UI.SplitWidget.ShowMode.OnlyMain || this._showMode === UI.SplitWidget.ShowMode.Both)
         widget.show(this.element);
     }
@@ -184,8 +183,7 @@
       this._sidebarWidget.detach();
     this._sidebarWidget = widget;
     if (widget) {
-      widget.element.classList.add('insertion-point-sidebar');
-      widget.element.classList.remove('insertion-point-main');
+      widget.element.slot = 'insertion-point-sidebar';
       if (this._showMode === UI.SplitWidget.ShowMode.OnlySidebar || this._showMode === UI.SplitWidget.ShowMode.Both)
         widget.show(this.element);
     }
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/TabbedPane.js b/src/cobalt/debug/remote/devtools/front_end/ui/TabbedPane.js
index 44db82d..dfad749 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/TabbedPane.js
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/TabbedPane.js
@@ -46,7 +46,7 @@
     this._tabsElement.addEventListener('keydown', this._keyDown.bind(this), false);
     this._contentElement = this.contentElement.createChild('div', 'tabbed-pane-content');
     this._contentElement.setAttribute('role', 'tabpanel');
-    this._contentElement.createChild('content');
+    this._contentElement.createChild('slot');
     /** @type {!Array.<!UI.TabbedPaneTab>} */
     this._tabs = [];
     /** @type {!Array.<!UI.TabbedPaneTab>} */
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/Toolbar.js b/src/cobalt/debug/remote/devtools/front_end/ui/Toolbar.js
index 790a753..4f8d0bf 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/Toolbar.js
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/Toolbar.js
@@ -45,7 +45,7 @@
     this._enabled = true;
     this._shadowRoot = UI.createShadowRootWithCoreStyles(this.element, 'ui/toolbar.css');
     this._contentElement = this._shadowRoot.createChild('div', 'toolbar-shadow');
-    this._insertionPoint = this._contentElement.createChild('content');
+    this._insertionPoint = this._contentElement.createChild('slot');
   }
 
   /**
@@ -265,7 +265,7 @@
       delete item._toolbar;
     this._items = [];
     this._contentElement.removeChildren();
-    this._insertionPoint = this._contentElement.createChild('content');
+    this._insertionPoint = this._contentElement.createChild('slot');
   }
 
   /**
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/Tooltip.js b/src/cobalt/debug/remote/devtools/front_end/ui/Tooltip.js
index a8034a0..253f22f 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/Tooltip.js
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/Tooltip.js
@@ -54,7 +54,7 @@
    */
   _mouseMove(event) {
     const mouseEvent = /** @type {!MouseEvent} */ (event);
-    const path = mouseEvent.path;
+    const path = mouseEvent.composedPath();
     if (!path || mouseEvent.buttons !== 0 || (mouseEvent.movementX === 0 && mouseEvent.movementY === 0))
       return;
 
@@ -63,7 +63,8 @@
 
     for (const element of path) {
       // The offsetParent is null when the element or an ancestor has 'display: none'.
-      if (element === this._anchorElement || (element.nodeName !== 'CONTENT' && element.offsetParent === null)) {
+      if (!(element instanceof Element) || element === this._anchorElement ||
+          (element.nodeName !== 'SLOT' && element.offsetParent === null)) {
         return;
       } else if (element[UI.Tooltip._symbol]) {
         this._show(element, mouseEvent);
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/UIUtils.js b/src/cobalt/debug/remote/devtools/front_end/ui/UIUtils.js
index 9c2761c..21e6412 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/UIUtils.js
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/UIUtils.js
@@ -674,9 +674,7 @@
  * @param {!Element} element
  */
 UI.installComponentRootStyles = function(element) {
-  UI.appendStyle(element, 'ui/inspectorCommon.css');
-  UI.themeSupport.injectHighlightStyleSheets(element);
-  UI.themeSupport.injectCustomStyleSheets(element);
+  UI._injectCoreStyles(element);
   element.classList.add('platform-' + Host.platform());
 
   // Detect overlay scrollbar enable by checking for nonzero scrollbar width.
@@ -704,13 +702,12 @@
 /**
  * @param {!Element} element
  * @param {string=} cssFile
+ * @param {boolean=} delegatesFocus
  * @return {!DocumentFragment}
  */
-UI.createShadowRootWithCoreStyles = function(element, cssFile) {
-  const shadowRoot = element.createShadowRoot();
-  UI.appendStyle(shadowRoot, 'ui/inspectorCommon.css');
-  UI.themeSupport.injectHighlightStyleSheets(shadowRoot);
-  UI.themeSupport.injectCustomStyleSheets(shadowRoot);
+UI.createShadowRootWithCoreStyles = function(element, cssFile, delegatesFocus) {
+  const shadowRoot = element.attachShadow({mode: 'open', delegatesFocus});
+  UI._injectCoreStyles(shadowRoot);
   if (cssFile)
     UI.appendStyle(shadowRoot, cssFile);
   shadowRoot.addEventListener('focus', UI._focusChanged.bind(UI), true);
@@ -718,6 +715,16 @@
 };
 
 /**
+ * @param {!Element|!ShadowRoot} root
+ */
+UI._injectCoreStyles = function(root) {
+  UI.appendStyle(root, 'ui/inspectorCommon.css');
+  UI.appendStyle(root, 'ui/textButton.css');
+  UI.themeSupport.injectHighlightStyleSheets(root);
+  UI.themeSupport.injectCustomStyleSheets(root);
+};
+
+/**
  * @param {!Document} document
  * @param {!Event} event
  */
@@ -1166,13 +1173,19 @@
 /**
  * @param {string} localName
  * @param {string} typeExtension
- * @param {!Object} prototype
+ * @param {function(new:HTMLElement, *)} definition
  * @return {function()}
  * @suppressGlobalPropertiesCheck
- * @template T
  */
-UI.registerCustomElement = function(localName, typeExtension, prototype) {
-  return document.registerElement(typeExtension, {prototype: Object.create(prototype), extends: localName});
+UI.registerCustomElement = function(localName, typeExtension, definition) {
+  self.customElements.define(typeExtension, class extends definition {
+    constructor() {
+      super();
+      // TODO(einbinder) convert to classes and custom element tags
+      this.setAttribute('is', typeExtension);
+    }
+  }, {extends: localName});
+  return () => createElement(localName, typeExtension);
 };
 
 /**
@@ -1183,12 +1196,14 @@
  * @return {!Element}
  */
 UI.createTextButton = function(text, clickHandler, className, primary) {
-  const element = createElementWithClass('button', className || '', 'text-button');
+  const element = createElementWithClass('button', className || '');
   element.textContent = text;
+  element.classList.add('text-button');
   if (primary)
     element.classList.add('primary-button');
   if (clickHandler)
     element.addEventListener('click', clickHandler, false);
+  element.type = 'button';
   return element;
 };
 
@@ -1213,10 +1228,10 @@
  * @return {!Element}
  */
 UI.createRadioLabel = function(name, title, checked) {
-  const element = createElement('label', 'dt-radio');
+  const element = createElement('span', 'dt-radio');
   element.radioElement.name = name;
   element.radioElement.checked = !!checked;
-  element.createTextChild(title);
+  element.labelElement.createTextChild(title);
   return element;
 };
 
@@ -1226,7 +1241,7 @@
  * @return {!Element}
  */
 UI.createLabel = function(title, iconClass) {
-  const element = createElement('label', 'dt-icon-label');
+  const element = createElement('span', 'dt-icon-label');
   element.createChild('span').textContent = title;
   element.type = iconClass;
   return element;
@@ -1238,8 +1253,8 @@
  * @param {number} max
  * @param {number} tabIndex
  */
-UI.createSliderLabel = function(min, max, tabIndex) {
-  const element = createElement('label', 'dt-slider');
+UI.createSlider = function(min, max, tabIndex) {
+  const element = createElement('span', 'dt-slider');
   element.sliderElement.min = min;
   element.sliderElement.max = max;
   element.sliderElement.step = 1;
@@ -1270,10 +1285,7 @@
   }
 };
 
-/**
- * @extends {HTMLLabelElement}
- */
-UI.CheckboxLabel = class extends HTMLLabelElement {
+UI.CheckboxLabel = class extends HTMLSpanElement {
   constructor() {
     super();
     /** @type {!DocumentFragment} */
@@ -1282,13 +1294,6 @@
     this.checkboxElement;
     /** @type {!Element} */
     this.textElement;
-    throw new Error('Checkbox must be created via factory method.');
-  }
-
-  /**
-   * @override
-   */
-  createdCallback() {
     UI.CheckboxLabel._lastId = (UI.CheckboxLabel._lastId || 0) + 1;
     const id = 'ui-checkbox-label' + UI.CheckboxLabel._lastId;
     this._shadowRoot = UI.createShadowRootWithCoreStyles(this, 'ui/checkboxTextLabel.css');
@@ -1297,7 +1302,7 @@
     this.checkboxElement.setAttribute('id', id);
     this.textElement = this._shadowRoot.createChild('label', 'dt-checkbox-text');
     this.textElement.setAttribute('for', id);
-    this._shadowRoot.createChild('content');
+    this._shadowRoot.createChild('slot');
   }
 
   /**
@@ -1308,8 +1313,8 @@
    */
   static create(title, checked, subtitle) {
     if (!UI.CheckboxLabel._constructor)
-      UI.CheckboxLabel._constructor = UI.registerCustomElement('label', 'dt-checkbox', UI.CheckboxLabel.prototype);
-    const element = /** @type {!UI.CheckboxLabel} */ (new UI.CheckboxLabel._constructor());
+      UI.CheckboxLabel._constructor = UI.registerCustomElement('span', 'dt-checkbox', UI.CheckboxLabel);
+    const element = /** @type {!UI.CheckboxLabel} */ (UI.CheckboxLabel._constructor());
     element.checkboxElement.checked = !!checked;
     if (title !== undefined) {
       element.textElement.textContent = title;
@@ -1350,152 +1355,124 @@
 };
 
 (function() {
-  UI.registerCustomElement('button', 'text-button', {
-    /**
-     * @this {Element}
-     */
-    createdCallback: function() {
-      this.type = 'button';
-      const root = UI.createShadowRootWithCoreStyles(this, 'ui/textButton.css');
-      root.createChild('content');
-    },
+let labelId = 0;
+UI.registerCustomElement('span', 'dt-radio', class extends HTMLSpanElement {
+  constructor() {
+    super();
+    this.radioElement = this.createChild('input', 'dt-radio-button');
+    this.labelElement = this.createChild('label');
 
-    __proto__: HTMLButtonElement.prototype
-  });
+    const id = 'dt-radio-button-id' + (++labelId);
+    this.radioElement.id = id;
+    this.radioElement.type = 'radio';
+    this.labelElement.htmlFor = id;
+    const root = UI.createShadowRootWithCoreStyles(this, 'ui/radioButton.css');
+    root.createChild('slot');
+    this.addEventListener('click', radioClickHandler, false);
+  }
+});
 
-  UI.registerCustomElement('label', 'dt-radio', {
-    /**
-     * @this {Element}
-     */
-    createdCallback: function() {
-      this.radioElement = this.createChild('input', 'dt-radio-button');
-      this.radioElement.type = 'radio';
-      const root = UI.createShadowRootWithCoreStyles(this, 'ui/radioButton.css');
-      root.createChild('content').select = '.dt-radio-button';
-      root.createChild('content');
-      this.addEventListener('click', radioClickHandler, false);
-    },
-
-    __proto__: HTMLLabelElement.prototype
-  });
-
-  /**
+/**
    * @param {!Event} event
    * @suppressReceiverCheck
    * @this {Element}
    */
-  function radioClickHandler(event) {
-    if (this.radioElement.checked || this.radioElement.disabled)
-      return;
-    this.radioElement.checked = true;
-    this.radioElement.dispatchEvent(new Event('change'));
+function radioClickHandler(event) {
+  if (this.radioElement.checked || this.radioElement.disabled)
+    return;
+  this.radioElement.checked = true;
+  this.radioElement.dispatchEvent(new Event('change'));
+}
+
+UI.registerCustomElement('span', 'dt-icon-label', class extends HTMLSpanElement {
+  constructor() {
+    super();
+    const root = UI.createShadowRootWithCoreStyles(this);
+    this._iconElement = UI.Icon.create();
+    this._iconElement.style.setProperty('margin-right', '4px');
+    root.appendChild(this._iconElement);
+    root.createChild('slot');
   }
 
-  UI.registerCustomElement('label', 'dt-icon-label', {
-    /**
-     * @this {Element}
-     */
-    createdCallback: function() {
-      const root = UI.createShadowRootWithCoreStyles(this);
-      this._iconElement = UI.Icon.create();
-      this._iconElement.style.setProperty('margin-right', '4px');
-      root.appendChild(this._iconElement);
-      root.createChild('content');
-    },
-
-    /**
+  /**
      * @param {string} type
      * @this {Element}
      */
-    set type(type) {
-      this._iconElement.setIconType(type);
-    },
+  set type(type) {
+    this._iconElement.setIconType(type);
+  }
+});
 
-    __proto__: HTMLLabelElement.prototype
-  });
+UI.registerCustomElement('span', 'dt-slider', class extends HTMLSpanElement {
+  constructor() {
+    super();
+    const root = UI.createShadowRootWithCoreStyles(this, 'ui/slider.css');
+    this.sliderElement = createElementWithClass('input', 'dt-range-input');
+    this.sliderElement.type = 'range';
+    root.appendChild(this.sliderElement);
+  }
 
-  UI.registerCustomElement('label', 'dt-slider', {
-    /**
-     * @this {Element}
-     */
-    createdCallback: function() {
-      const root = UI.createShadowRootWithCoreStyles(this, 'ui/slider.css');
-      this.sliderElement = createElementWithClass('input', 'dt-range-input');
-      this.sliderElement.type = 'range';
-      root.appendChild(this.sliderElement);
-    },
-
-    /**
+  /**
      * @param {number} amount
      * @this {Element}
      */
-    set value(amount) {
-      this.sliderElement.value = amount;
-    },
+  set value(amount) {
+    this.sliderElement.value = amount;
+  }
 
-    /**
+  /**
      * @this {Element}
      */
-    get value() {
-      return this.sliderElement.value;
-    },
+  get value() {
+    return this.sliderElement.value;
+  }
+});
 
-    __proto__: HTMLLabelElement.prototype
-  });
+UI.registerCustomElement('span', 'dt-small-bubble', class extends HTMLSpanElement {
+  constructor() {
+    super();
+    const root = UI.createShadowRootWithCoreStyles(this, 'ui/smallBubble.css');
+    this._textElement = root.createChild('div');
+    this._textElement.className = 'info';
+    this._textElement.createChild('slot');
+  }
 
-  UI.registerCustomElement('label', 'dt-small-bubble', {
-    /**
-     * @this {Element}
-     */
-    createdCallback: function() {
-      const root = UI.createShadowRootWithCoreStyles(this, 'ui/smallBubble.css');
-      this._textElement = root.createChild('div');
-      this._textElement.className = 'info';
-      this._textElement.createChild('content');
-    },
-
-    /**
+  /**
      * @param {string} type
      * @this {Element}
      */
-    set type(type) {
-      this._textElement.className = type;
-    },
+  set type(type) {
+    this._textElement.className = type;
+  }
+});
 
-    __proto__: HTMLLabelElement.prototype
-  });
+UI.registerCustomElement('div', 'dt-close-button', class extends HTMLDivElement {
+  constructor() {
+    super();
+    const root = UI.createShadowRootWithCoreStyles(this, 'ui/closeButton.css');
+    this._buttonElement = root.createChild('div', 'close-button');
+    const regularIcon = UI.Icon.create('smallicon-cross', 'default-icon');
+    this._hoverIcon = UI.Icon.create('mediumicon-red-cross-hover', 'hover-icon');
+    this._activeIcon = UI.Icon.create('mediumicon-red-cross-active', 'active-icon');
+    this._buttonElement.appendChild(regularIcon);
+    this._buttonElement.appendChild(this._hoverIcon);
+    this._buttonElement.appendChild(this._activeIcon);
+  }
 
-  UI.registerCustomElement('div', 'dt-close-button', {
-    /**
-     * @this {Element}
-     */
-    createdCallback: function() {
-      const root = UI.createShadowRootWithCoreStyles(this, 'ui/closeButton.css');
-      this._buttonElement = root.createChild('div', 'close-button');
-      const regularIcon = UI.Icon.create('smallicon-cross', 'default-icon');
-      this._hoverIcon = UI.Icon.create('mediumicon-red-cross-hover', 'hover-icon');
-      this._activeIcon = UI.Icon.create('mediumicon-red-cross-active', 'active-icon');
-      this._buttonElement.appendChild(regularIcon);
-      this._buttonElement.appendChild(this._hoverIcon);
-      this._buttonElement.appendChild(this._activeIcon);
-    },
-
-    /**
+  /**
      * @param {boolean} gray
      * @this {Element}
      */
-    set gray(gray) {
-      if (gray) {
-        this._hoverIcon.setIconType('mediumicon-gray-cross-hover');
-        this._activeIcon.setIconType('mediumicon-gray-cross-active');
-      } else {
-        this._hoverIcon.setIconType('mediumicon-red-cross-hover');
-        this._activeIcon.setIconType('mediumicon-red-cross-active');
-      }
-    },
-
-    __proto__: HTMLDivElement.prototype
-  });
+  set gray(gray) {
+    if (gray) {
+      this._hoverIcon.setIconType('mediumicon-gray-cross-hover');
+      this._activeIcon.setIconType('mediumicon-gray-cross-active');
+    } else {
+      this._hoverIcon.setIconType('mediumicon-red-cross-hover');
+      this._activeIcon.setIconType('mediumicon-red-cross-active');
+    }
+  }
+});
 })();
 
 /**
@@ -1681,7 +1658,7 @@
   }
 
   /**
-   * @param {!Element} element
+   * @param {!Element|!ShadowRoot} element
    */
   injectHighlightStyleSheets(element) {
     this._injectingStyleSheet = true;
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/View.js b/src/cobalt/debug/remote/devtools/front_end/ui/View.js
index bc3d3be..96a784c 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/View.js
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/View.js
@@ -506,7 +506,7 @@
     this._titleElement.addEventListener('keydown', this._onTitleKeyDown.bind(this), false);
     this.contentElement.insertBefore(this._titleElement, this.contentElement.firstChild);
 
-    this.contentElement.createChild('content');
+    this.contentElement.createChild('slot');
     this._view = view;
     view[UI.ViewManager._ExpandableContainerWidget._symbol] = this;
   }
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/Widget.js b/src/cobalt/debug/remote/devtools/front_end/ui/Widget.js
index 861f157..611890d 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/Widget.js
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/Widget.js
@@ -30,13 +30,14 @@
 UI.Widget = class extends Common.Object {
   /**
    * @param {boolean=} isWebComponent
+   * @param {boolean=} delegatesFocus
    */
-  constructor(isWebComponent) {
+  constructor(isWebComponent, delegatesFocus) {
     super();
     this.contentElement = createElementWithClass('div', 'widget');
     if (isWebComponent) {
       this.element = createElementWithClass('div', 'vbox flex-auto');
-      this._shadowRoot = UI.createShadowRootWithCoreStyles(this.element);
+      this._shadowRoot = UI.createShadowRootWithCoreStyles(this.element, undefined, delegatesFocus);
       this._shadowRoot.appendChild(this.contentElement);
     } else {
       this.element = this.contentElement;
@@ -599,9 +600,10 @@
 UI.VBox = class extends UI.Widget {
   /**
    * @param {boolean=} isWebComponent
+   * @param {boolean=} delegatesFocus
    */
-  constructor(isWebComponent) {
-    super(isWebComponent);
+  constructor(isWebComponent, delegatesFocus) {
+    super(isWebComponent, delegatesFocus);
     this.contentElement.classList.add('vbox');
   }
 
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/filter.css b/src/cobalt/debug/remote/devtools/front_end/ui/filter.css
index 025789e..b09df81 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/filter.css
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/filter.css
@@ -46,10 +46,6 @@
     align-items: center;
 }
 
-.filter-text-filter label {
-    margin: auto 0;
-}
-
 .filter-bitset-filter {
     padding: 2px;
     display: inline-flex;
@@ -116,7 +112,7 @@
     position: relative;
 }
 
-.filter-checkbox-filter > label {
+.filter-checkbox-filter > [is=dt-checkbox] {
     display: flex;
     margin: auto 0;
 }
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/inspectorCommon.css b/src/cobalt/debug/remote/devtools/front_end/ui/inspectorCommon.css
index 2e7fa6e..a65be85 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/inspectorCommon.css
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/inspectorCommon.css
@@ -306,7 +306,7 @@
     white-space: nowrap;
 }
 
-label[is=dt-icon-label] {
+span[is=dt-icon-label] {
     flex: none;
 }
 
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/radioButton.css b/src/cobalt/debug/remote/devtools/front_end/ui/radioButton.css
index 47f4775..cadf3a7 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/radioButton.css
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/radioButton.css
@@ -4,7 +4,7 @@
  * found in the LICENSE file.
  */
 
-::content .dt-radio-button {
+::slotted(input.dt-radio-button) {
     height: 17px;
     width: 17px;
     min-width: 17px;
@@ -16,16 +16,16 @@
     margin: 0 5px 5px 0;
 }
 
-::content .dt-radio-button:active:not(:disabled) {
+::slotted(input.dt-radio-button:active:not(:disabled)) {
     background-image: linear-gradient(to bottom, rgb(194, 194, 194), rgb(239, 239, 239));
 }
 
-::content .dt-radio-button:checked {
+::slotted(input.dt-radio-button:checked) {
     background: url(Images/radioDot.png) center no-repeat,
                 linear-gradient(to bottom, rgb(252, 252, 252), rgb(223, 223, 223));
 }
 
-::content .dt-radio-button:checked:active {
+::slotted(input.dt-radio-button:checked:active) {
     background: url(Images/radioDot.png) center no-repeat,
                 linear-gradient(to bottom, rgb(194, 194, 194), rgb(239, 239, 239));
 }
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/softDropDownButton.css b/src/cobalt/debug/remote/devtools/front_end/ui/softDropDownButton.css
index 3812ef1..2270d27 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/softDropDownButton.css
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/softDropDownButton.css
@@ -3,7 +3,7 @@
  * Use of this source code is governed by a BSD-style license that can be
  * found in the LICENSE file.
  */
-:host {
+button.soft-dropdown {
     height: 26px;
     text-align: left;
     position: relative;
@@ -11,18 +11,18 @@
     background: none;
 }
 
-:host([disabled]) {
+button.soft-dropdown[disabled] {
     opacity: .5;
 }
 
-:host .title {
+button.soft-dropdown > .title {
     padding-right: 5px;
     width: 120px;
     overflow: hidden;
     text-overflow: ellipsis;
 }
 
-:host([data-keyboard-focus="true"]:focus)::before {
+button.soft-dropdown[data-keyboard-focus="true"]:focus::before {
     content: "";
     position: absolute;
     top: 2px;
diff --git a/src/cobalt/debug/remote/devtools/front_end/ui/textButton.css b/src/cobalt/debug/remote/devtools/front_end/ui/textButton.css
index 001189a..cce75fa 100644
--- a/src/cobalt/debug/remote/devtools/front_end/ui/textButton.css
+++ b/src/cobalt/debug/remote/devtools/front_end/ui/textButton.css
@@ -4,7 +4,7 @@
  * found in the LICENSE file.
  */
 
-:host {
+ .text-button {
     margin: 2px;
     height: 24px;
     font-size: 12px;
@@ -18,52 +18,49 @@
     white-space: nowrap;
 }
 
-:host(:not(:disabled):focus),
-:host(:not(:disabled):hover),
-:host(:not(:disabled):active) {
+.text-button:not(:disabled):focus,
+.text-button:not(:disabled):hover,
+.text-button:not(:disabled):active {
     background-color: var(--toolbar-bg-color);
     box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
     cursor: pointer;
 }
 
-:host(:not(:disabled):active) {
+.text-button:not(:disabled):active {
     background-color: #f2f2f2;
 }
 
-:host(:not(:disabled):focus) {
+.text-button:not(:disabled):focus {
     box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(66, 133, 244, 0.4);
 }
 
-:host(:disabled) {
+.text-button:disabled {
     opacity: 0.38;
 }
 
-:host(.primary-button), -theme-preserve {
+.text-button.primary-button, -theme-preserve {
     background-color: #4285F4;
     border: none;
     color: #fff;
 }
 
-:host(.primary-button:not(:disabled):focus),
-:host(.primary-button:not(:disabled):hover), -theme-preserve {
-    background-color: #3B78E7;
+.text-button.primary-button:not(:disabled):focus,
+.text-button.primary-button:not(:disabled):hover,
+.text-button.primary-button:not(:disabled):active, -theme-preserve {
+    background-color: var(--accent-color-hover);
 }
 
-:host(.primary-button:not(:disabled):active), -theme-preserve {
-    background-color: #3367D6;
-}
-
-:host-context(.-theme-with-dark-background):host(:not(.primary-button):not(:disabled):focus),
-:host-context(.-theme-with-dark-background):host(:not(.primary-button):not(:disabled):hover),
-:host-context(.-theme-with-dark-background):host(:not(.primary-button):not(:disabled):active) {
+.-theme-with-dark-background .text-button:not(.primary-button):not(:disabled):focus,
+.-theme-with-dark-background .text-button:not(.primary-button):not(:disabled):hover,
+.-theme-with-dark-background .text-button:not(.primary-button):not(:disabled):active {
     background-color: #313131;
     box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
 }
 
-:host-context(.-theme-with-dark-background):host(:not(.primary-button):not(:disabled):focus) {
+.-theme-with-dark-background .text-button:not(.primary-button):not(:disabled):focus {
     box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(94, 151, 246, 0.6);
 }
 
-:host-context(.-theme-with-dark-background):host(:not(.primary-button):not(:disabled):active) {
+.-theme-with-dark-background .text-button:not(.primary-button):not(:disabled):active {
     background-color: #3e3e3e;
 }
diff --git a/src/cobalt/tools/automated_testing/cobalt_runner.py b/src/cobalt/tools/automated_testing/cobalt_runner.py
index ddc9f8b..d25d559 100644
--- a/src/cobalt/tools/automated_testing/cobalt_runner.py
+++ b/src/cobalt/tools/automated_testing/cobalt_runner.py
@@ -213,7 +213,8 @@
         output_file=self.launcher_write_pipe,
         out_directory=self.launcher_params.out_directory,
         loader_platform=self.launcher_params.loader_platform,
-        loader_config=self.launcher_params.loader_config)
+        loader_config=self.launcher_params.loader_config,
+        loader_out_directory=self.launcher_params.loader_out_directory)
 
     self.runner_thread = threading.Thread(target=self._RunLauncher)
     self.runner_thread.start()
diff --git a/src/crypto/METADATA b/src/crypto/METADATA
new file mode 100644
index 0000000..dfa6302
--- /dev/null
+++ b/src/crypto/METADATA
@@ -0,0 +1,20 @@
+name: "crypto"
+description:
+  "Subtree at crypto."
+
+third_party {
+  url {
+    type: LOCAL_SOURCE
+    value: "/third_party/chromium/crypto_mirror"
+  }
+  url {
+    type: GIT
+    value: "https://chromium.googlesource.com/chromium/src/crypto"
+  }
+  version: "e67e70a248f1424c885ed1fac2230786973e42a8"
+  last_upgrade_date {
+    year: 2018
+    month: 8
+    day: 28
+  }
+}
diff --git a/src/net/METADATA b/src/net/METADATA
new file mode 100644
index 0000000..0ed2294
--- /dev/null
+++ b/src/net/METADATA
@@ -0,0 +1,22 @@
+# Format: google3/devtools/metadata/metadata.proto (go/google3metadata)
+
+name: "net"
+description:
+  "Subtree at net."
+
+third_party {
+  url {
+    type: LOCAL_SOURCE
+    value: "/third_party/chromium/net_mirror"
+  }
+  url {
+    type: GIT
+    value: "https://chromium.googlesource.com/chromium/src/net"
+  }
+  version: "c89878e71fe83c7a28a240642b4288396010bcdc"
+  last_upgrade_date {
+    year: 2018
+    month: 10
+    day: 9
+  }
+}
diff --git a/src/net/third_party/quiche/src/METADATA b/src/net/third_party/quiche/src/METADATA
new file mode 100644
index 0000000..8da6120
--- /dev/null
+++ b/src/net/third_party/quiche/src/METADATA
@@ -0,0 +1,20 @@
+name: "quiche"
+description:
+  "Subtree at net/third_party/quiche/src."
+
+third_party {
+  url {
+    type: LOCAL_SOURCE
+    value: "/third_party/quiche_mirror"
+  }
+  url {
+    type: GIT
+    value: "https://quiche.googlesource.com/quiche"
+  }
+  version: "b6880f79b56f38c05be91191f9630e9aa66ecc2d"
+  last_upgrade_date {
+    year: 2019
+    month: 3
+    day: 6
+  }
+}
diff --git a/src/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltA11yHelper.java b/src/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltA11yHelper.java
index e9a00eb..b0fcb50 100644
--- a/src/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltA11yHelper.java
+++ b/src/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltA11yHelper.java
@@ -45,11 +45,19 @@
   private static final int FAKE_VIEW_HEIGHT = 10;
   private static final int FAKE_VIEW_WIDTH = 10;
 
-  private int previousFocusedViewId = 1;
+  private static final int CENTER_VIEW_ID = 5;
+  private static final int UP_VIEW_ID = 2;
+  private static final int DOWN_VIEW_ID = 8;
+  private static final int LEFT_VIEW_ID = 4;
+  private static final int RIGHT_VIEW_ID = 6;
+
+  private static final int INPUT_FOCUS_CHANGE_DELAY = 1500; // milliseconds
+
   // This set tracks whether onPopulateNodeForVirtualView has been
   // called for each virtual view id.
   private final BitSet nodePopulatedSet = new BitSet(9);
   private final Handler handler = new Handler();
+  private boolean unhandledInput;
   private boolean hasInitialFocusBeenSet;
 
   public CobaltA11yHelper(View view) {
@@ -77,70 +85,53 @@
     }
   }
 
-  /**
-   * Returns the "patch number" for a given view id, given a focused view id.
-   *
-   * <p>A "patch number" is a 1-9 number that describes where the requestedViewId is now located on
-   * an X-Y grid, given the focusedViewId.
-   *
-   * <p>Patch number grid:
-   * (0,0)----->X
-   *   |+-+-+-+
-   *   ||1|2|3|
-   *   |+-+-+-|
-   *   ||4|5|6|
-   *   |+-+-+-|
-   *   ||7|8|9|
-   *   |+-+-+-+
-   *  \./ Y
-   *
-   * <p>As focus changes, the locations of the views are moved so the focused view is always in the
-   * middle (patch number 5) and all of the other views always in the same relative position with
-   * respect to each other (with those on the edges adjacent to those on the opposite edges --
-   * wrapping around).
-   *
-   * <p>5 is returned whenever focusedViewId = requestedViewId
-   */
-  private static int getPatchNumber(int focusedViewId, int requestedViewId) {
-    // The (x,y) the focused view has in the 9 patch where 5 is in the middle.
-    int focusedX = (focusedViewId - 1) % 3;
-    int focusedY = (focusedViewId - 1) / 3;
+  private void focusOnCenter() {
+    // Setting Accessibility focus to CENTER_VIEW_ID will make TalkBack focus
+    // on CENTER_VIEW_ID immediately, but the actual mouse focus is either
+    // unchanged or return INVALID_ID.
+    handler.post(
+        new Runnable() {
+          @Override
+          public void run() {
+            sendEventForVirtualView(
+                CENTER_VIEW_ID, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED);
+          }
+        });
 
-    // x and y offsets of focused view where middle is (0, 0)
-    int focusedRelativeToCenterX = focusedX - 1;
-    int focusedRelativeToCenterY = focusedY - 1;
-
-    // The (x,y) the requested view has in the 9 patch where 5 is in the middle.
-    int requestedX = (requestedViewId - 1) % 3;
-    int requestedY = (requestedViewId - 1) / 3;
-
-    // x and y offsets of requested view where middle is (0, 0)
-    int requestedRelativeToCenterX = requestedX - 1;
-    int requestedRelativeToCenterY = requestedY - 1;
-
-    // The (x,y) that the requested view has in the 9 patch when focusedViewId
-    // is in the middle.
-    int translatedRequestedX = (1 + 3 + requestedRelativeToCenterX - focusedRelativeToCenterX) % 3;
-    int translatedRequestedY = (1 + 3 + requestedRelativeToCenterY - focusedRelativeToCenterY) % 3;
-
-    return (translatedRequestedY * 3) + translatedRequestedX + 1;
+    // There is a knwon Android bug about setting focus too early
+    // taking no effect. The impact for Cobalt is that sometimes after
+    // we click on a video, TalkBack sees nothing in focus in the watch
+    // page if no user input happens. To avoid this bug we have to
+    // delay the focus long enough for all the TalkBack movements to settle
+    // down. More details here: https://stackoverflow.com/questions/28472985.
+    handler.postDelayed(
+        new Runnable() {
+          @Override
+          public void run() {
+            sendEventForVirtualView(
+                CENTER_VIEW_ID, AccessibilityEvent.TYPE_VIEW_FOCUSED);
+          }
+        }, INPUT_FOCUS_CHANGE_DELAY);
   }
 
   private void maybeInjectEvent(int currentFocusedViewId) {
-    switch (getPatchNumber(previousFocusedViewId, currentFocusedViewId)) {
-      case 5:
+    if (!unhandledInput) { 
+      return;
+    }
+    switch (currentFocusedViewId) {
+      case CENTER_VIEW_ID:
         // no move;
         break;
-      case 2:
+      case UP_VIEW_ID:
         nativeInjectKeyEvent(SB_KEY_GAMEPAD_DPAD_UP);
         break;
-      case 4:
+      case LEFT_VIEW_ID:
         nativeInjectKeyEvent(SB_KEY_GAMEPAD_DPAD_LEFT);
         break;
-      case 6:
+      case RIGHT_VIEW_ID:
         nativeInjectKeyEvent(SB_KEY_GAMEPAD_DPAD_RIGHT);
         break;
-      case 8:
+      case DOWN_VIEW_ID:
         nativeInjectKeyEvent(SB_KEY_GAMEPAD_DPAD_DOWN);
         break;
       default:
@@ -148,9 +139,26 @@
         // not possible to reach this.
         break;
     }
-    previousFocusedViewId = currentFocusedViewId;
+    unhandledInput = false;
+    focusOnCenter();
   }
 
+  /**
+   * <p>Fake number grid:
+   *   |+-+-+-+
+   *   ||1|2|3|
+   *   |+-+-+-|
+   *   ||4|5|6|
+   *   |+-+-+-|
+   *   ||7|8|9|
+   *   |+-+-+-+
+   *
+   * <p>The focus always starts from the middle number 5. When user changes
+   * focus, the focus is then moved to either 2, 4, 6 or 8 and we can capture
+   * the movement this way. The focus is then quickly switched back to the
+   * center 5 to be ready for the next movement.
+   *
+   */
   @Override
   protected void onPopulateNodeForVirtualView(int virtualViewId, AccessibilityNodeInfoCompat node) {
     int focusedViewId = getAccessibilityFocusedVirtualViewId();
@@ -158,18 +166,20 @@
     if (focusedViewId < 1 || focusedViewId > 9) {
       // If this is not one of our nine-patch views, it's probably HOST_ID
       // In any case, assume there is no focus change.
-      focusedViewId = previousFocusedViewId;
+      focusedViewId = CENTER_VIEW_ID;
     }
 
     // onPopulateNodeForVirtualView() gets called at least once every
     // time the focused view changes. So see if it's changed since the
     // last time we've been called and inject an event if so.
-    maybeInjectEvent(focusedViewId);
+    if (focusedViewId != CENTER_VIEW_ID) {
+      maybeInjectEvent(focusedViewId);
+    } else {
+      unhandledInput = true;
+    }
 
-    int patchNumber = getPatchNumber(focusedViewId, virtualViewId);
-
-    int x = (patchNumber - 1) % 3;
-    int y = (patchNumber - 1) / 3;
+    int x = (virtualViewId - 1) % 3;
+    int y = (virtualViewId - 1) / 3;
 
     // Note that the specific bounds here are arbitrary. The importance
     // is the relative bounds to each other.
@@ -188,14 +198,7 @@
       // but not before, ask that the accessibility focus be moved from
       // it's initial position on HOST_ID to the one we want to start with.
       hasInitialFocusBeenSet = true;
-      handler.post(
-          new Runnable() {
-            @Override
-            public void run() {
-              sendEventForVirtualView(
-                  previousFocusedViewId, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED);
-            }
-          });
+      focusOnCenter();
     }
   }
 
@@ -203,59 +206,4 @@
   protected boolean onPerformActionForVirtualView(int virtualViewId, int action, Bundle arguments) {
     return false;
   }
-
-  /** A simple equivilent to Assert.assertEquals so we don't depend on junit */
-  private static void assertEquals(int expected, int actual) {
-    if (expected != actual) {
-      throw new RuntimeException("Expected " + expected + " actual " + actual);
-    }
-  }
-
-  /**
-   * Unit test for getPatchNumber().
-   *
-   * <p>As of this writing, the Java portion of the Cobalt build has no unit test mechanism.
-   *
-   * <p>To run this test, simply call it from application start and start the application.
-   *
-   * <p>TODO: Move this to a real unit test location when one exists.
-   */
-  private static void testGetPatchNumber() {
-    Log.i(TAG, "+testGetPatchNumber");
-
-    assertEquals(1, getPatchNumber(5, 1));
-    assertEquals(2, getPatchNumber(5, 2));
-    assertEquals(3, getPatchNumber(5, 3));
-    assertEquals(4, getPatchNumber(5, 4));
-    assertEquals(5, getPatchNumber(5, 5));
-    assertEquals(6, getPatchNumber(5, 6));
-    assertEquals(7, getPatchNumber(5, 7));
-    assertEquals(8, getPatchNumber(5, 8));
-    assertEquals(9, getPatchNumber(5, 9));
-
-    for (int i = 1; i <= 9; i++) {
-      assertEquals(5, getPatchNumber(i, i));
-    }
-
-    assertEquals(5, getPatchNumber(1, 1));
-    assertEquals(6, getPatchNumber(1, 2));
-    assertEquals(4, getPatchNumber(1, 3));
-    assertEquals(8, getPatchNumber(1, 4));
-    assertEquals(9, getPatchNumber(1, 5));
-    assertEquals(7, getPatchNumber(1, 6));
-    assertEquals(2, getPatchNumber(1, 7));
-    assertEquals(3, getPatchNumber(1, 8));
-    assertEquals(1, getPatchNumber(1, 9));
-
-    assertEquals(9, getPatchNumber(9, 1));
-    assertEquals(7, getPatchNumber(9, 2));
-    assertEquals(8, getPatchNumber(9, 3));
-    assertEquals(3, getPatchNumber(9, 4));
-    assertEquals(1, getPatchNumber(9, 5));
-    assertEquals(2, getPatchNumber(9, 6));
-    assertEquals(6, getPatchNumber(9, 7));
-    assertEquals(4, getPatchNumber(9, 8));
-    assertEquals(5, getPatchNumber(9, 9));
-    Log.i(TAG, "-testGetPatchNumber");
-  }
 }
diff --git a/src/starboard/android/shared/audio_track_audio_sink_type.cc b/src/starboard/android/shared/audio_track_audio_sink_type.cc
index 25dbb62..8336504 100644
--- a/src/starboard/android/shared/audio_track_audio_sink_type.cc
+++ b/src/starboard/android/shared/audio_track_audio_sink_type.cc
@@ -39,8 +39,8 @@
 const int kRequiredFramesIncrement = 2 * 1024;
 const int kMinStablePlayedFrames = 12 * 1024;
 
-const int kSampleFrequency22k = 22050;
-const int kSampleFrequency48k = 48000;
+const int kSampleFrequency22050 = 22050;
+const int kSampleFrequency48000 = 48000;
 
 // Helper function to compute the size of the two valid starboard audio sample
 // types.
@@ -423,10 +423,10 @@
     sample_type = kSbMediaAudioSampleTypeInt16Deprecated;
     SB_DCHECK(SbAudioSinkIsAudioSampleTypeSupported(sample_type));
   }
-  min_required_frames_tester_.AddTest(2, sample_type, kSampleFrequency48k,
+  min_required_frames_tester_.AddTest(2, sample_type, kSampleFrequency48000,
                                       onMinRequiredFramesForWebAudioReceived,
                                       8 * 1024);
-  min_required_frames_tester_.AddTest(2, sample_type, kSampleFrequency22k,
+  min_required_frames_tester_.AddTest(2, sample_type, kSampleFrequency22050,
                                       onMinRequiredFramesForWebAudioReceived,
                                       4 * 1024);
   min_required_frames_tester_.Start();
@@ -436,17 +436,17 @@
     int channels,
     SbMediaAudioSampleType sample_type,
     int sampling_frequency_hz) {
-  if (sampling_frequency_hz <= kSampleFrequency22k) {
+  if (sampling_frequency_hz <= kSampleFrequency22050) {
     ScopedLock lock(min_required_frames_map_mutex_);
-    if (min_required_frames_map_.find(kSampleFrequency22k) !=
+    if (min_required_frames_map_.find(kSampleFrequency22050) !=
         min_required_frames_map_.end()) {
-      return min_required_frames_map_[kSampleFrequency22k];
+      return min_required_frames_map_[kSampleFrequency22050];
     }
-  } else if (sampling_frequency_hz <= kSampleFrequency48k) {
+  } else if (sampling_frequency_hz <= kSampleFrequency48000) {
     ScopedLock lock(min_required_frames_map_mutex_);
-    if (min_required_frames_map_.find(kSampleFrequency48k) !=
+    if (min_required_frames_map_.find(kSampleFrequency48000) !=
         min_required_frames_map_.end()) {
-      return min_required_frames_map_[kSampleFrequency48k];
+      return min_required_frames_map_[kSampleFrequency48000];
     }
   }
   return kMaxRequiredFrames;
diff --git a/src/starboard/android/shared/cobalt/android_media_session_client.cc b/src/starboard/android/shared/cobalt/android_media_session_client.cc
index 1861af9..30ec630 100644
--- a/src/starboard/android/shared/cobalt/android_media_session_client.cc
+++ b/src/starboard/android/shared/cobalt/android_media_session_client.cc
@@ -289,12 +289,16 @@
       }
     }
 
-    jlong duration = session_state.duration();
-    // Set duration to negative if duration is unknown or infinite, as with live
-    // playback.
-    // https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_DURATION
-    if (duration == kSbTimeMax) {
-      duration = -1;
+    jlong durationInMilliseconds;
+    if (session_state.duration() == kSbTimeMax) {
+      // Set duration to negative if duration is unknown or infinite, as with live
+      // playback.
+      // https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat#METADATA_KEY_DURATION
+      durationInMilliseconds = -1;
+    } else {
+      // SbTime is measured in microseconds while Android MediaSession expects
+      // duration in milliseconds.
+      durationInMilliseconds = session_state.duration() / kSbTimeMillisecond;
     }
 
     env->CallStarboardVoidMethodOrAbort(
@@ -305,7 +309,7 @@
         session_state.current_playback_position() / kSbTimeMillisecond,
         static_cast<jfloat>(session_state.actual_playback_rate()),
         j_title.Get(), j_artist.Get(), j_album.Get(), j_artwork.Get(),
-        duration);
+        durationInMilliseconds);
   }
 };
 
diff --git a/src/starboard/android/shared/gyp_configuration.py b/src/starboard/android/shared/gyp_configuration.py
index 52c4c5e..ae609f3 100644
--- a/src/starboard/android/shared/gyp_configuration.py
+++ b/src/starboard/android/shared/gyp_configuration.py
@@ -327,6 +327,9 @@
           # This test is failing because localhost is not defined for IPv6 in
           # /etc/hosts.
           'SbSocketAddressTypes/SbSocketResolveTest.Localhost/1',
+          # Crashing in audio_track_audio_sink_type.cc.
+          'SbAudioSinkCreateTest.*',
+          'SbAudioSinkTest.*',
       ],
   }
 
diff --git a/src/starboard/android/shared/player_components_factory.cc b/src/starboard/android/shared/player_components_factory.cc
new file mode 100644
index 0000000..414f317
--- /dev/null
+++ b/src/starboard/android/shared/player_components_factory.cc
@@ -0,0 +1,143 @@
+// Copyright 2017 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "starboard/android/shared/audio_decoder.h"
+#include "starboard/android/shared/video_decoder.h"
+#include "starboard/android/shared/video_render_algorithm.h"
+#include "starboard/common/log.h"
+#include "starboard/common/ref_counted.h"
+#include "starboard/common/scoped_ptr.h"
+#include "starboard/media.h"
+#include "starboard/shared/opus/opus_audio_decoder.h"
+#include "starboard/shared/starboard/player/filter/adaptive_audio_decoder_internal.h"
+#include "starboard/shared/starboard/player/filter/audio_decoder_internal.h"
+#include "starboard/shared/starboard/player/filter/audio_renderer_sink.h"
+#include "starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h"
+#include "starboard/shared/starboard/player/filter/player_components.h"
+#include "starboard/shared/starboard/player/filter/video_decoder_internal.h"
+#include "starboard/shared/starboard/player/filter/video_render_algorithm.h"
+#include "starboard/shared/starboard/player/filter/video_render_algorithm_impl.h"
+#include "starboard/shared/starboard/player/filter/video_renderer_sink.h"
+
+namespace starboard {
+namespace shared {
+namespace starboard {
+namespace player {
+namespace filter {
+
+namespace {
+
+class PlayerComponentsFactory : public PlayerComponents::Factory {
+  bool CreateSubComponents(
+      const CreationParameters& creation_parameters,
+      scoped_ptr<AudioDecoder>* audio_decoder,
+      scoped_ptr<AudioRendererSink>* audio_renderer_sink,
+      scoped_ptr<VideoDecoder>* video_decoder,
+      scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
+      scoped_refptr<VideoRendererSink>* video_renderer_sink,
+      std::string* error_message) override {
+    SB_DCHECK(error_message);
+
+    if (creation_parameters.audio_codec() != kSbMediaAudioCodecNone) {
+      SB_DCHECK(audio_decoder);
+      SB_DCHECK(audio_renderer_sink);
+
+      auto decoder_creator = [](const SbMediaAudioSampleInfo& audio_sample_info,
+                                SbDrmSystem drm_system) {
+        using AacAudioDecoder = ::starboard::android::shared::AudioDecoder;
+        using OpusAudioDecoder = ::starboard::shared::opus::OpusAudioDecoder;
+
+        if (audio_sample_info.codec == kSbMediaAudioCodecAac) {
+          scoped_ptr<AacAudioDecoder> audio_decoder_impl(new AacAudioDecoder(
+              audio_sample_info.codec, audio_sample_info, drm_system));
+          if (audio_decoder_impl->is_valid()) {
+            return audio_decoder_impl.PassAs<AudioDecoder>();
+          }
+        } else if (audio_sample_info.codec == kSbMediaAudioCodecOpus) {
+          scoped_ptr<OpusAudioDecoder> audio_decoder_impl(
+              new OpusAudioDecoder(audio_sample_info));
+          if (audio_decoder_impl->is_valid()) {
+            return audio_decoder_impl.PassAs<AudioDecoder>();
+          }
+        } else {
+          SB_NOTREACHED();
+        }
+        return scoped_ptr<AudioDecoder>();
+      };
+
+      audio_decoder->reset(new AdaptiveAudioDecoder(
+          creation_parameters.audio_sample_info(),
+          creation_parameters.drm_system(), decoder_creator));
+      audio_renderer_sink->reset(new AudioRendererSinkImpl);
+    }
+
+    if (creation_parameters.video_codec() != kSbMediaVideoCodecNone) {
+      using VideoDecoderImpl = ::starboard::android::shared::VideoDecoder;
+      using VideoRenderAlgorithmImpl =
+          ::starboard::android::shared::VideoRenderAlgorithm;
+
+      SB_DCHECK(video_decoder);
+      SB_DCHECK(video_render_algorithm);
+      SB_DCHECK(video_renderer_sink);
+      SB_DCHECK(error_message);
+
+      scoped_ptr<VideoDecoderImpl> video_decoder_impl(new VideoDecoderImpl(
+          creation_parameters.video_codec(), creation_parameters.drm_system(),
+          creation_parameters.output_mode(),
+          creation_parameters.decode_target_graphics_context_provider()));
+      if (video_decoder_impl->is_valid()) {
+        *video_renderer_sink = video_decoder_impl->GetSink();
+        video_decoder->reset(video_decoder_impl.release());
+      } else {
+        video_decoder->reset();
+        *video_renderer_sink = NULL;
+        *error_message = "Failed to create video decoder.";
+        return false;
+      }
+
+      video_render_algorithm->reset(new VideoRenderAlgorithmImpl);
+    }
+
+    return true;
+  }
+};
+
+}  // namespace
+
+// static
+scoped_ptr<PlayerComponents::Factory> PlayerComponents::Factory::Create() {
+  return make_scoped_ptr<PlayerComponents::Factory>(
+      new PlayerComponentsFactory);
+}
+
+// static
+bool VideoDecoder::OutputModeSupported(SbPlayerOutputMode output_mode,
+                                       SbMediaVideoCodec codec,
+                                       SbDrmSystem drm_system) {
+  if (output_mode == kSbPlayerOutputModePunchOut) {
+    return true;
+  }
+
+  if (output_mode == kSbPlayerOutputModeDecodeToTexture) {
+    return !SbDrmSystemIsValid(drm_system);
+  }
+
+  return false;
+}
+
+}  // namespace filter
+}  // namespace player
+}  // namespace starboard
+}  // namespace shared
+}  // namespace starboard
diff --git a/src/starboard/android/shared/player_components_impl.cc b/src/starboard/android/shared/player_components_impl.cc
deleted file mode 100644
index d7f1eaa..0000000
--- a/src/starboard/android/shared/player_components_impl.cc
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright 2017 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "starboard/shared/starboard/player/filter/player_components.h"
-
-#include "starboard/android/shared/audio_decoder.h"
-#include "starboard/android/shared/video_decoder.h"
-#include "starboard/android/shared/video_render_algorithm.h"
-#include "starboard/common/log.h"
-#include "starboard/common/ref_counted.h"
-#include "starboard/common/scoped_ptr.h"
-#include "starboard/media.h"
-#include "starboard/shared/opus/opus_audio_decoder.h"
-#include "starboard/shared/starboard/player/filter/adaptive_audio_decoder_internal.h"
-#include "starboard/shared/starboard/player/filter/audio_decoder_internal.h"
-#include "starboard/shared/starboard/player/filter/audio_renderer_sink.h"
-#include "starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h"
-#include "starboard/shared/starboard/player/filter/video_decoder_internal.h"
-#include "starboard/shared/starboard/player/filter/video_render_algorithm.h"
-#include "starboard/shared/starboard/player/filter/video_render_algorithm_impl.h"
-#include "starboard/shared/starboard/player/filter/video_renderer_sink.h"
-
-namespace starboard {
-namespace shared {
-namespace starboard {
-namespace player {
-namespace filter {
-
-namespace {
-
-class PlayerComponentsImpl : public PlayerComponents {
-  bool CreateAudioComponents(const AudioParameters& audio_parameters,
-                             scoped_ptr<AudioDecoder>* audio_decoder,
-                             scoped_ptr<AudioRendererSink>* audio_renderer_sink,
-                             std::string* error_message) override {
-    SB_DCHECK(audio_decoder);
-    SB_DCHECK(audio_renderer_sink);
-    SB_DCHECK(error_message);
-
-    auto decoder_creator = [](const SbMediaAudioSampleInfo& audio_sample_info,
-                              SbDrmSystem drm_system) {
-      using AacAudioDecoder = ::starboard::android::shared::AudioDecoder;
-      using OpusAudioDecoder = ::starboard::shared::opus::OpusAudioDecoder;
-
-      if (audio_sample_info.codec == kSbMediaAudioCodecAac) {
-        scoped_ptr<AacAudioDecoder> audio_decoder_impl(new AacAudioDecoder(
-            audio_sample_info.codec, audio_sample_info, drm_system));
-        if (audio_decoder_impl->is_valid()) {
-          return audio_decoder_impl.PassAs<AudioDecoder>();
-        }
-      } else if (audio_sample_info.codec == kSbMediaAudioCodecOpus) {
-        scoped_ptr<OpusAudioDecoder> audio_decoder_impl(
-            new OpusAudioDecoder(audio_sample_info));
-        if (audio_decoder_impl->is_valid()) {
-          return audio_decoder_impl.PassAs<AudioDecoder>();
-        }
-      } else {
-        SB_NOTREACHED();
-      }
-      return scoped_ptr<AudioDecoder>();
-    };
-
-    audio_decoder->reset(
-        new AdaptiveAudioDecoder(audio_parameters.audio_sample_info,
-                                 audio_parameters.drm_system, decoder_creator));
-    audio_renderer_sink->reset(new AudioRendererSinkImpl);
-    return true;
-  }
-
-  bool CreateVideoComponents(
-      const VideoParameters& video_parameters,
-      scoped_ptr<VideoDecoder>* video_decoder,
-      scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
-      scoped_refptr<VideoRendererSink>* video_renderer_sink,
-      std::string* error_message) override {
-    using VideoDecoderImpl = ::starboard::android::shared::VideoDecoder;
-    using VideoRenderAlgorithmImpl =
-        ::starboard::android::shared::VideoRenderAlgorithm;
-
-    SB_DCHECK(video_decoder);
-    SB_DCHECK(video_render_algorithm);
-    SB_DCHECK(video_renderer_sink);
-    SB_DCHECK(error_message);
-
-    scoped_ptr<VideoDecoderImpl> video_decoder_impl(new VideoDecoderImpl(
-        video_parameters.video_codec, video_parameters.drm_system,
-        video_parameters.output_mode,
-        video_parameters.decode_target_graphics_context_provider));
-    if (video_decoder_impl->is_valid()) {
-      *video_renderer_sink = video_decoder_impl->GetSink();
-      video_decoder->reset(video_decoder_impl.release());
-    } else {
-      video_decoder->reset();
-      *video_renderer_sink = NULL;
-      *error_message = "Failed to create video decoder.";
-      return false;
-    }
-
-    video_render_algorithm->reset(new VideoRenderAlgorithmImpl);
-    return true;
-  }
-};
-
-}  // namespace
-
-// static
-scoped_ptr<PlayerComponents> PlayerComponents::Create() {
-  return make_scoped_ptr<PlayerComponents>(new PlayerComponentsImpl);
-}
-
-// static
-bool VideoDecoder::OutputModeSupported(SbPlayerOutputMode output_mode,
-                                       SbMediaVideoCodec codec,
-                                       SbDrmSystem drm_system) {
-  if (output_mode == kSbPlayerOutputModePunchOut) {
-    return true;
-  }
-
-  if (output_mode == kSbPlayerOutputModeDecodeToTexture) {
-    return !SbDrmSystemIsValid(drm_system);
-  }
-
-  return false;
-}
-
-}  // namespace filter
-}  // namespace player
-}  // namespace starboard
-}  // namespace shared
-}  // namespace starboard
diff --git a/src/starboard/android/shared/player_create.cc b/src/starboard/android/shared/player_create.cc
index 8f919dd..ee4a524 100644
--- a/src/starboard/android/shared/player_create.cc
+++ b/src/starboard/android/shared/player_create.cc
@@ -112,9 +112,7 @@
   UpdateActiveSessionPlatformPlaybackState(kPlaying);
 
   starboard::scoped_ptr<PlayerWorker::Handler> handler(
-      new FilterBasedPlayerWorkerHandler(
-          video_codec, audio_codec, creation_param->drm_system,
-          &creation_param->audio_sample_info, output_mode, provider));
+      new FilterBasedPlayerWorkerHandler(creation_param, provider));
   SbPlayer player = SbPlayerPrivate::CreateInstance(
       audio_codec, video_codec, &creation_param->audio_sample_info,
       sample_deallocate_func, decoder_status_func, player_status_func,
diff --git a/src/starboard/android/shared/starboard_platform.gypi b/src/starboard/android/shared/starboard_platform.gypi
index 213def6..0591ca2 100644
--- a/src/starboard/android/shared/starboard_platform.gypi
+++ b/src/starboard/android/shared/starboard_platform.gypi
@@ -13,7 +13,7 @@
 # limitations under the License.
 {
   'variables': {
-    'has_input_events_filter' : '<!(python ../../../build/file_exists.py <(DEPTH)/starboard/android/shared/input_events_filter.cc)',
+    'has_input_events_filter' : '<!(python <(DEPTH)/build/file_exists.py <(DEPTH)/starboard/android/shared/input_events_filter.cc)',
     'has_drm_system_extension%': '<!(test -e <(DEPTH)/starboard/android/shared/drm_system_extension/drm_system_extension.gyp && echo 1 || echo 0)',
   },
   'includes': [
@@ -477,7 +477,7 @@
         'starboard_base_symbolize',
       ],
       'conditions': [
-        ['has_input_events_filter=="True"', {
+        ['has_input_events_filter==1', {
           'sources': [
             'input_events_filter.cc',
             'input_events_filter.h',
@@ -494,7 +494,7 @@
           'sources': [
             'drm_create_system.cc',
             'media_is_supported.cc',
-            'player_components_impl.cc',
+            'player_components_factory.cc',
           ],
         }],
       ],
diff --git a/src/starboard/android/shared/video_render_algorithm.h b/src/starboard/android/shared/video_render_algorithm.h
index 37e4773..959d5c2 100644
--- a/src/starboard/android/shared/video_render_algorithm.h
+++ b/src/starboard/android/shared/video_render_algorithm.h
@@ -18,7 +18,7 @@
 #include <list>
 
 #include "starboard/android/shared/jni_env_ext.h"
-#include "starboard/shared/starboard/player/filter/video_renderer_internal.h"
+#include "starboard/shared/starboard/player/filter/video_render_algorithm.h"
 
 namespace starboard {
 namespace android {
diff --git a/src/starboard/build/base_configuration.gypi b/src/starboard/build/base_configuration.gypi
index 3b0d447..eb61c23 100644
--- a/src/starboard/build/base_configuration.gypi
+++ b/src/starboard/build/base_configuration.gypi
@@ -35,6 +35,7 @@
       # TODO: Remove the "data" subdirectory.
       'sb_static_contents_output_data_dir%': '<(PRODUCT_DIR)/content/data',
       'sb_deploy_output_dir%': '<(PRODUCT_DIR)/deploy',
+      'sb_evergreen_compatible%': 0,
     },
 
     # Enables the yasm compiler to be used to compile .asm files.
@@ -75,7 +76,7 @@
 
     # Whether this is an evergreen compatible platform. A compatible platform
     # can run the elf_loader and launch the evergreen build.
-    'sb_evergreen_compatible': 0,
+    'sb_evergreen_compatible%': '<(sb_evergreen_compatible)',
 
     # The operating system of the target, separate from the target_arch. In many
     # cases, an 'unknown' value is fine, but, if set to 'linux', then we can
diff --git a/src/starboard/common/common.gyp b/src/starboard/common/common.gyp
index 4db427b..3195314 100644
--- a/src/starboard/common/common.gyp
+++ b/src/starboard/common/common.gyp
@@ -65,6 +65,9 @@
         'thread_collision_warner.h',
         'thread.cc',
         'thread.h',
+
+        'experimental/concurrency_debug.cc',
+        'experimental/concurrency_debug.h',
       ],
       'defines': [
         # This must be defined when building Starboard, and must not when
diff --git a/src/starboard/common/experimental/README.md b/src/starboard/common/experimental/README.md
new file mode 100644
index 0000000..01ce3d5
--- /dev/null
+++ b/src/starboard/common/experimental/README.md
@@ -0,0 +1,4 @@
+# starboard/common/experimental
+
+Features contained in this folder is strictly experimental and can be changed or
+removed at any time, even under the same Cobalt/Starboard version.
diff --git a/src/starboard/common/experimental/concurrency_debug.cc b/src/starboard/common/experimental/concurrency_debug.cc
new file mode 100644
index 0000000..7200ccc
--- /dev/null
+++ b/src/starboard/common/experimental/concurrency_debug.cc
@@ -0,0 +1,103 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "starboard/common/experimental/concurrency_debug.h"
+
+#if SB_ENABLE_CONCURRENTY_DEBUG
+
+#include <algorithm>
+#include <string>
+#include <vector>
+
+#include "starboard/atomic.h"
+#include "starboard/common/log.h"
+#include "starboard/common/mutex.h"
+#include "starboard/shared/posix/time_internal.h"
+#include "starboard/system.h"
+
+namespace starboard {
+namespace experimental {
+namespace {
+
+const int kMaxSymbolNameLength = 1024;
+// Usually there are quite a few contentions at app startup, and it could also
+// be unsafe to log as the log system may not be ready.  So ignore the first
+// few contentions at app startup set by the folloing constant.
+const int kNumberOfInitialContentionsToIgnore = 50;
+
+const SbTime kMinimumWaitToLog = 5 * kSbTimeMillisecond;
+const SbTime kLoggingInterval = 5 * kSbTimeSecond;
+const int kStackTraceDepth = 0;
+
+volatile SbAtomic32 s_mutex_acquire_call_counter = 0;
+volatile SbAtomic32 s_mutex_acquire_contention_counter = 0;
+volatile SbAtomic32 s_mutex_max_contention_time = 0;
+
+}  // namespace
+
+ScopedMutexWaitTracker::ScopedMutexWaitTracker(SbMutex* mutex)
+    : acquired_(SbMutexAcquireTry(mutex) == kSbMutexAcquired) {
+  SbAtomicNoBarrier_Increment(&s_mutex_acquire_call_counter, 1);
+  if (!acquired_) {
+    wait_start_ = SbTimeGetMonotonicNow();
+  }
+}
+
+ScopedMutexWaitTracker::~ScopedMutexWaitTracker() {
+  if (kMinimumWaitToLog == 0 || acquired_) {
+    return;
+  }
+  if (SbAtomicNoBarrier_Increment(&s_mutex_acquire_contention_counter, 1) <
+      kNumberOfInitialContentionsToIgnore) {
+    return;
+  }
+
+  auto elapsed = SbTimeGetMonotonicNow() - wait_start_;
+
+  for (;;) {
+    SbAtomic32 old_value = s_mutex_max_contention_time;
+    if (elapsed <= old_value) {
+      break;
+    }
+    if (SbAtomicNoBarrier_CompareAndSwap(&s_mutex_max_contention_time,
+                                         old_value, elapsed) == old_value) {
+      break;
+    }
+  }
+
+  if (elapsed < kMinimumWaitToLog) {
+    return;
+  }
+
+  SB_LOG(INFO) << "SbMutexAcquire() takes " << elapsed;
+
+  if (kStackTraceDepth > 0) {
+    void* stack[kStackTraceDepth];
+    int num_stack = SbSystemGetStack(stack, kStackTraceDepth);
+
+    for (int i = 2; i < std::min(num_stack, 5); ++i) {
+      char name[kMaxSymbolNameLength + 1];
+      if (SbSystemSymbolize(stack[i], name, kMaxSymbolNameLength)) {
+        SB_LOG(INFO) << "  - " << name;
+      } else {
+        SB_LOG(INFO) << "  - 0x" << stack[i];
+      }
+    }
+  }
+}
+
+}  // namespace experimental
+}  // namespace starboard
+
+#endif  //  SB_ENABLE_CONCURRENTY_DEBUG
\ No newline at end of file
diff --git a/src/starboard/common/experimental/concurrency_debug.h b/src/starboard/common/experimental/concurrency_debug.h
new file mode 100644
index 0000000..b225e67
--- /dev/null
+++ b/src/starboard/common/experimental/concurrency_debug.h
@@ -0,0 +1,88 @@
+// Copyright 2020 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef STARBOARD_COMMON_EXPERIMENTAL_CONCURRENCY_DEBUG_H_
+#define STARBOARD_COMMON_EXPERIMENTAL_CONCURRENCY_DEBUG_H_
+
+#define SB_ENABLE_CONCURRENTY_DEBUG 0
+
+#if SB_ENABLE_CONCURRENTY_DEBUG
+
+#include "starboard/common/log.h"
+#include "starboard/configuration_constants.h"
+#include "starboard/mutex.h"
+#include "starboard/thread.h"
+#include "starboard/time.h"
+
+// WARNING: Features inside experimental namespace is strictly experimental and
+// can be changed or removed at any time, even within the same Cobalt/Starboard
+// version.
+namespace starboard {
+namespace experimental {
+
+// The class can be used to track any mutex acquire that takes extensive time.
+// It can be used by adding the following block of code into SbMutexAcquire()
+// implementation, right before the system call to acquire the mutex:
+//   starboard::experimental::ScopedMutexWaitTracker tracker(mutex);
+//   if (tracker.acquired()) {
+//     return kSbMutexAcquired;
+//   }
+class ScopedMutexWaitTracker {
+ public:
+  explicit ScopedMutexWaitTracker(SbMutex* mutex);
+  ~ScopedMutexWaitTracker();
+
+  bool acquired() const { return acquired_; }
+
+ private:
+  const bool acquired_;
+  SbTime wait_start_;
+};
+
+// The class can be used to track how much CPU the thread consumes periodically.
+// It can be used by declaring "ThreadTracker s_thread_tracker;" as a static
+// object, and then call "s_thread_tracker.CheckPoint(interval);" periodically
+// on the thread being tracked.  It will print out the CPU time consumed by the
+// thread at interval specified by |interval|.
+class ThreadTracker {
+ public:
+  void CheckPoint(SbTime interval) {
+    SbTime wallclock_now = SbTimeGetMonotonicNow();
+
+    if (wallclock_now - last_wallclock_time_ < interval) {
+      return;
+    }
+
+    char name[kSbMaxThreadNameLength + 1];
+    SbThreadGetName(name, kSbMaxThreadNameLength);
+
+    SbTime thread_now = SbTimeGetMonotonicThreadNow();
+    SB_LOG(INFO) << "Thread " << name << " uses "
+                 << thread_now - last_thread_time_ << " during "
+                 << wallclock_now - last_wallclock_time_;
+    last_wallclock_time_ = wallclock_now;
+    last_thread_time_ = thread_now;
+  }
+
+ private:
+  SbTime last_wallclock_time_ = SbTimeGetMonotonicNow();
+  SbTime last_thread_time_ = SbTimeGetMonotonicThreadNow();
+};
+
+}  // namespace experimental
+}  // namespace starboard
+
+#endif  // SB_ENABLE_CONCURRENTY_DEBUG
+
+#endif  // STARBOARD_COMMON_EXPERIMENTAL_CONCURRENCY_DEBUG_H_
diff --git a/src/starboard/common/murmurhash2.cc b/src/starboard/common/murmurhash2.cc
index 24011fc..eda6c09 100644
--- a/src/starboard/common/murmurhash2.cc
+++ b/src/starboard/common/murmurhash2.cc
@@ -1,88 +1,88 @@
-// Copyright 2018 The Cobalt Authors. All Rights Reserved.

-//

-// Licensed under the Apache License, Version 2.0 (the "License");

-// you may not use this file except in compliance with the License.

-// You may obtain a copy of the License at

-//

-//     http://www.apache.org/licenses/LICENSE-2.0

-//

-// Unless required by applicable law or agreed to in writing, software

-// distributed under the License is distributed on an "AS IS" BASIS,

-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-// See the License for the specific language governing permissions and

-// limitations under the License.

-

-#include "starboard/common/murmurhash2.h"

-

-namespace starboard {

-

-// Aligns data if it isn't already.

-uint32_t MurmurHash2_32(const void* src, uint32_t size, uint32_t prev_hash) {

-  if ((reinterpret_cast<uintptr_t>(src) & 0x3) == 0) {

-    // Already aligned.

-    return MurmurHash2_32_Aligned(src, size, prev_hash);

-  } else {

-    enum { kInlineSize = 1024 };

-    if (size <= kInlineSize) {

-      uint32_t aligned_src[kInlineSize / 4];

-      SbMemoryCopy(aligned_src, src, size);

-      return MurmurHash2_32_Aligned(aligned_src, size, prev_hash);

-    } else {

-      scoped_array<char> aligned_src(new char[size]);

-      SbMemoryCopy(aligned_src.get(), src, size);

-      return MurmurHash2_32_Aligned(aligned_src.get(), size, prev_hash);

-    }

-  }

-}

-

-// Warning - do not change the output of this function because certain platforms

-// rely on this hash being stable across runs.

-uint32_t MurmurHash2_32_Aligned(const void* src,

-                                uint32_t size,

-                                uint32_t prev_hash) {

-  // 'm' and 'r' are mixing constants generated offline.

-  // They're not really 'magic', they just happen to work well.

-  static const uint32_t m = 0x5bd1e995;

-  static const int r = 24;

-

-  const uint8_t* data = reinterpret_cast<const uint8_t*>(src);

-

-  // Initialize the hash to the previous hash value.

-  uint32_t h = prev_hash;

-

-  // Mix 4 bytes at a time into the hash

-  while (size >= 4) {

-    uint32_t k = *reinterpret_cast<const uint32_t*>(data);

-

-    k *= m;

-    k ^= k >> r;

-    k *= m;

-

-    h *= m;

-    h ^= k;

-

-    size -= 4;

-    data += 4;

-  }

-

-  // Handle the last few bytes of the input array

-  switch (size) {

-    case 3:

-      h ^= data[2] << 16;

-    case 2:

-      h ^= data[1] << 8;

-    case 1:

-      h ^= data[0];

-      h *= m;

-  }

-

-  // Do a few final mixes of the hash to ensure the last few

-  // bytes are well-incorporated.

-  h ^= h >> 13;

-  h *= m;

-  h ^= h >> 15;

-

-  return h;

-}

-

-}  // namespace starboard

+// Copyright 2018 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "starboard/common/murmurhash2.h"
+
+namespace starboard {
+
+// Aligns data if it isn't already.
+uint32_t MurmurHash2_32(const void* src, uint32_t size, uint32_t prev_hash) {
+  if ((reinterpret_cast<uintptr_t>(src) & 0x3) == 0) {
+    // Already aligned.
+    return MurmurHash2_32_Aligned(src, size, prev_hash);
+  } else {
+    enum { kInlineSize = 1024 };
+    if (size <= kInlineSize) {
+      uint32_t aligned_src[kInlineSize / 4];
+      SbMemoryCopy(aligned_src, src, size);
+      return MurmurHash2_32_Aligned(aligned_src, size, prev_hash);
+    } else {
+      scoped_array<char> aligned_src(new char[size]);
+      SbMemoryCopy(aligned_src.get(), src, size);
+      return MurmurHash2_32_Aligned(aligned_src.get(), size, prev_hash);
+    }
+  }
+}
+
+// Warning - do not change the output of this function because certain platforms
+// rely on this hash being stable across runs.
+uint32_t MurmurHash2_32_Aligned(const void* src,
+                                uint32_t size,
+                                uint32_t prev_hash) {
+  // 'm' and 'r' are mixing constants generated offline.
+  // They're not really 'magic', they just happen to work well.
+  static const uint32_t m = 0x5bd1e995;
+  static const int r = 24;
+
+  const uint8_t* data = reinterpret_cast<const uint8_t*>(src);
+
+  // Initialize the hash to the previous hash value.
+  uint32_t h = prev_hash;
+
+  // Mix 4 bytes at a time into the hash
+  while (size >= 4) {
+    uint32_t k = *reinterpret_cast<const uint32_t*>(data);
+
+    k *= m;
+    k ^= k >> r;
+    k *= m;
+
+    h *= m;
+    h ^= k;
+
+    size -= 4;
+    data += 4;
+  }
+
+  // Handle the last few bytes of the input array
+  switch (size) {
+    case 3:
+      h ^= data[2] << 16;
+    case 2:
+      h ^= data[1] << 8;
+    case 1:
+      h ^= data[0];
+      h *= m;
+  }
+
+  // Do a few final mixes of the hash to ensure the last few
+  // bytes are well-incorporated.
+  h ^= h >> 13;
+  h *= m;
+  h ^= h >> 15;
+
+  return h;
+}
+
+}  // namespace starboard
diff --git a/src/starboard/common/murmurhash2.h b/src/starboard/common/murmurhash2.h
index cb783c2..b520efd 100644
--- a/src/starboard/common/murmurhash2.h
+++ b/src/starboard/common/murmurhash2.h
@@ -1,40 +1,40 @@
-// Copyright 2018 The Cobalt Authors. All Rights Reserved.

-//

-// Licensed under the Apache License, Version 2.0 (the "License");

-// you may not use this file except in compliance with the License.

-// You may obtain a copy of the License at

-//

-//     http://www.apache.org/licenses/LICENSE-2.0

-//

-// Unless required by applicable law or agreed to in writing, software

-// distributed under the License is distributed on an "AS IS" BASIS,

-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-// See the License for the specific language governing permissions and

-// limitations under the License.

-

-#ifndef STARBOARD_COMMON_MURMURHASH2_H_

-#define STARBOARD_COMMON_MURMURHASH2_H_

-

-#include "starboard/common/scoped_ptr.h"

-#include "starboard/types.h"

-

-namespace starboard {

-

-// This is an implementation of the MurmurHash2 by Austin Appleby.

-// A couple of important notes:

-// 1. This hash shall produces stable hashes for all architectures of the same

-//    int-endianess.

-// 2. Hashes can be chained together by using the parameter prev_hash.

-uint32_t MurmurHash2_32(const void* src,

-                        uint32_t size,

-                        uint32_t prev_hash = 0x8d6914e8);

-

-// Same as MurmurHash2_32 but the src data must be aligned to a 4 byte boundary.

-// For best performance use this function.

-uint32_t MurmurHash2_32_Aligned(const void* src,

-                                uint32_t size,

-                                uint32_t prev_hash = 0x8d6914e8);

-

-}  // namespace starboard

-

-#endif  // STARBOARD_COMMON_MURMURHASH2_H_

+// Copyright 2018 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef STARBOARD_COMMON_MURMURHASH2_H_
+#define STARBOARD_COMMON_MURMURHASH2_H_
+
+#include "starboard/common/scoped_ptr.h"
+#include "starboard/types.h"
+
+namespace starboard {
+
+// This is an implementation of the MurmurHash2 by Austin Appleby.
+// A couple of important notes:
+// 1. This hash shall produces stable hashes for all architectures of the same
+//    int-endianess.
+// 2. Hashes can be chained together by using the parameter prev_hash.
+uint32_t MurmurHash2_32(const void* src,
+                        uint32_t size,
+                        uint32_t prev_hash = 0x8d6914e8);
+
+// Same as MurmurHash2_32 but the src data must be aligned to a 4 byte boundary.
+// For best performance use this function.
+uint32_t MurmurHash2_32_Aligned(const void* src,
+                                uint32_t size,
+                                uint32_t prev_hash = 0x8d6914e8);
+
+}  // namespace starboard
+
+#endif  // STARBOARD_COMMON_MURMURHASH2_H_
diff --git a/src/starboard/configuration.h b/src/starboard/configuration.h
index 384b1ac..1ea1cc4 100644
--- a/src/starboard/configuration.h
+++ b/src/starboard/configuration.h
@@ -250,7 +250,7 @@
 #define SB_DRM_CBCS_SUPPORT_VERSION SB_EXPERIMENTAL_API_VERSION
 
 // Deprecate the SB_HAS_VIRTUAL_REGIONS flag as all platforms define it to 0.
-#define SB_VIRTUAL_REGIONS_FLAG_DEPRECATED SB_API_VERSION
+#define SB_VIRTUAL_REGIONS_FLAG_DEPRECATED SB_EXPERIMENTAL_API_VERSION
 
 // --- Release Candidate Feature Defines -------------------------------------
 
diff --git a/src/starboard/linux/shared/BUILD.gn b/src/starboard/linux/shared/BUILD.gn
index e4a258e..7121e20 100644
--- a/src/starboard/linux/shared/BUILD.gn
+++ b/src/starboard/linux/shared/BUILD.gn
@@ -268,7 +268,7 @@
     "//starboard/linux/shared/decode_target_internal.h",
     "//starboard/linux/shared/decode_target_release.cc",
     "//starboard/linux/shared/media_is_video_supported.cc",
-    "//starboard/linux/shared/player_components_impl.cc",
+    "//starboard/linux/shared/player_components_factory.cc",
     "//starboard/linux/shared/system_get_connection_type.cc",
     "//starboard/linux/shared/system_get_device_type.cc",
     "//starboard/linux/shared/system_get_path.cc",
diff --git a/src/starboard/linux/shared/player_components_factory.cc b/src/starboard/linux/shared/player_components_factory.cc
new file mode 100644
index 0000000..6c9b2bb
--- /dev/null
+++ b/src/starboard/linux/shared/player_components_factory.cc
@@ -0,0 +1,237 @@
+// Copyright 2017 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "starboard/common/log.h"
+#include "starboard/common/ref_counted.h"
+#include "starboard/common/scoped_ptr.h"
+#include "starboard/format_string.h"
+#if SB_API_VERSION >= 11
+#include "starboard/gles.h"
+#endif  // SB_API_VERSION >= 11
+#include "starboard/media.h"
+#include "starboard/shared/ffmpeg/ffmpeg_audio_decoder.h"
+#include "starboard/shared/ffmpeg/ffmpeg_video_decoder.h"
+#include "starboard/shared/libaom/aom_video_decoder.h"
+#include "starboard/shared/libde265/de265_video_decoder.h"
+#include "starboard/shared/libvpx/vpx_video_decoder.h"
+#include "starboard/shared/opus/opus_audio_decoder.h"
+#include "starboard/shared/starboard/player/filter/adaptive_audio_decoder_internal.h"
+#include "starboard/shared/starboard/player/filter/audio_decoder_internal.h"
+#include "starboard/shared/starboard/player/filter/audio_renderer_sink.h"
+#include "starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h"
+#include "starboard/shared/starboard/player/filter/player_components.h"
+#include "starboard/shared/starboard/player/filter/punchout_video_renderer_sink.h"
+#include "starboard/shared/starboard/player/filter/video_decoder_internal.h"
+#include "starboard/shared/starboard/player/filter/video_render_algorithm.h"
+#include "starboard/shared/starboard/player/filter/video_render_algorithm_impl.h"
+#include "starboard/shared/starboard/player/filter/video_renderer_sink.h"
+
+namespace starboard {
+namespace shared {
+namespace starboard {
+namespace player {
+namespace filter {
+
+namespace {
+
+class PlayerComponentsFactory : public PlayerComponents::Factory {
+ public:
+  bool CreateSubComponents(
+      const CreationParameters& creation_parameters,
+      scoped_ptr<AudioDecoder>* audio_decoder,
+      scoped_ptr<AudioRendererSink>* audio_renderer_sink,
+      scoped_ptr<VideoDecoder>* video_decoder,
+      scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
+      scoped_refptr<VideoRendererSink>* video_renderer_sink,
+      std::string* error_message) override {
+    SB_DCHECK(error_message);
+
+    if (creation_parameters.audio_codec() != kSbMediaAudioCodecNone) {
+      SB_DCHECK(audio_decoder);
+      SB_DCHECK(audio_renderer_sink);
+
+      typedef ::starboard::shared::ffmpeg::AudioDecoder FfmpegAudioDecoder;
+      typedef ::starboard::shared::opus::OpusAudioDecoder OpusAudioDecoder;
+
+#if SB_API_VERSION >= 11
+      auto decoder_creator = [](const SbMediaAudioSampleInfo& audio_sample_info,
+                                SbDrmSystem drm_system) {
+        if (audio_sample_info.codec == kSbMediaAudioCodecOpus) {
+          scoped_ptr<OpusAudioDecoder> audio_decoder_impl(
+              new OpusAudioDecoder(audio_sample_info));
+          if (audio_decoder_impl->is_valid()) {
+            return audio_decoder_impl.PassAs<AudioDecoder>();
+          }
+        } else {
+          scoped_ptr<FfmpegAudioDecoder> audio_decoder_impl(
+              FfmpegAudioDecoder::Create(audio_sample_info.codec,
+                                         audio_sample_info));
+          if (audio_decoder_impl && audio_decoder_impl->is_valid()) {
+            return audio_decoder_impl.PassAs<AudioDecoder>();
+          }
+        }
+        return scoped_ptr<AudioDecoder>();
+      };
+
+      audio_decoder->reset(new AdaptiveAudioDecoder(
+          creation_parameters.audio_sample_info(),
+          creation_parameters.drm_system(), decoder_creator));
+#else   // SB_API_VERSION >= 11
+      if (creation_parameters.audio_codec() == kSbMediaAudioCodecOpus) {
+        scoped_ptr<OpusAudioDecoder> audio_decoder_impl(
+            new OpusAudioDecoder(creation_parameters.audio_sample_info()));
+        if (audio_decoder_impl && audio_decoder_impl->is_valid()) {
+          audio_decoder->reset(audio_decoder_impl.release());
+        } else {
+          audio_decoder->reset();
+          SB_LOG(ERROR) << "Failed to create Opus audio decoder.";
+          *error_message = "Failed to create Opus audio decoder.";
+          return false;
+        }
+      } else {
+        scoped_ptr<FfmpegAudioDecoder> audio_decoder_impl(
+            FfmpegAudioDecoder::Create(
+                creation_parameters.audio_codec(),
+                creation_parameters.audio_sample_info()));
+        if (audio_decoder_impl && audio_decoder_impl->is_valid()) {
+          audio_decoder->reset(audio_decoder_impl.release());
+        } else {
+          audio_decoder->reset();
+          SB_LOG(ERROR) << "Failed to create audio decoder for codec "
+                        << creation_parameters.audio_codec();
+          *error_message =
+              FormatString("Failed to create audio decoder for codec %d.",
+                           creation_parameters.audio_codec());
+          return false;
+        }
+      }
+#endif  // SB_API_VERSION >= 11
+      audio_renderer_sink->reset(new AudioRendererSinkImpl);
+    }
+
+    if (creation_parameters.video_codec() != kSbMediaVideoCodecNone) {
+      typedef ::starboard::shared::aom::VideoDecoder Av1VideoDecoderImpl;
+      typedef ::starboard::shared::de265::VideoDecoder H265VideoDecoderImpl;
+      typedef ::starboard::shared::ffmpeg::VideoDecoder FfmpegVideoDecoderImpl;
+      typedef ::starboard::shared::vpx::VideoDecoder VpxVideoDecoderImpl;
+
+      const SbTime kVideoSinkRenderInterval = 10 * kSbTimeMillisecond;
+
+      SB_DCHECK(video_decoder);
+      SB_DCHECK(video_render_algorithm);
+      SB_DCHECK(video_renderer_sink);
+
+      video_decoder->reset();
+
+#if SB_API_VERSION < 11
+      const SbMediaVideoCodec kAv1VideoCodec = kSbMediaVideoCodecVp10;
+#else   // SB_API_VERSION < 11
+      const SbMediaVideoCodec kAv1VideoCodec = kSbMediaVideoCodecAv1;
+#endif  // SB_API_VERSION < 11
+
+      if (creation_parameters.video_codec() == kSbMediaVideoCodecVp9) {
+        video_decoder->reset(new VpxVideoDecoderImpl(
+            creation_parameters.video_codec(),
+            creation_parameters.output_mode(),
+            creation_parameters.decode_target_graphics_context_provider()));
+      } else if (creation_parameters.video_codec() == kAv1VideoCodec) {
+        video_decoder->reset(new Av1VideoDecoderImpl(
+            creation_parameters.video_codec(),
+            creation_parameters.output_mode(),
+            creation_parameters.decode_target_graphics_context_provider()));
+      } else if (creation_parameters.video_codec() == kSbMediaVideoCodecH265) {
+        video_decoder->reset(new H265VideoDecoderImpl(
+            creation_parameters.video_codec(),
+            creation_parameters.output_mode(),
+            creation_parameters.decode_target_graphics_context_provider()));
+      } else {
+        scoped_ptr<FfmpegVideoDecoderImpl> ffmpeg_video_decoder(
+            FfmpegVideoDecoderImpl::Create(
+                creation_parameters.video_codec(),
+                creation_parameters.output_mode(),
+                creation_parameters.decode_target_graphics_context_provider()));
+        if (ffmpeg_video_decoder && ffmpeg_video_decoder->is_valid()) {
+          video_decoder->reset(ffmpeg_video_decoder.release());
+        } else {
+          SB_LOG(ERROR) << "Failed to create video decoder for codec "
+                        << creation_parameters.video_codec();
+          *error_message =
+              FormatString("Failed to create video decoder for codec %d.",
+                           creation_parameters.video_codec());
+          return false;
+        }
+      }
+
+      video_render_algorithm->reset(new VideoRenderAlgorithmImpl([]() {
+        return 60.;  // default refresh rate
+      }));
+      if (creation_parameters.output_mode() ==
+          kSbPlayerOutputModeDecodeToTexture) {
+        *video_renderer_sink = NULL;
+      } else {
+        *video_renderer_sink = new PunchoutVideoRendererSink(
+            creation_parameters.player(), kVideoSinkRenderInterval);
+      }
+    }
+
+    return true;
+  }
+};
+
+}  // namespace
+
+// static
+scoped_ptr<PlayerComponents::Factory> PlayerComponents::Factory::Create() {
+  return make_scoped_ptr<PlayerComponents::Factory>(
+      new PlayerComponentsFactory);
+}
+
+// static
+bool VideoDecoder::OutputModeSupported(SbPlayerOutputMode output_mode,
+                                       SbMediaVideoCodec codec,
+                                       SbDrmSystem drm_system) {
+  SB_UNREFERENCED_PARAMETER(codec);
+  SB_UNREFERENCED_PARAMETER(drm_system);
+
+  bool has_gles_support = false;
+
+#if SB_API_VERSION >= 11
+  has_gles_support = SbGetGlesInterface();
+#elif SB_HAS(GLES2)
+  has_gles_support = true;
+#endif
+
+  if (!has_gles_support) {
+    return output_mode == kSbPlayerOutputModePunchOut;
+  }
+
+#if defined(SB_FORCE_DECODE_TO_TEXTURE_ONLY)
+  // Starboard lib targets may not draw directly to the window, so punch through
+  // video is not made available.
+  return output_mode == kSbPlayerOutputModeDecodeToTexture;
+#endif  // defined(SB_FORCE_DECODE_TO_TEXTURE_ONLY)
+
+  if (output_mode == kSbPlayerOutputModePunchOut ||
+      output_mode == kSbPlayerOutputModeDecodeToTexture) {
+    return true;
+  }
+
+  return false;
+}
+
+}  // namespace filter
+}  // namespace player
+}  // namespace starboard
+}  // namespace shared
+}  // namespace starboard
diff --git a/src/starboard/linux/shared/player_components_impl.cc b/src/starboard/linux/shared/player_components_impl.cc
deleted file mode 100644
index 02b7d92..0000000
--- a/src/starboard/linux/shared/player_components_impl.cc
+++ /dev/null
@@ -1,232 +0,0 @@
-// Copyright 2017 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "starboard/shared/starboard/player/filter/player_components.h"
-
-#include "starboard/common/log.h"
-#include "starboard/common/ref_counted.h"
-#include "starboard/common/scoped_ptr.h"
-#include "starboard/format_string.h"
-#if SB_API_VERSION >= 11
-#include "starboard/gles.h"
-#endif  // SB_API_VERSION >= 11
-#include "starboard/media.h"
-#include "starboard/shared/ffmpeg/ffmpeg_audio_decoder.h"
-#include "starboard/shared/ffmpeg/ffmpeg_video_decoder.h"
-#include "starboard/shared/libaom/aom_video_decoder.h"
-#include "starboard/shared/libde265/de265_video_decoder.h"
-#include "starboard/shared/libvpx/vpx_video_decoder.h"
-#include "starboard/shared/opus/opus_audio_decoder.h"
-#include "starboard/shared/starboard/player/filter/adaptive_audio_decoder_internal.h"
-#include "starboard/shared/starboard/player/filter/audio_decoder_internal.h"
-#include "starboard/shared/starboard/player/filter/audio_renderer_sink.h"
-#include "starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h"
-#include "starboard/shared/starboard/player/filter/punchout_video_renderer_sink.h"
-#include "starboard/shared/starboard/player/filter/video_decoder_internal.h"
-#include "starboard/shared/starboard/player/filter/video_render_algorithm.h"
-#include "starboard/shared/starboard/player/filter/video_render_algorithm_impl.h"
-#include "starboard/shared/starboard/player/filter/video_renderer_sink.h"
-
-namespace starboard {
-namespace shared {
-namespace starboard {
-namespace player {
-namespace filter {
-
-namespace {
-
-class PlayerComponentsImpl : public PlayerComponents {
- public:
-  bool CreateAudioComponents(const AudioParameters& audio_parameters,
-                             scoped_ptr<AudioDecoder>* audio_decoder,
-                             scoped_ptr<AudioRendererSink>* audio_renderer_sink,
-                             std::string* error_message) override {
-    SB_DCHECK(audio_decoder);
-    SB_DCHECK(audio_renderer_sink);
-    SB_DCHECK(error_message);
-
-    typedef ::starboard::shared::ffmpeg::AudioDecoder FfmpegAudioDecoder;
-    typedef ::starboard::shared::opus::OpusAudioDecoder OpusAudioDecoder;
-
-#if SB_API_VERSION >= 11
-    auto decoder_creator = [](const SbMediaAudioSampleInfo& audio_sample_info,
-                              SbDrmSystem drm_system) {
-      if (audio_sample_info.codec == kSbMediaAudioCodecOpus) {
-        scoped_ptr<OpusAudioDecoder> audio_decoder_impl(
-            new OpusAudioDecoder(audio_sample_info));
-        if (audio_decoder_impl->is_valid()) {
-          return audio_decoder_impl.PassAs<AudioDecoder>();
-        }
-      } else {
-        scoped_ptr<FfmpegAudioDecoder> audio_decoder_impl(
-            FfmpegAudioDecoder::Create(audio_sample_info.codec,
-                                       audio_sample_info));
-        if (audio_decoder_impl && audio_decoder_impl->is_valid()) {
-          return audio_decoder_impl.PassAs<AudioDecoder>();
-        }
-      }
-      return scoped_ptr<AudioDecoder>();
-    };
-
-    audio_decoder->reset(
-        new AdaptiveAudioDecoder(audio_parameters.audio_sample_info,
-                                 audio_parameters.drm_system, decoder_creator));
-#else   // SB_API_VERSION >= 11
-    if (audio_parameters.audio_codec == kSbMediaAudioCodecOpus) {
-      scoped_ptr<OpusAudioDecoder> audio_decoder_impl(
-          new OpusAudioDecoder(audio_parameters.audio_sample_info));
-      if (audio_decoder_impl && audio_decoder_impl->is_valid()) {
-        audio_decoder->reset(audio_decoder_impl.release());
-      } else {
-        audio_decoder->reset();
-        SB_LOG(ERROR) << "Failed to create Opus audio decoder.";
-        *error_message = "Failed to create Opus audio decoder.";
-        return false;
-      }
-    } else {
-      scoped_ptr<FfmpegAudioDecoder> audio_decoder_impl(
-          FfmpegAudioDecoder::Create(audio_parameters.audio_codec,
-                                     audio_parameters.audio_sample_info));
-      if (audio_decoder_impl && audio_decoder_impl->is_valid()) {
-        audio_decoder->reset(audio_decoder_impl.release());
-      } else {
-        audio_decoder->reset();
-        SB_LOG(ERROR) << "Failed to create audio decoder for codec "
-                      << audio_parameters.audio_codec;
-        *error_message =
-            FormatString("Failed to create audio decoder for codec %d.",
-                         audio_parameters.audio_codec);
-        return false;
-      }
-    }
-#endif  // SB_API_VERSION >= 11
-    audio_renderer_sink->reset(new AudioRendererSinkImpl);
-
-    return true;
-  }
-
-  bool CreateVideoComponents(
-      const VideoParameters& video_parameters,
-      scoped_ptr<VideoDecoder>* video_decoder,
-      scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
-      scoped_refptr<VideoRendererSink>* video_renderer_sink,
-      std::string* error_message) override {
-    typedef ::starboard::shared::aom::VideoDecoder Av1VideoDecoderImpl;
-    typedef ::starboard::shared::de265::VideoDecoder H265VideoDecoderImpl;
-    typedef ::starboard::shared::ffmpeg::VideoDecoder FfmpegVideoDecoderImpl;
-    typedef ::starboard::shared::vpx::VideoDecoder VpxVideoDecoderImpl;
-
-    const SbTime kVideoSinkRenderInterval = 10 * kSbTimeMillisecond;
-
-    SB_DCHECK(video_decoder);
-    SB_DCHECK(video_render_algorithm);
-    SB_DCHECK(video_renderer_sink);
-    SB_DCHECK(error_message);
-
-    video_decoder->reset();
-
-#if SB_API_VERSION < 11
-    const SbMediaVideoCodec kAv1VideoCodec = kSbMediaVideoCodecVp10;
-#else   // SB_API_VERSION < 11
-    const SbMediaVideoCodec kAv1VideoCodec = kSbMediaVideoCodecAv1;
-#endif  // SB_API_VERSION < 11
-
-    if (video_parameters.video_codec == kSbMediaVideoCodecVp9) {
-      video_decoder->reset(new VpxVideoDecoderImpl(
-          video_parameters.video_codec, video_parameters.output_mode,
-          video_parameters.decode_target_graphics_context_provider));
-    } else if (video_parameters.video_codec == kAv1VideoCodec) {
-      video_decoder->reset(new Av1VideoDecoderImpl(
-          video_parameters.video_codec, video_parameters.output_mode,
-          video_parameters.decode_target_graphics_context_provider));
-    } else if (video_parameters.video_codec == kSbMediaVideoCodecH265) {
-      video_decoder->reset(new H265VideoDecoderImpl(
-          video_parameters.video_codec, video_parameters.output_mode,
-          video_parameters.decode_target_graphics_context_provider));
-    } else {
-      scoped_ptr<FfmpegVideoDecoderImpl> ffmpeg_video_decoder(
-          FfmpegVideoDecoderImpl::Create(
-              video_parameters.video_codec, video_parameters.output_mode,
-              video_parameters.decode_target_graphics_context_provider));
-      if (ffmpeg_video_decoder && ffmpeg_video_decoder->is_valid()) {
-        video_decoder->reset(ffmpeg_video_decoder.release());
-      } else {
-        SB_LOG(ERROR) << "Failed to create video decoder for codec "
-                      << video_parameters.video_codec;
-        *error_message =
-            FormatString("Failed to create video decoder for codec %d.",
-                         video_parameters.video_codec);
-        return false;
-      }
-    }
-
-    video_render_algorithm->reset(new VideoRenderAlgorithmImpl([]() {
-      return 60.;  // default refresh rate
-    }));
-    if (video_parameters.output_mode == kSbPlayerOutputModeDecodeToTexture) {
-      *video_renderer_sink = NULL;
-    } else {
-      *video_renderer_sink = new PunchoutVideoRendererSink(
-          video_parameters.player, kVideoSinkRenderInterval);
-    }
-
-    return true;
-  }
-};
-
-}  // namespace
-
-// static
-scoped_ptr<PlayerComponents> PlayerComponents::Create() {
-  return make_scoped_ptr<PlayerComponents>(new PlayerComponentsImpl);
-}
-
-// static
-bool VideoDecoder::OutputModeSupported(SbPlayerOutputMode output_mode,
-                                       SbMediaVideoCodec codec,
-                                       SbDrmSystem drm_system) {
-  SB_UNREFERENCED_PARAMETER(codec);
-  SB_UNREFERENCED_PARAMETER(drm_system);
-
-  bool has_gles_support = false;
-
-#if SB_API_VERSION >= 11
-  has_gles_support = SbGetGlesInterface();
-#elif SB_HAS(GLES2)
-  has_gles_support = true;
-#endif
-
-  if (!has_gles_support) {
-    return output_mode == kSbPlayerOutputModePunchOut;
-  }
-
-#if defined(SB_FORCE_DECODE_TO_TEXTURE_ONLY)
-  // Starboard lib targets may not draw directly to the window, so punch through
-  // video is not made available.
-  return output_mode == kSbPlayerOutputModeDecodeToTexture;
-#endif  // defined(SB_FORCE_DECODE_TO_TEXTURE_ONLY)
-
-  if (output_mode == kSbPlayerOutputModePunchOut ||
-      output_mode == kSbPlayerOutputModeDecodeToTexture) {
-    return true;
-  }
-
-  return false;
-}
-
-}  // namespace filter
-}  // namespace player
-}  // namespace starboard
-}  // namespace shared
-}  // namespace starboard
diff --git a/src/starboard/linux/shared/starboard_platform.gypi b/src/starboard/linux/shared/starboard_platform.gypi
index b7f9831..71011d9 100644
--- a/src/starboard/linux/shared/starboard_platform.gypi
+++ b/src/starboard/linux/shared/starboard_platform.gypi
@@ -34,7 +34,7 @@
       '<(DEPTH)/starboard/linux/shared/decode_target_release.cc',
       '<(DEPTH)/starboard/linux/shared/media_is_audio_supported.cc',
       '<(DEPTH)/starboard/linux/shared/media_is_video_supported.cc',
-      '<(DEPTH)/starboard/linux/shared/player_components_impl.cc',
+      '<(DEPTH)/starboard/linux/shared/player_components_factory.cc',
       '<(DEPTH)/starboard/linux/shared/system_get_connection_type.cc',
       '<(DEPTH)/starboard/linux/shared/system_get_device_type.cc',
       '<(DEPTH)/starboard/linux/shared/system_get_path.cc',
diff --git a/src/starboard/linux/shared/system_get_path.cc b/src/starboard/linux/shared/system_get_path.cc
index 939db85..ee5d301 100644
--- a/src/starboard/linux/shared/system_get_path.cc
+++ b/src/starboard/linux/shared/system_get_path.cc
@@ -79,7 +79,7 @@
   }
 
   path[bytes_read] = '\0';
-  if (bytes_read > path_size) {
+  if (bytes_read >= path_size) {
     return false;
   }
 
diff --git a/src/starboard/linux/x64x11/gyp_configuration.gypi b/src/starboard/linux/x64x11/gyp_configuration.gypi
index a3b2f2e..baea958 100644
--- a/src/starboard/linux/x64x11/gyp_configuration.gypi
+++ b/src/starboard/linux/x64x11/gyp_configuration.gypi
@@ -14,7 +14,9 @@
 
 {
   'variables': {
-    'sb_evergreen_compatible%': '<!(python <(DEPTH)/build/file_exists.py <(DEPTH)/starboard/elf_loader/evergreen_info.gyp)',
+    'variables': {
+      'sb_evergreen_compatible': '<!(python <(DEPTH)/build/file_exists.py <(DEPTH)/starboard/elf_loader/evergreen_info.gyp)',
+    }
   },
   'target_defaults': {
     'default_configuration': 'linux-x64x11_debug',
diff --git a/src/starboard/linux/x64x11/vulkan/atomic_public.h b/src/starboard/linux/x64x11/vulkan/atomic_public.h
new file mode 100644
index 0000000..10f2749
--- /dev/null
+++ b/src/starboard/linux/x64x11/vulkan/atomic_public.h
@@ -0,0 +1,20 @@
+// Copyright 2017 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef STARBOARD_LINUX_X64X11_VULKAN_ATOMIC_PUBLIC_H_
+#define STARBOARD_LINUX_X64X11_VULKAN_ATOMIC_PUBLIC_H_
+
+#include "starboard/linux/shared/atomic_public.h"
+
+#endif  // STARBOARD_LINUX_X64X11_VULKAN_ATOMIC_PUBLIC_H_
diff --git a/src/starboard/linux/x64x11/vulkan/configuration_public.h b/src/starboard/linux/x64x11/vulkan/configuration_public.h
new file mode 100644
index 0000000..2beca8c
--- /dev/null
+++ b/src/starboard/linux/x64x11/vulkan/configuration_public.h
@@ -0,0 +1,21 @@
+// Copyright 2017 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef STARBOARD_LINUX_X64X11_VULKAN_CONFIGURATION_PUBLIC_H_
+#define STARBOARD_LINUX_X64X11_VULKAN_CONFIGURATION_PUBLIC_H_
+
+// Include the Linux configuration that's common between all x64x11 Linuxes.
+#include "starboard/linux/x64x11/configuration_public.h"
+
+#endif  // STARBOARD_LINUX_X64X11_VULKAN_CONFIGURATION_PUBLIC_H_
diff --git a/src/starboard/linux/x64x11/vulkan/gyp_configuration.gypi b/src/starboard/linux/x64x11/vulkan/gyp_configuration.gypi
new file mode 100644
index 0000000..35099e9
--- /dev/null
+++ b/src/starboard/linux/x64x11/vulkan/gyp_configuration.gypi
@@ -0,0 +1,46 @@
+# Copyright 2017 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{
+  'target_defaults': {
+    'default_configuration': 'linux-x64x11-vulkan_debug',
+    'configurations': {
+      'linux-x64x11-vulkan_debug': {
+        'inherit_from': ['debug_base'],
+      },
+      'linux-x64x11-vulkan_devel': {
+        'inherit_from': ['devel_base'],
+      },
+      'linux-x64x11-vulkan_qa': {
+        'inherit_from': ['qa_base'],
+      },
+      'linux-x64x11-vulkan_gold': {
+        'inherit_from': ['gold_base'],
+      },
+    }, # end of configurations
+  },
+
+  'includes': [
+    '../gyp_configuration.gypi',
+  ],
+
+  'variables': {
+    'gl_type': 'system_gles2',
+
+    'platform_libraries': [
+      '-lEGL',
+      '-lGLESv2',
+    ],
+  },
+}
diff --git a/src/starboard/linux/x64x11/vulkan/gyp_configuration.py b/src/starboard/linux/x64x11/vulkan/gyp_configuration.py
new file mode 100644
index 0000000..037797f
--- /dev/null
+++ b/src/starboard/linux/x64x11/vulkan/gyp_configuration.py
@@ -0,0 +1,21 @@
+# Copyright 2017 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Starboard Linux X64 X11 VULKAN platform configuration."""
+
+from starboard.linux.x64x11 import gyp_configuration as linux_configuration
+
+
+def CreatePlatformConfig():
+  return linux_configuration.LinuxX64X11Configuration(
+      'linux-x64x11-vulkan', sabi_json_path='starboard/sabi/x64/sysv/sabi.json')
diff --git a/src/starboard/linux/x64x11/vulkan/starboard_platform.gyp b/src/starboard/linux/x64x11/vulkan/starboard_platform.gyp
new file mode 100644
index 0000000..82c4436
--- /dev/null
+++ b/src/starboard/linux/x64x11/vulkan/starboard_platform.gyp
@@ -0,0 +1,18 @@
+# Copyright 2017 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+{
+  'includes': [
+    '../shared/starboard_platform_target.gypi',
+  ],
+}
diff --git a/src/starboard/linux/x64x11/vulkan/starboard_platform_tests.gyp b/src/starboard/linux/x64x11/vulkan/starboard_platform_tests.gyp
new file mode 100644
index 0000000..0ea8622
--- /dev/null
+++ b/src/starboard/linux/x64x11/vulkan/starboard_platform_tests.gyp
@@ -0,0 +1,18 @@
+# Copyright 2018 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+{
+  'includes': [
+    '<(DEPTH)/starboard/linux/shared/starboard_platform_tests.gypi',
+  ],
+}
diff --git a/src/starboard/linux/x64x11/vulkan/thread_types_public.h b/src/starboard/linux/x64x11/vulkan/thread_types_public.h
new file mode 100644
index 0000000..a40933a
--- /dev/null
+++ b/src/starboard/linux/x64x11/vulkan/thread_types_public.h
@@ -0,0 +1,22 @@
+// Copyright 2017 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Includes threading primitive types and initializers.
+
+#ifndef STARBOARD_LINUX_X64X11_VULKAN_THREAD_TYPES_PUBLIC_H_
+#define STARBOARD_LINUX_X64X11_VULKAN_THREAD_TYPES_PUBLIC_H_
+
+#include "starboard/linux/x64x11/thread_types_public.h"
+
+#endif  // STARBOARD_LINUX_X64X11_VULKAN_THREAD_TYPES_PUBLIC_H_
diff --git a/src/starboard/nplb/mutex_create_test.cc b/src/starboard/nplb/mutex_create_test.cc
index bb018a2..7ee5098 100644
--- a/src/starboard/nplb/mutex_create_test.cc
+++ b/src/starboard/nplb/mutex_create_test.cc
@@ -27,6 +27,13 @@
   SbMutex mutex;
   EXPECT_TRUE(SbMutexCreate(&mutex));
   EXPECT_TRUE(SbMutexDestroy(&mutex));
+  // TODO: Remove those logs once we get the measurements.
+  SB_LOG(INFO) << "SB_THREAD_TYPES: sizeof(SbMutex): " << sizeof(SbMutex);
+  SB_LOG(INFO) << "SB_THREAD_TYPES: sizeof(SbThread): " << sizeof(SbThread);
+  SB_LOG(INFO) << "SB_THREAD_TYPES: sizeof(SbOnceControl): "
+               << sizeof(SbOnceControl);
+  SB_LOG(INFO) << "SB_THREAD_TYPES: sizeof(SbConditionVariable): "
+               << sizeof(SbConditionVariable);
 }
 
 TEST(SbMutexCreateTest, SunnyDayAutoInit) {
diff --git a/src/starboard/raspi/shared/gyp_configuration.gypi b/src/starboard/raspi/shared/gyp_configuration.gypi
index 6b5607d..8d4bd2f 100644
--- a/src/starboard/raspi/shared/gyp_configuration.gypi
+++ b/src/starboard/raspi/shared/gyp_configuration.gypi
@@ -14,7 +14,9 @@
 
 {
   'variables': {
-    'sb_evergreen_compatible%': '<!(python <(DEPTH)/build/file_exists.py <(DEPTH)/starboard/elf_loader/evergreen_info.gyp)',
+    'variables': {
+      'sb_evergreen_compatible': '<!(python <(DEPTH)/build/file_exists.py <(DEPTH)/starboard/elf_loader/evergreen_info.gyp)',
+    },
 
     # Override that omits the "data" subdirectory.
     # TODO: Remove when omitted for all platforms in base_configuration.gypi.
diff --git a/src/starboard/raspi/shared/player_components_factory.cc b/src/starboard/raspi/shared/player_components_factory.cc
new file mode 100644
index 0000000..b08d8f9
--- /dev/null
+++ b/src/starboard/raspi/shared/player_components_factory.cc
@@ -0,0 +1,110 @@
+// Copyright 2017 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "starboard/common/ref_counted.h"
+#include "starboard/common/scoped_ptr.h"
+#include "starboard/raspi/shared/open_max/video_decoder.h"
+#include "starboard/raspi/shared/video_renderer_sink_impl.h"
+#include "starboard/shared/ffmpeg/ffmpeg_audio_decoder.h"
+#include "starboard/shared/starboard/player/filter/adaptive_audio_decoder_internal.h"
+#include "starboard/shared/starboard/player/filter/audio_decoder_internal.h"
+#include "starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h"
+#include "starboard/shared/starboard/player/filter/player_components.h"
+#include "starboard/shared/starboard/player/filter/video_decoder_internal.h"
+#include "starboard/shared/starboard/player/filter/video_render_algorithm.h"
+#include "starboard/shared/starboard/player/filter/video_render_algorithm_impl.h"
+#include "starboard/shared/starboard/player/filter/video_renderer_sink.h"
+
+namespace starboard {
+namespace shared {
+namespace starboard {
+namespace player {
+namespace filter {
+
+namespace {
+
+class PlayerComponentsFactory : public PlayerComponents::Factory {
+  bool CreateSubComponents(
+      const CreationParameters& creation_parameters,
+      scoped_ptr<AudioDecoder>* audio_decoder,
+      scoped_ptr<AudioRendererSink>* audio_renderer_sink,
+      scoped_ptr<VideoDecoder>* video_decoder,
+      scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
+      scoped_refptr<VideoRendererSink>* video_renderer_sink,
+      std::string* error_message) override {
+    SB_DCHECK(error_message);
+
+    if (creation_parameters.audio_codec() != kSbMediaAudioCodecNone) {
+      SB_DCHECK(audio_decoder);
+      SB_DCHECK(audio_renderer_sink);
+
+      auto decoder_creator = [](const SbMediaAudioSampleInfo& audio_sample_info,
+                                SbDrmSystem drm_system) {
+        typedef ::starboard::shared::ffmpeg::AudioDecoder AudioDecoderImpl;
+
+        scoped_ptr<AudioDecoderImpl> audio_decoder_impl(
+            AudioDecoderImpl::Create(audio_sample_info.codec,
+                                     audio_sample_info));
+        if (audio_decoder_impl && audio_decoder_impl->is_valid()) {
+          return audio_decoder_impl.PassAs<AudioDecoder>();
+        }
+        return scoped_ptr<AudioDecoder>();
+      };
+
+      audio_decoder->reset(new AdaptiveAudioDecoder(
+          creation_parameters.audio_sample_info(),
+          creation_parameters.drm_system(), decoder_creator));
+      audio_renderer_sink->reset(new AudioRendererSinkImpl);
+    }
+
+    if (creation_parameters.video_codec() != kSbMediaVideoCodecNone) {
+      using VideoDecoderImpl =
+          ::starboard::raspi::shared::open_max::VideoDecoder;
+      using ::starboard::raspi::shared::VideoRendererSinkImpl;
+
+      SB_DCHECK(video_decoder);
+      SB_DCHECK(video_render_algorithm);
+      SB_DCHECK(video_renderer_sink);
+
+      video_decoder->reset(
+          new VideoDecoderImpl(creation_parameters.video_codec()));
+      video_render_algorithm->reset(new VideoRenderAlgorithmImpl);
+      *video_renderer_sink =
+          new VideoRendererSinkImpl(creation_parameters.player());
+    }
+
+    return true;
+  }
+};
+
+}  // namespace
+
+// static
+scoped_ptr<PlayerComponents::Factory> PlayerComponents::Factory::Create() {
+  return make_scoped_ptr<PlayerComponents::Factory>(
+      new PlayerComponentsFactory);
+}
+
+// static
+bool VideoDecoder::OutputModeSupported(SbPlayerOutputMode output_mode,
+                                       SbMediaVideoCodec codec,
+                                       SbDrmSystem drm_system) {
+  return output_mode == kSbPlayerOutputModePunchOut;
+}
+
+}  // namespace filter
+}  // namespace player
+}  // namespace starboard
+}  // namespace shared
+}  // namespace starboard
diff --git a/src/starboard/raspi/shared/player_components_impl.cc b/src/starboard/raspi/shared/player_components_impl.cc
deleted file mode 100644
index fa61dd7..0000000
--- a/src/starboard/raspi/shared/player_components_impl.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright 2017 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "starboard/shared/starboard/player/filter/player_components.h"
-
-#include "starboard/common/ref_counted.h"
-#include "starboard/common/scoped_ptr.h"
-#include "starboard/raspi/shared/open_max/video_decoder.h"
-#include "starboard/raspi/shared/video_renderer_sink_impl.h"
-#include "starboard/shared/ffmpeg/ffmpeg_audio_decoder.h"
-#include "starboard/shared/starboard/player/filter/adaptive_audio_decoder_internal.h"
-#include "starboard/shared/starboard/player/filter/audio_decoder_internal.h"
-#include "starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h"
-#include "starboard/shared/starboard/player/filter/video_decoder_internal.h"
-#include "starboard/shared/starboard/player/filter/video_render_algorithm.h"
-#include "starboard/shared/starboard/player/filter/video_render_algorithm_impl.h"
-#include "starboard/shared/starboard/player/filter/video_renderer_sink.h"
-
-namespace starboard {
-namespace shared {
-namespace starboard {
-namespace player {
-namespace filter {
-
-namespace {
-
-class PlayerComponentsImpl : public PlayerComponents {
-  bool CreateAudioComponents(const AudioParameters& audio_parameters,
-                             scoped_ptr<AudioDecoder>* audio_decoder,
-                             scoped_ptr<AudioRendererSink>* audio_renderer_sink,
-                             std::string* error_message) override {
-    SB_DCHECK(audio_decoder);
-    SB_DCHECK(audio_renderer_sink);
-    SB_DCHECK(error_message);
-
-    auto decoder_creator = [](const SbMediaAudioSampleInfo& audio_sample_info,
-                              SbDrmSystem drm_system) {
-      typedef ::starboard::shared::ffmpeg::AudioDecoder AudioDecoderImpl;
-
-      scoped_ptr<AudioDecoderImpl> audio_decoder_impl(
-          AudioDecoderImpl::Create(audio_sample_info.codec, audio_sample_info));
-      if (audio_decoder_impl && audio_decoder_impl->is_valid()) {
-        return audio_decoder_impl.PassAs<AudioDecoder>();
-      }
-      return scoped_ptr<AudioDecoder>();
-    };
-
-    audio_decoder->reset(
-        new AdaptiveAudioDecoder(audio_parameters.audio_sample_info,
-                                 audio_parameters.drm_system, decoder_creator));
-    audio_renderer_sink->reset(new AudioRendererSinkImpl);
-    return true;
-  }
-
-  bool CreateVideoComponents(
-      const VideoParameters& video_parameters,
-      scoped_ptr<VideoDecoder>* video_decoder,
-      scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
-      scoped_refptr<VideoRendererSink>* video_renderer_sink,
-      std::string* error_message) override {
-    using VideoDecoderImpl = ::starboard::raspi::shared::open_max::VideoDecoder;
-    using ::starboard::raspi::shared::VideoRendererSinkImpl;
-
-    SB_DCHECK(video_decoder);
-    SB_DCHECK(video_render_algorithm);
-    SB_DCHECK(video_renderer_sink);
-    SB_DCHECK(error_message);
-
-    video_decoder->reset(new VideoDecoderImpl(video_parameters.video_codec));
-    video_render_algorithm->reset(new VideoRenderAlgorithmImpl);
-    *video_renderer_sink = new VideoRendererSinkImpl(video_parameters.player);
-    return true;
-  }
-};
-
-}  // namespace
-
-// static
-scoped_ptr<PlayerComponents> PlayerComponents::Create() {
-  return make_scoped_ptr<PlayerComponents>(new PlayerComponentsImpl);
-}
-
-// static
-bool VideoDecoder::OutputModeSupported(SbPlayerOutputMode output_mode,
-                                       SbMediaVideoCodec codec,
-                                       SbDrmSystem drm_system) {
-  return output_mode == kSbPlayerOutputModePunchOut;
-}
-
-}  // namespace filter
-}  // namespace player
-}  // namespace starboard
-}  // namespace shared
-}  // namespace starboard
diff --git a/src/starboard/raspi/shared/starboard_platform.gypi b/src/starboard/raspi/shared/starboard_platform.gypi
index 8b3a089..1c87463 100644
--- a/src/starboard/raspi/shared/starboard_platform.gypi
+++ b/src/starboard/raspi/shared/starboard_platform.gypi
@@ -72,7 +72,7 @@
         '<(DEPTH)/starboard/raspi/shared/open_max/open_max_video_decode_component.h',
         '<(DEPTH)/starboard/raspi/shared/open_max/video_decoder.cc',
         '<(DEPTH)/starboard/raspi/shared/open_max/video_decoder.h',
-        '<(DEPTH)/starboard/raspi/shared/player_components_impl.cc',
+        '<(DEPTH)/starboard/raspi/shared/player_components_factory.cc',
         '<(DEPTH)/starboard/raspi/shared/system_get_device_type.cc',
         '<(DEPTH)/starboard/raspi/shared/system_get_property.cc',
         '<(DEPTH)/starboard/raspi/shared/system_gles2.cc',
diff --git a/src/starboard/sabi/arm/hardfp/sabi.json b/src/starboard/sabi/arm/hardfp/sabi.json
index d65b551..3aa03da 100644
--- a/src/starboard/sabi/arm/hardfp/sabi.json
+++ b/src/starboard/sabi/arm/hardfp/sabi.json
@@ -19,8 +19,8 @@
     "alignment_pointer": 4,
     "alignment_short":   2,
     "size_of_char":    1,
-    "size_of_enum":    4,
     "size_of_double":  8,
+    "size_of_enum":    4,
     "size_of_float":   4,
     "size_of_int":     4,
     "size_of_llong":   8,
diff --git a/src/starboard/sabi/arm/hardfp/v6zk/sabi.json b/src/starboard/sabi/arm/hardfp/v6zk/sabi.json
index 4502f3f..3d7ac2a 100644
--- a/src/starboard/sabi/arm/hardfp/v6zk/sabi.json
+++ b/src/starboard/sabi/arm/hardfp/v6zk/sabi.json
@@ -19,8 +19,8 @@
     "alignment_pointer": 4,
     "alignment_short":   2,
     "size_of_char":    1,
-    "size_of_enum":    4,
     "size_of_double":  8,
+    "size_of_enum":    4,
     "size_of_float":   4,
     "size_of_int":     4,
     "size_of_llong":   8,
diff --git a/src/starboard/sabi/arm/softfp/sabi.json b/src/starboard/sabi/arm/softfp/sabi.json
index ce2b3de..68fbbd3 100644
--- a/src/starboard/sabi/arm/softfp/sabi.json
+++ b/src/starboard/sabi/arm/softfp/sabi.json
@@ -19,8 +19,8 @@
     "alignment_pointer": 4,
     "alignment_short":   2,
     "size_of_char":    1,
-    "size_of_enum":    4,
     "size_of_double":  8,
+    "size_of_enum":    4,
     "size_of_float":   4,
     "size_of_int":     4,
     "size_of_llong":   8,
diff --git a/src/starboard/sabi/arm64/sabi.json b/src/starboard/sabi/arm64/sabi.json
index 09cb005..9f77065 100644
--- a/src/starboard/sabi/arm64/sabi.json
+++ b/src/starboard/sabi/arm64/sabi.json
@@ -19,8 +19,8 @@
     "alignment_pointer": 8,
     "alignment_short":   2,
     "size_of_char":    1,
-    "size_of_enum":    4,
     "size_of_double":  8,
+    "size_of_enum":    4,
     "size_of_float":   4,
     "size_of_int":     4,
     "size_of_llong":   8,
diff --git a/src/starboard/sabi/ia32/sabi.json b/src/starboard/sabi/ia32/sabi.json
index 3638ec1..7d94ab6 100644
--- a/src/starboard/sabi/ia32/sabi.json
+++ b/src/starboard/sabi/ia32/sabi.json
@@ -19,8 +19,8 @@
     "alignment_pointer": 4,
     "alignment_short":   2,
     "size_of_char":    1,
-    "size_of_enum":    4,
     "size_of_double":  8,
+    "size_of_enum":    4,
     "size_of_float":   4,
     "size_of_int":     4,
     "size_of_llong":   8,
diff --git a/src/starboard/sabi/x64/sysv/sabi.json b/src/starboard/sabi/x64/sysv/sabi.json
index 9b197cd..b727171 100644
--- a/src/starboard/sabi/x64/sysv/sabi.json
+++ b/src/starboard/sabi/x64/sysv/sabi.json
@@ -19,8 +19,8 @@
     "alignment_pointer": 8,
     "alignment_short":   2,
     "size_of_char":    1,
-    "size_of_enum":    4,
     "size_of_double":  8,
+    "size_of_enum":    4,
     "size_of_float":   4,
     "size_of_int":     4,
     "size_of_llong":   8,
diff --git a/src/starboard/shared/ffmpeg/ffmpeg_dynamic_load_dispatch_impl.cc b/src/starboard/shared/ffmpeg/ffmpeg_dynamic_load_dispatch_impl.cc
index 69ddd5b..12bedd9 100644
--- a/src/starboard/shared/ffmpeg/ffmpeg_dynamic_load_dispatch_impl.cc
+++ b/src/starboard/shared/ffmpeg/ffmpeg_dynamic_load_dispatch_impl.cc
@@ -160,6 +160,23 @@
 }
 
 bool FFMPEGDispatchImpl::OpenLibraries() {
+  // Helper lambda to ensure all av libraries are closed and reset.
+  const auto reset_av_libraries = [this]() {
+    if (avformat_) {
+      dlclose(avformat_);
+      avformat_ = NULL;
+    }
+    if (avcodec_) {
+      dlclose(avcodec_);
+      avcodec_ = NULL;
+    }
+    if (avutil_) {
+      dlclose(avutil_);
+      avutil_ = NULL;
+    }
+    SB_DCHECK(!is_valid());
+  };
+
   for (auto version_iterator = versions_.rbegin();
        version_iterator != versions_.rend(); ++version_iterator) {
     LibraryMajorVersions& versions = version_iterator->second;
@@ -168,6 +185,7 @@
     avutil_ = dlopen(library_file.c_str(), RTLD_NOW | RTLD_GLOBAL);
     if (!avutil_) {
       SB_DLOG(WARNING) << "Unable to open shared library " << library_file;
+      reset_av_libraries();
       continue;
     }
 
@@ -176,8 +194,7 @@
     avcodec_ = dlopen(library_file.c_str(), RTLD_NOW | RTLD_GLOBAL);
     if (!avcodec_) {
       SB_DLOG(WARNING) << "Unable to open shared library " << library_file;
-      dlclose(avutil_);
-      avutil_ = NULL;
+      reset_av_libraries();
       continue;
     }
 
@@ -186,46 +203,48 @@
     avformat_ = dlopen(library_file.c_str(), RTLD_NOW | RTLD_GLOBAL);
     if (!avformat_) {
       SB_DLOG(WARNING) << "Unable to open shared library " << library_file;
-      dlclose(avcodec_);
-      avcodec_ = NULL;
-      dlclose(avutil_);
-      avutil_ = NULL;
+      reset_av_libraries();
       continue;
     }
     SB_DCHECK(is_valid());
     break;
   }
-  if (!is_valid()) {
-    // Attempt to load the libraries without a version number.
-    // This allows loading of the libraries on machines where a versioned and
-    // supported library is not available. Additionally, if this results in a
-    // library version being loaded that is not supported, then the decoder
-    // instantiation can output a more informative log message.
-    avutil_ = dlopen(kAVUtilLibraryName, RTLD_NOW | RTLD_GLOBAL);
-    if (!avutil_) {
-      SB_DLOG(WARNING) << "Unable to open shared library "
-                       << kAVUtilLibraryName;
-    }
 
-    avcodec_ = dlopen(kAVCodecLibraryName, RTLD_NOW | RTLD_GLOBAL);
-    if (!avcodec_) {
-      SB_DLOG(WARNING) << "Unable to open shared library "
-                       << kAVCodecLibraryName;
-      dlclose(avutil_);
-      avutil_ = NULL;
-    }
-
-    avformat_ = dlopen(kAVFormatLibraryName, RTLD_NOW | RTLD_GLOBAL);
-    if (!avformat_) {
-      SB_DLOG(WARNING) << "Unable to open shared library "
-                       << kAVFormatLibraryName;
-      dlclose(avcodec_);
-      avcodec_ = NULL;
-      dlclose(avutil_);
-      avutil_ = NULL;
-    }
+  if (is_valid()) {
+    return true;
   }
-  return is_valid();
+
+  SB_LOG(WARNING) << "Failed to load FFMPEG libs with specified versions. "
+                  << "Trying to load FFMPEG libs without version numbers.";
+  // Attempt to load the libraries without a version number.
+  // This allows loading of the libraries on machines where a versioned and
+  // supported library is not available. Additionally, if this results in a
+  // library version being loaded that is not supported, then the decoder
+  // instantiation can output a more informative log message.
+  avutil_ = dlopen(kAVUtilLibraryName, RTLD_NOW | RTLD_GLOBAL);
+  if (!avutil_) {
+    SB_DLOG(WARNING) << "Unable to open shared library " << kAVUtilLibraryName;
+    reset_av_libraries();
+    return false;
+  }
+
+  avcodec_ = dlopen(kAVCodecLibraryName, RTLD_NOW | RTLD_GLOBAL);
+  if (!avcodec_) {
+    SB_DLOG(WARNING) << "Unable to open shared library " << kAVCodecLibraryName;
+    reset_av_libraries();
+    return false;
+  }
+
+  avformat_ = dlopen(kAVFormatLibraryName, RTLD_NOW | RTLD_GLOBAL);
+  if (!avformat_) {
+    SB_DLOG(WARNING) << "Unable to open shared library "
+                     << kAVFormatLibraryName;
+    reset_av_libraries();
+    return false;
+  }
+
+  SB_DCHECK(is_valid());
+  return true;
 }
 
 void FFMPEGDispatchImpl::LoadSymbols() {
diff --git a/src/starboard/shared/pthread/mutex_acquire.cc b/src/starboard/shared/pthread/mutex_acquire.cc
index cd40382..e683732 100644
--- a/src/starboard/shared/pthread/mutex_acquire.cc
+++ b/src/starboard/shared/pthread/mutex_acquire.cc
@@ -16,6 +16,7 @@
 
 #include <pthread.h>
 
+#include "starboard/common/experimental/concurrency_debug.h"
 #include "starboard/shared/pthread/is_success.h"
 
 SbMutexResult SbMutexAcquire(SbMutex* mutex) {
@@ -23,6 +24,13 @@
     return kSbMutexDestroyed;
   }
 
+#if SB_ENABLE_CONCURRENTY_DEBUG
+  starboard::experimental::ScopedMutexWaitTracker tracker(mutex);
+  if (tracker.acquired()) {
+    return kSbMutexAcquired;
+  }
+#endif  // SB_ENABLE_CONCURRENTY_DEBUG
+
   int result = pthread_mutex_lock(mutex);
   if (IsSuccess(result)) {
     return kSbMutexAcquired;
diff --git a/src/starboard/shared/starboard/player/filter/audio_renderer_internal.cc b/src/starboard/shared/starboard/player/filter/audio_renderer_internal.cc
index 7e66ed3..2de7ec5 100644
--- a/src/starboard/shared/starboard/player/filter/audio_renderer_internal.cc
+++ b/src/starboard/shared/starboard/player/filter/audio_renderer_internal.cc
@@ -104,6 +104,24 @@
   SB_DCHECK(BelongsToCurrentThread());
 }
 
+void AudioRenderer::Initialize(const ErrorCB& error_cb,
+                               const PrerolledCB& prerolled_cb,
+                               const EndedCB& ended_cb) {
+  SB_DCHECK(error_cb);
+  SB_DCHECK(prerolled_cb);
+  SB_DCHECK(ended_cb);
+  SB_DCHECK(!error_cb_);
+  SB_DCHECK(!prerolled_cb_);
+  SB_DCHECK(!ended_cb_);
+
+  error_cb_ = error_cb;
+  prerolled_cb_ = prerolled_cb;
+  ended_cb_ = ended_cb;
+
+  decoder_->Initialize(std::bind(&AudioRenderer::OnDecoderOutput, this),
+                       error_cb);
+}
+
 void AudioRenderer::WriteSample(
     const scoped_refptr<InputBuffer>& input_buffer) {
   SB_DCHECK(BelongsToCurrentThread());
@@ -163,29 +181,6 @@
          (!decoder_sample_rate_ || !time_stretcher_.IsQueueFull());
 }
 
-bool AudioRenderer::IsSeekingInProgress() const {
-  SB_DCHECK(BelongsToCurrentThread());
-  return seeking_;
-}
-
-void AudioRenderer::Initialize(const ErrorCB& error_cb,
-                               const PrerolledCB& prerolled_cb,
-                               const EndedCB& ended_cb) {
-  SB_DCHECK(error_cb);
-  SB_DCHECK(prerolled_cb);
-  SB_DCHECK(ended_cb);
-  SB_DCHECK(!error_cb_);
-  SB_DCHECK(!prerolled_cb_);
-  SB_DCHECK(!ended_cb_);
-
-  error_cb_ = error_cb;
-  prerolled_cb_ = prerolled_cb;
-  ended_cb_ = ended_cb;
-
-  decoder_->Initialize(std::bind(&AudioRenderer::OnDecoderOutput, this),
-                       error_cb);
-}
-
 void AudioRenderer::Play() {
   SB_DCHECK(BelongsToCurrentThread());
 
diff --git a/src/starboard/shared/starboard/player/filter/audio_renderer_internal.h b/src/starboard/shared/starboard/player/filter/audio_renderer_internal.h
index 2f85ee7..41940ee 100644
--- a/src/starboard/shared/starboard/player/filter/audio_renderer_internal.h
+++ b/src/starboard/shared/starboard/player/filter/audio_renderer_internal.h
@@ -70,6 +70,9 @@
                 int min_frames_per_append);
   ~AudioRenderer();
 
+  void Initialize(const ErrorCB& error_cb,
+                  const PrerolledCB& prerolled_cb,
+                  const EndedCB& ended_cb);
   void WriteSample(const scoped_refptr<InputBuffer>& input_buffer);
   void WriteEndOfStream();
 
@@ -79,13 +82,8 @@
   bool IsEndOfStreamWritten() const;
   bool IsEndOfStreamPlayed() const;
   bool CanAcceptMoreData() const;
-  // TODO: Remove the following function and its tests.
-  bool IsSeekingInProgress() const;
 
   // MediaTimeProvider methods
-  void Initialize(const ErrorCB& error_cb,
-                  const PrerolledCB& prerolled_cb,
-                  const EndedCB& ended_cb) override;
   void Play() override;
   void Pause() override;
   void SetPlaybackRate(double playback_rate) override;
diff --git a/src/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.cc b/src/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.cc
index a9dfdc1..e9f5ad9 100644
--- a/src/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.cc
+++ b/src/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.cc
@@ -22,7 +22,6 @@
 #include "starboard/shared/starboard/application.h"
 #include "starboard/shared/starboard/drm/drm_system_internal.h"
 #include "starboard/shared/starboard/player/filter/audio_decoder_internal.h"
-#include "starboard/shared/starboard/player/filter/player_components.h"
 #include "starboard/shared/starboard/player/filter/video_decoder_internal.h"
 #include "starboard/shared/starboard/player/input_buffer_internal.h"
 #include "starboard/time.h"
@@ -35,21 +34,12 @@
 
 namespace {
 
-typedef MediaTimeProviderImpl::MonotonicSystemTimeProvider
-    MonotonicSystemTimeProvider;
-
 using std::placeholders::_1;
 using std::placeholders::_2;
 
 // TODO: Make this configurable inside SbPlayerCreate().
 const SbTimeMonotonic kUpdateInterval = 200 * kSbTimeMillisecond;
 
-class MonotonicSystemTimeProviderImpl : public MonotonicSystemTimeProvider {
-  SbTimeMonotonic GetMonotonicNow() const override {
-    return SbTimeGetMonotonicNow();
-  }
-};
-
 #if defined(COBALT_BUILD_TYPE_GOLD)
 
 void DumpInputHash(const InputBuffer* input_buffer) {}
@@ -77,6 +67,36 @@
 
 }  // namespace
 
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+FilterBasedPlayerWorkerHandler::FilterBasedPlayerWorkerHandler(
+    const SbPlayerCreationParam* creation_param,
+    SbDecodeTargetGraphicsContextProvider* provider)
+    : JobOwner(kDetached),
+      video_codec_(creation_param->video_sample_info.codec),
+      audio_codec_(creation_param->audio_sample_info.codec),
+      drm_system_(creation_param->drm_system),
+      output_mode_(creation_param->output_mode),
+      decode_target_graphics_context_provider_(provider),
+      audio_mime_(creation_param->audio_mime),
+      video_mime_(creation_param->video_mime),
+      max_video_capabilities_(creation_param->max_video_capabilities),
+      video_sample_info_(creation_param->video_sample_info) {
+  if (audio_codec_ != kSbMediaAudioCodecNone) {
+    audio_sample_info_ = creation_param->audio_sample_info;
+
+    if (audio_sample_info_.audio_specific_config_size > 0) {
+      audio_specific_config_.reset(
+          new int8_t[audio_sample_info_.audio_specific_config_size]);
+      SbMemoryCopy(audio_specific_config_.get(),
+                   audio_sample_info_.audio_specific_config,
+                   audio_sample_info_.audio_specific_config_size);
+      audio_sample_info_.audio_specific_config = audio_specific_config_.get();
+    }
+  }
+
+  update_job_ = std::bind(&FilterBasedPlayerWorkerHandler::Update, this);
+}
+#else   // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
 FilterBasedPlayerWorkerHandler::FilterBasedPlayerWorkerHandler(
     SbMediaVideoCodec video_codec,
     SbMediaAudioCodec audio_codec,
@@ -104,8 +124,8 @@
   }
 
   update_job_ = std::bind(&FilterBasedPlayerWorkerHandler::Update, this);
-  bounds_ = PlayerWorker::Bounds();
 }
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
 
 bool FilterBasedPlayerWorkerHandler::IsPunchoutMode() const {
   return (output_mode_ == kSbPlayerOutputModePunchOut);
@@ -140,8 +160,9 @@
   SB_DCHECK(!update_player_error_cb);
 #endif  // SB_HAS(PLAYER_ERROR_MESSAGE)
 
-  scoped_ptr<PlayerComponents> player_components = PlayerComponents::Create();
-  SB_DCHECK(player_components);
+  scoped_ptr<PlayerComponents::Factory> factory =
+      PlayerComponents::Factory::Create();
+  SB_DCHECK(factory);
 
   if (audio_codec_ != kSbMediaAudioCodecNone) {
     // TODO: This is not ideal as we should really handle the creation failure
@@ -158,17 +179,38 @@
                        required_audio_channels, supported_audio_channels);
       return false;
     }
+  }
 
-    PlayerComponents::AudioParameters audio_parameters = {
-        audio_codec_, audio_sample_info_, drm_system_};
+  PlayerComponents::Factory::CreationParameters creation_parameters(
+      audio_codec_, audio_mime_, audio_sample_info_, video_codec_, video_mime_,
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+      video_sample_info_,
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+      max_video_capabilities_, player_, output_mode_,
+      decode_target_graphics_context_provider_, drm_system_);
 
-    audio_renderer_ =
-        player_components->CreateAudioRenderer(audio_parameters, error_message);
-    if (!audio_renderer_) {
-      SB_DLOG(ERROR) << "Failed to create audio renderer with error: "
-                     << *error_message;
+  {
+    ::starboard::ScopedLock lock(player_components_existence_mutex_);
+    player_components_ =
+        factory->CreateComponents(creation_parameters, error_message);
+    if (!player_components_) {
+      SB_LOG(ERROR) << "Failed to create renderer with error: "
+                    << *error_message;
       return false;
     }
+    media_time_provider_ = player_components_->GetMediaTimeProvider();
+    audio_renderer_ = player_components_->GetAudioRenderer();
+    video_renderer_ = player_components_->GetVideoRenderer();
+  }
+  if (audio_codec_ != kSbMediaAudioCodecNone) {
+    SB_DCHECK(audio_renderer_);
+  }
+  if (video_codec_ != kSbMediaVideoCodecNone) {
+    SB_DCHECK(video_renderer_);
+  }
+  SB_DCHECK(media_time_provider_);
+
+  if (audio_renderer_) {
     audio_renderer_->Initialize(
 #if SB_HAS(PLAYER_ERROR_MESSAGE)
         std::bind(&FilterBasedPlayerWorkerHandler::OnError, this, _1, _2),
@@ -179,42 +221,10 @@
                   kSbMediaTypeAudio),
         std::bind(&FilterBasedPlayerWorkerHandler::OnEnded, this,
                   kSbMediaTypeAudio));
-    audio_renderer_->SetPlaybackRate(playback_rate_);
     audio_renderer_->SetVolume(volume_);
-  } else {
-    media_time_provider_impl_.reset(
-        new MediaTimeProviderImpl(scoped_ptr<MonotonicSystemTimeProvider>(
-            new MonotonicSystemTimeProviderImpl)));
-    media_time_provider_impl_->Initialize(
-#if SB_HAS(PLAYER_ERROR_MESSAGE)
-        std::bind(&FilterBasedPlayerWorkerHandler::OnError, this, _1, _2),
-#else   // SB_HAS(PLAYER_ERROR_MESSAGE)
-        std::bind(&FilterBasedPlayerWorkerHandler::OnError, this),
-#endif  // SB_HAS(PLAYER_ERROR_MESSAGE)
-        std::bind(&FilterBasedPlayerWorkerHandler::OnPrerolled, this,
-                  kSbMediaTypeAudio),
-        std::bind(&FilterBasedPlayerWorkerHandler::OnEnded, this,
-                  kSbMediaTypeAudio));
-    media_time_provider_impl_->SetPlaybackRate(playback_rate_);
   }
-
-  if (video_codec_ != kSbMediaVideoCodecNone) {
-    PlayerComponents::VideoParameters video_parameters = {
-        player_, video_codec_, drm_system_, output_mode_,
-        decode_target_graphics_context_provider_};
-
-    ::starboard::ScopedLock lock(video_renderer_existence_mutex_);
-
-    auto media_time_provider = GetMediaTimeProvider();
-    SB_DCHECK(media_time_provider);
-
-    video_renderer_ = player_components->CreateVideoRenderer(
-        video_parameters, media_time_provider, error_message);
-    if (!video_renderer_) {
-      SB_DLOG(ERROR) << "Failed to create video renderer with error: "
-                     << *error_message;
-      return false;
-    }
+  media_time_provider_->SetPlaybackRate(playback_rate_);
+  if (video_renderer_) {
     video_renderer_->Initialize(
 #if SB_HAS(PLAYER_ERROR_MESSAGE)
         std::bind(&FilterBasedPlayerWorkerHandler::OnError, this, _1, _2),
@@ -236,7 +246,7 @@
   SB_UNREFERENCED_PARAMETER(ticket);
   SB_DCHECK(BelongsToCurrentThread());
 
-  if (!GetMediaTimeProvider()) {
+  if (!media_time_provider_) {
     return false;
   }
 
@@ -245,11 +255,11 @@
     seek_to_time = 0;
   }
 
-  GetMediaTimeProvider()->Pause();
+  media_time_provider_->Pause();
   if (video_renderer_) {
     video_renderer_->Seek(seek_to_time);
   }
-  GetMediaTimeProvider()->Seek(seek_to_time);
+  media_time_provider_->Seek(seek_to_time);
   audio_prerolled_ = false;
   video_prerolled_ = false;
   return true;
@@ -328,10 +338,6 @@
           return false;
         }
       }
-      if (media_time_provider_impl_) {
-        media_time_provider_impl_->UpdateVideoDuration(
-            input_buffer->timestamp());
-      }
       DumpInputHash(input_buffer);
       video_renderer_->WriteSample(input_buffer);
     }
@@ -361,9 +367,6 @@
       SB_LOG(WARNING) << "Try to write video EOS after EOS is enqueued";
     } else {
       SB_LOG(INFO) << "Video EOS enqueued";
-      if (media_time_provider_impl_) {
-        media_time_provider_impl_->VideoEndOfStreamReached();
-      }
       video_renderer_->WriteEndOfStream();
     }
   }
@@ -374,17 +377,17 @@
 bool FilterBasedPlayerWorkerHandler::SetPause(bool pause) {
   SB_DCHECK(BelongsToCurrentThread());
 
-  if (!GetMediaTimeProvider()) {
+  if (!media_time_provider_) {
     return false;
   }
 
   paused_ = pause;
 
   if (pause) {
-    GetMediaTimeProvider()->Pause();
+    media_time_provider_->Pause();
     SB_DLOG(INFO) << "Playback paused.";
   } else {
-    GetMediaTimeProvider()->Play();
+    media_time_provider_->Play();
     SB_DLOG(INFO) << "Playback started.";
   }
 
@@ -396,11 +399,11 @@
 
   playback_rate_ = playback_rate;
 
-  if (!GetMediaTimeProvider()) {
+  if (!media_time_provider_) {
     return false;
   }
 
-  GetMediaTimeProvider()->SetPlaybackRate(playback_rate_);
+  media_time_provider_->SetPlaybackRate(playback_rate_);
   return true;
 }
 
@@ -468,10 +471,11 @@
   audio_prerolled_ |= media_type == kSbMediaTypeAudio;
   video_prerolled_ |= media_type == kSbMediaTypeVideo;
 
-  if (audio_prerolled_ && (!video_renderer_ || video_prerolled_)) {
+  if ((!audio_renderer_ || audio_prerolled_) &&
+      (!video_renderer_ || video_prerolled_)) {
     update_player_state_cb_(kSbPlayerStatePresenting);
     if (!paused_) {
-      GetMediaTimeProvider()->Play();
+      media_time_provider_->Play();
     }
   }
 }
@@ -482,10 +486,12 @@
         std::bind(&FilterBasedPlayerWorkerHandler::OnEnded, this, media_type));
     return;
   }
+
   audio_ended_ |= media_type == kSbMediaTypeAudio;
   video_ended_ |= media_type == kSbMediaTypeVideo;
 
-  if (audio_ended_ && (!video_renderer_ || video_ended_)) {
+  if ((!audio_renderer_ || audio_ended_) &&
+      (!video_renderer_ || video_ended_)) {
     update_player_state_cb_(kSbPlayerStateEndOfStream);
   }
 }
@@ -493,7 +499,7 @@
 void FilterBasedPlayerWorkerHandler::Update() {
   SB_DCHECK(BelongsToCurrentThread());
 
-  if (!GetMediaTimeProvider()) {
+  if (!media_time_provider_) {
     return;
   }
 
@@ -505,7 +511,7 @@
     bool is_playing;
     bool is_eos_played;
     bool is_underflow;
-    auto media_time = GetMediaTimeProvider()->GetCurrentMediaTime(
+    auto media_time = media_time_provider_->GetCurrentMediaTime(
         &is_playing, &is_eos_played, &is_underflow);
     update_media_info_cb_(media_time, dropped_frames, is_underflow);
   }
@@ -518,39 +524,32 @@
 
   RemoveJobByToken(update_job_token_);
 
-  scoped_ptr<VideoRenderer> video_renderer;
+  scoped_ptr<PlayerComponents> player_components;
   {
-    // Set |video_renderer_| to null with the lock, but we actually destroy
+    // Set |player_components_| to null with the lock, but we actually destroy
     // it outside of the lock.  This is because the VideoRenderer destructor
     // may post a task to destroy the SbDecodeTarget to the same thread that
     // might call GetCurrentDecodeTarget(), which would try to take this lock.
-    ::starboard::ScopedLock lock(video_renderer_existence_mutex_);
-    video_renderer = video_renderer_.Pass();
+    ::starboard::ScopedLock lock(player_components_existence_mutex_);
+    player_components = player_components_.Pass();
+    media_time_provider_ = nullptr;
+    audio_renderer_ = nullptr;
+    video_renderer_ = nullptr;
   }
-  video_renderer.reset();
-  audio_renderer_.reset();
-  media_time_provider_impl_.reset();
+  player_components.reset();
 }
 
 SbDecodeTarget FilterBasedPlayerWorkerHandler::GetCurrentDecodeTarget() {
   SbDecodeTarget decode_target = kSbDecodeTargetInvalid;
-  if (video_renderer_existence_mutex_.AcquireTry()) {
+  if (player_components_existence_mutex_.AcquireTry()) {
     if (video_renderer_) {
       decode_target = video_renderer_->GetCurrentDecodeTarget();
     }
-    video_renderer_existence_mutex_.Release();
+    player_components_existence_mutex_.Release();
   }
   return decode_target;
 }
 
-MediaTimeProvider* FilterBasedPlayerWorkerHandler::GetMediaTimeProvider()
-    const {
-  if (audio_renderer_) {
-    return audio_renderer_.get();
-  }
-  return media_time_provider_impl_.get();
-}
-
 }  // namespace filter
 }  // namespace player
 }  // namespace starboard
diff --git a/src/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.h b/src/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.h
index 20d7e39..cc263b3 100644
--- a/src/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.h
+++ b/src/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.h
@@ -26,7 +26,7 @@
 #include "starboard/shared/internal_only.h"
 #include "starboard/shared/starboard/player/filter/audio_renderer_internal.h"
 #include "starboard/shared/starboard/player/filter/media_time_provider.h"
-#include "starboard/shared/starboard/player/filter/media_time_provider_impl.h"
+#include "starboard/shared/starboard/player/filter/player_components.h"
 #include "starboard/shared/starboard/player/filter/video_renderer_internal.h"
 #include "starboard/shared/starboard/player/input_buffer_internal.h"
 #include "starboard/shared/starboard/player/job_queue.h"
@@ -42,6 +42,11 @@
 class FilterBasedPlayerWorkerHandler : public PlayerWorker::Handler,
                                        private JobQueue::JobOwner {
  public:
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+  FilterBasedPlayerWorkerHandler(
+      const SbPlayerCreationParam* creation_param,
+      SbDecodeTargetGraphicsContextProvider* provider);
+#else   // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
   FilterBasedPlayerWorkerHandler(
       SbMediaVideoCodec video_codec,
       SbMediaAudioCodec audio_codec,
@@ -49,6 +54,7 @@
       const SbMediaAudioSampleInfo* audio_sample_info,
       SbPlayerOutputMode output_mode,
       SbDecodeTargetGraphicsContextProvider* provider);
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
 
  private:
   bool IsPunchoutMode() const;
@@ -78,7 +84,6 @@
   void OnEnded(SbMediaType media_type);
 
   SbDecodeTarget GetCurrentDecodeTarget() override;
-  MediaTimeProvider* GetMediaTimeProvider() const;
 
   SbPlayer player_ = kSbPlayerInvalid;
   UpdateMediaInfoCB update_media_info_cb_;
@@ -92,19 +97,30 @@
   // Store a copy of |SbMediaAudioSampleInfo::audio_specific_config| passed to
   // the ctor so it is valid for the life time of the player worker.
   scoped_array<int8_t> audio_specific_config_;
-  SbMediaAudioSampleInfo audio_sample_info_;
+  SbMediaAudioSampleInfo audio_sample_info_ = {kSbMediaAudioCodecNone};
 
-  // |media_time_provider_impl_| is used to provide the media playback time when
-  // there is no audio track.  In such case |audio_renderer_| will be NULL.
-  // When there is an audio track, |media_time_provider_impl_| will be NULL.
-  scoped_ptr<MediaTimeProviderImpl> media_time_provider_impl_;
-  scoped_ptr<AudioRenderer> audio_renderer_;
-  scoped_ptr<VideoRenderer> video_renderer_;
+  // A mutex guarding changes to the existence (e.g. creation/destruction)
+  // of the |player_components_| object.  This is necessary because calls to
+  // GetCurrentDecodeTarget() need to be supported on arbitrary threads, and
+  // GetCurrentDecodeTarget() will call into the video renderer held by
+  // |player_components_|.  This mutex only needs to be held when any thread
+  // creates or resets |player_components_|, and when GetCurrentDecodeTarget()
+  // reads from the video renderer held by |player_components_|.  This is
+  // because GetCurrentDecodeTarget() won't modify |player_components_|, and all
+  // other accesses are happening from the same thread.
+  Mutex player_components_existence_mutex_;
+
+  scoped_ptr<PlayerComponents> player_components_;
+  // The following three variables cache the return values of member functions
+  // of |player_components_|.  Their lifetime is tied to |player_components_|.
+  MediaTimeProvider* media_time_provider_ = nullptr;
+  AudioRenderer* audio_renderer_ = nullptr;
+  VideoRenderer* video_renderer_ = nullptr;
 
   bool paused_ = false;
   double playback_rate_ = 1.0;
   double volume_ = 1.0;
-  PlayerWorker::Bounds bounds_;
+  PlayerWorker::Bounds bounds_ = {};
   JobQueue::JobToken update_job_token_;
   std::function<void()> update_job_;
 
@@ -113,19 +129,16 @@
   bool audio_ended_ = false;
   bool video_ended_ = false;
 
-  // A mutex guarding changes to the existence (e.g. creation/destruction)
-  // of the |video_renderer_| object.  This is necessary because calls to
-  // GetCurrentDecodeTarget() need to be supported on arbitrary threads, and
-  // GetCurrentDecodeTarget() will call into |video_renderer_|.  This mutex
-  // only needs to be held when any thread creates or resets |video_renderer_|,
-  // and when GetCurrentDecodeTarget() reads from it.  This is because
-  // GetCurrentDecodeTarget() won't modify |video_renderer_|, and all other
-  // accesses are happening from the same thread.
-  ::starboard::Mutex video_renderer_existence_mutex_;
-
   SbPlayerOutputMode output_mode_;
   SbDecodeTargetGraphicsContextProvider*
       decode_target_graphics_context_provider_;
+
+  std::string audio_mime_;
+  std::string video_mime_;
+  std::string max_video_capabilities_;
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+  SbMediaVideoSampleInfo video_sample_info_ = {};
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
 };
 
 }  // namespace filter
diff --git a/src/starboard/shared/starboard/player/filter/media_time_provider.h b/src/starboard/shared/starboard/player/filter/media_time_provider.h
index 4a7f1f5..92dbec5 100644
--- a/src/starboard/shared/starboard/player/filter/media_time_provider.h
+++ b/src/starboard/shared/starboard/player/filter/media_time_provider.h
@@ -27,9 +27,6 @@
 
 class MediaTimeProvider {
  public:
-  virtual void Initialize(const ErrorCB& error_cb,
-                          const PrerolledCB& prerolled_cb,
-                          const EndedCB& ended_cb) = 0;
   virtual void Play() = 0;
   virtual void Pause() = 0;
   virtual void SetPlaybackRate(double playback_rate) = 0;
diff --git a/src/starboard/shared/starboard/player/filter/media_time_provider_impl.cc b/src/starboard/shared/starboard/player/filter/media_time_provider_impl.cc
index f2c1cc4..27cc002 100644
--- a/src/starboard/shared/starboard/player/filter/media_time_provider_impl.cc
+++ b/src/starboard/shared/starboard/player/filter/media_time_provider_impl.cc
@@ -28,20 +28,6 @@
   SB_DCHECK(system_time_provider_);
 }
 
-void MediaTimeProviderImpl::Initialize(const ErrorCB& error_cb,
-                                       const PrerolledCB& prerolled_cb,
-                                       const EndedCB& ended_cb) {
-  SB_UNREFERENCED_PARAMETER(error_cb);
-  SB_DCHECK(BelongsToCurrentThread());
-  SB_DCHECK(prerolled_cb);
-  SB_DCHECK(ended_cb);
-  SB_DCHECK(!prerolled_cb_);
-  SB_DCHECK(!ended_cb_);
-
-  prerolled_cb_ = prerolled_cb;
-  ended_cb_ = ended_cb;
-}
-
 void MediaTimeProviderImpl::Play() {
   SB_DCHECK(BelongsToCurrentThread());
 
@@ -80,52 +66,31 @@
 
 void MediaTimeProviderImpl::Seek(SbTime seek_to_time) {
   SB_DCHECK(BelongsToCurrentThread());
-  SB_DCHECK(prerolled_cb_);
 
   ScopedLock scoped_lock(mutex_);
 
   seek_to_time_ = seek_to_time;
   seek_to_time_set_at_ = system_time_provider_->GetMonotonicNow();
-  video_duration_ = nullopt;
-  is_video_end_of_stream_reached_ = false;
 
+  // This is unnecessary, but left it here just in case scheduled job is added
+  // in future.
   CancelPendingJobs();
-  Schedule(prerolled_cb_);
 }
 
 SbTime MediaTimeProviderImpl::GetCurrentMediaTime(bool* is_playing,
                                                   bool* is_eos_played,
                                                   bool* is_underflow) {
-  SB_DCHECK(ended_cb_);
-
   ScopedLock scoped_lock(mutex_);
 
   SbTime current = GetCurrentMediaTime_Locked();
 
   *is_playing = is_playing_;
-  *is_eos_played =
-      is_video_end_of_stream_reached_ &&
-      (!video_duration_.has_engaged() || current >= video_duration_.value());
+  *is_eos_played = false;
   *is_underflow = false;
 
-  Schedule(ended_cb_);
   return current;
 }
 
-void MediaTimeProviderImpl::UpdateVideoDuration(
-    optional<SbTime> video_duration) {
-  ScopedLock scoped_lock(mutex_);
-  video_duration_ = video_duration;
-}
-
-void MediaTimeProviderImpl::VideoEndOfStreamReached() {
-  ScopedLock scoped_lock(mutex_);
-  is_video_end_of_stream_reached_ = true;
-  if (!video_duration_.has_engaged()) {
-    video_duration_ = seek_to_time_;
-  }
-}
-
 SbTime MediaTimeProviderImpl::GetCurrentMediaTime_Locked(
     SbTimeMonotonic* current_time /*= NULL*/) {
   mutex_.DCheckAcquired();
diff --git a/src/starboard/shared/starboard/player/filter/media_time_provider_impl.h b/src/starboard/shared/starboard/player/filter/media_time_provider_impl.h
index 3eb996d..ef4555f 100644
--- a/src/starboard/shared/starboard/player/filter/media_time_provider_impl.h
+++ b/src/starboard/shared/starboard/player/filter/media_time_provider_impl.h
@@ -43,9 +43,6 @@
   explicit MediaTimeProviderImpl(
       scoped_ptr<MonotonicSystemTimeProvider> system_time_provider);
 
-  void Initialize(const ErrorCB& error_cb,
-                  const PrerolledCB& prerolled_cb,
-                  const EndedCB& ended_cb) override;
   void Play() override;
   void Pause() override;
   void SetPlaybackRate(double playback_rate) override;
@@ -54,13 +51,6 @@
                              bool* is_eos_played,
                              bool* is_underflow) override;
 
-  // When video end of stream is reached and the current media time passes the
-  // video duration, |is_eos_played| of GetCurrentMediaTime() will return true.
-  // When VideoEndOfStreamReached() is called without any prior calls to
-  // UpdateVideoDuration(), the |seek_to_time_| will be used as video duration.
-  void UpdateVideoDuration(optional<SbTime> video_duration);
-  void VideoEndOfStreamReached();
-
  private:
   // When not NULL, |current_time| will be set to the current monotonic time
   // used to calculate the returned media time.  Note that it is possible that
@@ -70,18 +60,12 @@
 
   scoped_ptr<MonotonicSystemTimeProvider> system_time_provider_;
 
-  PrerolledCB prerolled_cb_;
-  EndedCB ended_cb_;
-
   Mutex mutex_;
 
-  double playback_rate_ = 1.0;
+  double playback_rate_ = 0.0;
   bool is_playing_ = false;
   SbTime seek_to_time_ = 0;
   SbTimeMonotonic seek_to_time_set_at_ = SbTimeGetMonotonicNow();
-
-  optional<SbTime> video_duration_;
-  bool is_video_end_of_stream_reached_ = false;
 };
 
 }  // namespace filter
diff --git a/src/starboard/shared/starboard/player/filter/player_components.cc b/src/starboard/shared/starboard/player/filter/player_components.cc
index 51b1016..9f7f080 100644
--- a/src/starboard/shared/starboard/player/filter/player_components.cc
+++ b/src/starboard/shared/starboard/player/filter/player_components.cc
@@ -14,11 +14,12 @@
 
 #include "starboard/shared/starboard/player/filter/player_components.h"
 
-#include "starboard/common/log.h"
+#include "starboard/common/scoped_ptr.h"
 #include "starboard/shared/starboard/application.h"
 #include "starboard/shared/starboard/command_line.h"
 #include "starboard/shared/starboard/player/filter/adaptive_audio_decoder_internal.h"
 #include "starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h"
+#include "starboard/shared/starboard/player/filter/media_time_provider_impl.h"
 #include "starboard/shared/starboard/player/filter/punchout_video_renderer_sink.h"
 #include "starboard/shared/starboard/player/filter/stub_audio_decoder.h"
 #include "starboard/shared/starboard/player/filter/stub_video_decoder.h"
@@ -30,70 +31,248 @@
 namespace player {
 namespace filter {
 
-scoped_ptr<AudioRenderer> PlayerComponents::CreateAudioRenderer(
-    const AudioParameters& audio_parameters,
+namespace {
+
+typedef MediaTimeProviderImpl::MonotonicSystemTimeProvider
+    MonotonicSystemTimeProvider;
+
+class MonotonicSystemTimeProviderImpl : public MonotonicSystemTimeProvider {
+  SbTimeMonotonic GetMonotonicNow() const override {
+    return SbTimeGetMonotonicNow();
+  }
+};
+
+class PlayerComponentsImpl : public PlayerComponents {
+ public:
+  PlayerComponentsImpl(scoped_ptr<MediaTimeProviderImpl> media_time_provider,
+                       scoped_ptr<AudioRenderer> audio_renderer,
+                       scoped_ptr<VideoRenderer> video_renderer)
+      : media_time_provider_(media_time_provider.Pass()),
+        audio_renderer_(audio_renderer.Pass()),
+        video_renderer_(video_renderer.Pass()) {
+    SB_DCHECK(media_time_provider_ || audio_renderer_);
+    SB_DCHECK(audio_renderer_ || video_renderer_);
+  }
+
+  MediaTimeProvider* GetMediaTimeProvider() override {
+    return audio_renderer_
+               ? static_cast<MediaTimeProvider*>(audio_renderer_.get())
+               : media_time_provider_.get();
+  }
+  AudioRenderer* GetAudioRenderer() override { return audio_renderer_.get(); }
+  VideoRenderer* GetVideoRenderer() override { return video_renderer_.get(); }
+
+ private:
+  // |media_time_provider_| will only be used when |audio_renderer_| is nullptr.
+  scoped_ptr<MediaTimeProviderImpl> media_time_provider_;
+  scoped_ptr<AudioRenderer> audio_renderer_;
+  scoped_ptr<VideoRenderer> video_renderer_;
+};
+
+}  // namespace
+
+PlayerComponents::Factory::CreationParameters::CreationParameters(
+    SbMediaAudioCodec audio_codec,
+    const std::string& audio_mime,
+    const SbMediaAudioSampleInfo& audio_sample_info,
+    SbDrmSystem drm_system)
+    : audio_codec_(audio_codec),
+      audio_mime_(audio_mime),
+      audio_sample_info_(audio_sample_info),
+      drm_system_(drm_system) {
+  SB_DCHECK(audio_codec_ != kSbMediaAudioCodecNone);
+  TryToCopyAudioSpecificConfig();
+}
+
+PlayerComponents::Factory::CreationParameters::CreationParameters(
+    SbMediaVideoCodec video_codec,
+    const std::string& video_mime,
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+    const SbMediaVideoSampleInfo& video_sample_info,
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+    const std::string& max_video_capabilities,
+    SbPlayer player,
+    SbPlayerOutputMode output_mode,
+    SbDecodeTargetGraphicsContextProvider*
+        decode_target_graphics_context_provider,
+    SbDrmSystem drm_system)
+    : video_codec_(video_codec),
+      video_mime_(video_mime),
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+      video_sample_info_(video_sample_info),
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+      max_video_capabilities_(max_video_capabilities),
+      player_(player),
+      output_mode_(output_mode),
+      decode_target_graphics_context_provider_(
+          decode_target_graphics_context_provider),
+      drm_system_(drm_system) {
+  SB_DCHECK(video_codec_ != kSbMediaVideoCodecNone);
+  SB_DCHECK(SbPlayerIsValid(player_));
+  SB_DCHECK(output_mode_ != kSbPlayerOutputModeInvalid);
+}
+
+PlayerComponents::Factory::CreationParameters::CreationParameters(
+    SbMediaAudioCodec audio_codec,
+    const std::string& audio_mime,
+    const SbMediaAudioSampleInfo& audio_sample_info,
+    SbMediaVideoCodec video_codec,
+    const std::string& video_mime,
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+    const SbMediaVideoSampleInfo& video_sample_info,
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+    const std::string& max_video_capabilities,
+    SbPlayer player,
+    SbPlayerOutputMode output_mode,
+    SbDecodeTargetGraphicsContextProvider*
+        decode_target_graphics_context_provider,
+    SbDrmSystem drm_system)
+    : audio_codec_(audio_codec),
+      audio_mime_(audio_mime),
+      audio_sample_info_(audio_sample_info),
+      video_codec_(video_codec),
+      video_mime_(video_mime),
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+      video_sample_info_(video_sample_info),
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+      max_video_capabilities_(max_video_capabilities),
+      player_(player),
+      output_mode_(output_mode),
+      decode_target_graphics_context_provider_(
+          decode_target_graphics_context_provider),
+      drm_system_(drm_system) {
+  SB_DCHECK(audio_codec_ != kSbMediaAudioCodecNone ||
+            video_codec_ != kSbMediaVideoCodecNone);
+  TryToCopyAudioSpecificConfig();
+}
+
+PlayerComponents::Factory::CreationParameters::CreationParameters(
+    const CreationParameters& that) {
+  this->audio_codec_ = that.audio_codec_;
+  this->audio_mime_ = that.audio_mime_;
+  this->audio_sample_info_ = that.audio_sample_info_;
+  this->video_codec_ = that.video_codec_;
+  this->video_mime_ = that.video_mime_;
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+  this->video_sample_info_ = that.video_sample_info_;
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+  this->max_video_capabilities_ = that.max_video_capabilities_;
+  this->player_ = that.player_;
+  this->output_mode_ = that.output_mode_;
+  this->decode_target_graphics_context_provider_ =
+      that.decode_target_graphics_context_provider_;
+  this->drm_system_ = that.drm_system_;
+
+  TryToCopyAudioSpecificConfig();
+}
+
+void PlayerComponents::Factory::CreationParameters::
+    TryToCopyAudioSpecificConfig() {
+  if (audio_sample_info_.audio_specific_config_size > 0) {
+    auto audio_specific_config = reinterpret_cast<const uint8_t*>(
+        audio_sample_info_.audio_specific_config);
+    audio_specific_config_.assign(
+        audio_specific_config,
+        audio_specific_config + audio_sample_info_.audio_specific_config_size);
+    audio_sample_info_.audio_specific_config = audio_specific_config_.data();
+  }
+}
+
+scoped_ptr<PlayerComponents> PlayerComponents::Factory::CreateComponents(
+    const CreationParameters& creation_parameters,
     std::string* error_message) {
+  SB_DCHECK(creation_parameters.audio_codec() != kSbMediaAudioCodecNone ||
+            creation_parameters.video_codec() != kSbMediaVideoCodecNone);
   SB_DCHECK(error_message);
 
   scoped_ptr<AudioDecoder> audio_decoder;
   scoped_ptr<AudioRendererSink> audio_renderer_sink;
-
-  auto command_line = shared::starboard::Application::Get()->GetCommandLine();
-  if (command_line->HasSwitch("use_stub_audio_decoder")) {
-    CreateStubAudioComponents(audio_parameters, &audio_decoder,
-                              &audio_renderer_sink);
-  } else {
-    if (!CreateAudioComponents(audio_parameters, &audio_decoder,
-                               &audio_renderer_sink, error_message)) {
-      return scoped_ptr<AudioRenderer>();
-    }
-  }
-
-  SB_DCHECK(audio_decoder);
-  SB_DCHECK(audio_renderer_sink);
-
-  int max_cached_frames, min_frames_per_append;
-  GetAudioRendererParams(audio_parameters, &max_cached_frames,
-                         &min_frames_per_append);
-
-  return make_scoped_ptr(
-      new AudioRenderer(audio_decoder.Pass(), audio_renderer_sink.Pass(),
-                        audio_parameters.audio_sample_info, max_cached_frames,
-                        min_frames_per_append));
-}
-
-scoped_ptr<VideoRenderer> PlayerComponents::CreateVideoRenderer(
-    const VideoParameters& video_parameters,
-    MediaTimeProvider* media_time_provider,
-    std::string* error_message) {
-  SB_DCHECK(error_message);
-
   scoped_ptr<VideoDecoder> video_decoder;
   scoped_ptr<VideoRenderAlgorithm> video_render_algorithm;
   scoped_refptr<VideoRendererSink> video_renderer_sink;
 
   auto command_line = shared::starboard::Application::Get()->GetCommandLine();
-  if (command_line->HasSwitch("use_stub_video_decoder")) {
-    CreateStubVideoComponents(video_parameters, &video_decoder,
+  bool use_stub_audio_decoder =
+      command_line->HasSwitch("use_stub_audio_decoder");
+  bool use_stub_video_decoder =
+      command_line->HasSwitch("use_stub_video_decoder");
+
+  if (use_stub_audio_decoder && use_stub_video_decoder) {
+    CreateStubAudioComponents(creation_parameters, &audio_decoder,
+                              &audio_renderer_sink);
+    CreateStubVideoComponents(creation_parameters, &video_decoder,
                               &video_render_algorithm, &video_renderer_sink);
   } else {
-    if (!CreateVideoComponents(video_parameters, &video_decoder,
-                               &video_render_algorithm, &video_renderer_sink,
-                               error_message)) {
-      return scoped_ptr<VideoRenderer>();
+    auto copy_of_creation_parameters = creation_parameters;
+    if (use_stub_audio_decoder) {
+      copy_of_creation_parameters.reset_audio_codec();
+    } else if (use_stub_video_decoder) {
+      copy_of_creation_parameters.reset_video_codec();
+    }
+    if (!CreateSubComponents(copy_of_creation_parameters, &audio_decoder,
+                             &audio_renderer_sink, &video_decoder,
+                             &video_render_algorithm, &video_renderer_sink,
+                             error_message)) {
+      return scoped_ptr<PlayerComponents>();
+    }
+    if (use_stub_audio_decoder) {
+      SB_DCHECK(!audio_decoder);
+      SB_DCHECK(!audio_renderer_sink);
+      CreateStubAudioComponents(creation_parameters, &audio_decoder,
+                                &audio_renderer_sink);
+    } else if (use_stub_video_decoder) {
+      SB_DCHECK(!video_decoder);
+      SB_DCHECK(!video_render_algorithm);
+      SB_DCHECK(!video_renderer_sink);
+      CreateStubVideoComponents(creation_parameters, &video_decoder,
+                                &video_render_algorithm, &video_renderer_sink);
     }
   }
 
-  SB_DCHECK(video_decoder);
-  SB_DCHECK(video_render_algorithm);
+  scoped_ptr<MediaTimeProviderImpl> media_time_provider_impl;
+  scoped_ptr<AudioRenderer> audio_renderer;
+  scoped_ptr<VideoRenderer> video_renderer;
 
-  return make_scoped_ptr(
-      new VideoRenderer(video_decoder.Pass(), media_time_provider,
-                        video_render_algorithm.Pass(), video_renderer_sink));
+  if (creation_parameters.audio_codec() != kSbMediaAudioCodecNone) {
+    SB_DCHECK(audio_decoder);
+    SB_DCHECK(audio_renderer_sink);
+
+    int max_cached_frames, min_frames_per_append;
+    GetAudioRendererParams(creation_parameters, &max_cached_frames,
+                           &min_frames_per_append);
+
+    audio_renderer.reset(
+        new AudioRenderer(audio_decoder.Pass(), audio_renderer_sink.Pass(),
+                          creation_parameters.audio_sample_info(),
+                          max_cached_frames, min_frames_per_append));
+  }
+
+  if (creation_parameters.video_codec() != kSbMediaVideoCodecNone) {
+    SB_DCHECK(video_decoder);
+    SB_DCHECK(video_render_algorithm);
+
+    MediaTimeProvider* media_time_provider = nullptr;
+    if (audio_renderer) {
+      media_time_provider = audio_renderer.get();
+    } else {
+      media_time_provider_impl.reset(
+          new MediaTimeProviderImpl(scoped_ptr<MonotonicSystemTimeProvider>(
+              new MonotonicSystemTimeProviderImpl)));
+      media_time_provider = media_time_provider_impl.get();
+    }
+    video_renderer.reset(
+        new VideoRenderer(video_decoder.Pass(), media_time_provider,
+                          video_render_algorithm.Pass(), video_renderer_sink));
+  }
+
+  SB_DCHECK(audio_renderer || video_renderer);
+  return scoped_ptr<PlayerComponents>(
+      new PlayerComponentsImpl(media_time_provider_impl.Pass(),
+                               audio_renderer.Pass(), video_renderer.Pass()));
 }
 
-void PlayerComponents::CreateStubAudioComponents(
-    const AudioParameters& audio_parameters,
+void PlayerComponents::Factory::CreateStubAudioComponents(
+    const CreationParameters& creation_parameters,
     scoped_ptr<AudioDecoder>* audio_decoder,
     scoped_ptr<AudioRendererSink>* audio_renderer_sink) {
   SB_DCHECK(audio_decoder);
@@ -105,18 +284,19 @@
     return scoped_ptr<AudioDecoder>(
         new StubAudioDecoder(audio_sample_info.codec, audio_sample_info));
   };
-  audio_decoder->reset(
-      new AdaptiveAudioDecoder(audio_parameters.audio_sample_info,
-                               audio_parameters.drm_system, decoder_creator));
+  audio_decoder->reset(new AdaptiveAudioDecoder(
+      creation_parameters.audio_sample_info(), creation_parameters.drm_system(),
+      decoder_creator));
 #else   // SB_API_VERSION >= 11
-  audio_decoder->reset(new StubAudioDecoder(
-      audio_parameters.audio_codec, audio_parameters.audio_sample_info));
+  audio_decoder->reset(
+      new StubAudioDecoder(creation_parameters.audio_codec(),
+                           creation_parameters.audio_sample_info()));
 #endif  // SB_API_VERISON >= 11
   audio_renderer_sink->reset(new AudioRendererSinkImpl);
 }
 
-void PlayerComponents::CreateStubVideoComponents(
-    const VideoParameters& video_parameters,
+void PlayerComponents::Factory::CreateStubVideoComponents(
+    const CreationParameters& creation_parameters,
     scoped_ptr<VideoDecoder>* video_decoder,
     scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
     scoped_refptr<VideoRendererSink>* video_renderer_sink) {
@@ -129,11 +309,11 @@
   video_decoder->reset(new StubVideoDecoder);
   video_render_algorithm->reset(new VideoRenderAlgorithmImpl);
   *video_renderer_sink = new PunchoutVideoRendererSink(
-      video_parameters.player, kVideoSinkRenderInterval);
+      creation_parameters.player(), kVideoSinkRenderInterval);
 }
 
-void PlayerComponents::GetAudioRendererParams(
-    const AudioParameters& audio_parameters,
+void PlayerComponents::Factory::GetAudioRendererParams(
+    const CreationParameters& creation_parameters,
     int* max_cached_frames,
     int* min_frames_per_append) const {
   SB_DCHECK(max_cached_frames);
@@ -144,11 +324,11 @@
   // AudioRenderer prefers to use kSbMediaAudioSampleTypeFloat32 and only uses
   // kSbMediaAudioSampleTypeInt16Deprecated when float32 is not supported.
   int min_frames_required = SbAudioSinkGetMinBufferSizeInFrames(
-      audio_parameters.audio_sample_info.number_of_channels,
+      creation_parameters.audio_sample_info().number_of_channels,
       SbAudioSinkIsAudioSampleTypeSupported(kSbMediaAudioSampleTypeFloat32)
           ? kSbMediaAudioSampleTypeFloat32
           : kSbMediaAudioSampleTypeInt16Deprecated,
-      audio_parameters.audio_sample_info.samples_per_second);
+      creation_parameters.audio_sample_info().samples_per_second);
   *max_cached_frames = min_frames_required + *min_frames_per_append * 2;
 #else   // SB_API_VERSION >= 11
   *max_cached_frames = 8 * 1024;
diff --git a/src/starboard/shared/starboard/player/filter/player_components.h b/src/starboard/shared/starboard/player/filter/player_components.h
index 068e49c..965f47d 100644
--- a/src/starboard/shared/starboard/player/filter/player_components.h
+++ b/src/starboard/shared/starboard/player/filter/player_components.h
@@ -16,7 +16,9 @@
 #define STARBOARD_SHARED_STARBOARD_PLAYER_FILTER_PLAYER_COMPONENTS_H_
 
 #include <string>
+#include <vector>
 
+#include "starboard/common/log.h"
 #include "starboard/common/ref_counted.h"
 #include "starboard/common/scoped_ptr.h"
 #include "starboard/decode_target.h"
@@ -39,77 +41,180 @@
 namespace player {
 namespace filter {
 
-// This class creates all the platform specific components that is required by
-// |FilterBasedPlayerWorkerHandler| to function.
+// This class holds necessary media stack components required by
+// by |FilterBasedPlayerWorkerHandler| to function.  It owns the components, and
+// the returned value of each function won't change over the lifetime of this
+// object, so it is safe to cache the returned objects.
 class PlayerComponents {
  public:
-  struct AudioParameters {
-    SbMediaAudioCodec audio_codec;
-    const SbMediaAudioSampleInfo& audio_sample_info;
-    SbDrmSystem drm_system;
-  };
+  // This class creates PlayerComponents.
+  class Factory {
+   public:
+    class CreationParameters {
+     public:
+      CreationParameters(SbMediaAudioCodec audio_codec,
+                         const std::string& audio_mime,
+                         const SbMediaAudioSampleInfo& audio_sample_info,
+                         SbDrmSystem drm_system = kSbDrmSystemInvalid);
+      CreationParameters(SbMediaVideoCodec video_codec,
+                         const std::string& video_mime,
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+                         const SbMediaVideoSampleInfo& video_sample_info,
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+                         const std::string& max_video_capabilities,
+                         SbPlayer player,
+                         SbPlayerOutputMode output_mode,
+                         SbDecodeTargetGraphicsContextProvider*
+                             decode_target_graphics_context_provider,
+                         SbDrmSystem drm_system = kSbDrmSystemInvalid);
+      CreationParameters(SbMediaAudioCodec audio_codec,
+                         const std::string& audio_mime,
+                         const SbMediaAudioSampleInfo& audio_sample_info,
+                         SbMediaVideoCodec video_codec,
+                         const std::string& video_mime,
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+                         const SbMediaVideoSampleInfo& video_sample_info,
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+                         const std::string& max_video_capabilities,
+                         SbPlayer player,
+                         SbPlayerOutputMode output_mode,
+                         SbDecodeTargetGraphicsContextProvider*
+                             decode_target_graphics_context_provider,
+                         SbDrmSystem drm_system = kSbDrmSystemInvalid);
+      CreationParameters(const CreationParameters& that);
+      void operator=(const CreationParameters& that) = delete;
 
-  struct VideoParameters {
-    SbPlayer player;
-    SbMediaVideoCodec video_codec;
-    SbDrmSystem drm_system;
-    SbPlayerOutputMode output_mode;
-    SbDecodeTargetGraphicsContextProvider*
-        decode_target_graphics_context_provider;
-  };
+      void reset_audio_codec() { audio_codec_ = kSbMediaAudioCodecNone; }
+      void reset_video_codec() { video_codec_ = kSbMediaVideoCodecNone; }
 
-  virtual ~PlayerComponents() {}
+      SbMediaAudioCodec audio_codec() const { return audio_codec_; }
+      const std::string& audio_mime() const {
+        SB_DCHECK(audio_codec_ != kSbMediaAudioCodecNone);
+        return audio_mime_;
+      }
+      const SbMediaAudioSampleInfo& audio_sample_info() const {
+        SB_DCHECK(audio_codec_ != kSbMediaAudioCodecNone);
+        return audio_sample_info_;
+      }
 
-  // Individual platform should implement this function to allow the creation of
-  // a PlayerComponents instance.
-  static scoped_ptr<PlayerComponents> Create();
+      SbMediaVideoCodec video_codec() const { return video_codec_; }
+      const std::string& video_mime() const {
+        SB_DCHECK(video_codec_ != kSbMediaVideoCodecNone);
+        return video_mime_;
+      }
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+      const SbMediaVideoSampleInfo& video_sample_info() const {
+        SB_DCHECK(video_codec_ != kSbMediaVideoCodecNone);
+        return video_sample_info_;
+      }
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+      const std::string& max_video_capabilities() const {
+        SB_DCHECK(video_codec_ != kSbMediaVideoCodecNone);
+        return max_video_capabilities_;
+      }
+      SbPlayer player() const {
+        SB_DCHECK(video_codec_ != kSbMediaVideoCodecNone);
+        return player_;
+      }
+      SbPlayerOutputMode output_mode() const {
+        SB_DCHECK(video_codec_ != kSbMediaVideoCodecNone);
+        return output_mode_;
+      }
+      SbDecodeTargetGraphicsContextProvider*
+      decode_target_graphics_context_provider() const {
+        SB_DCHECK(video_codec_ != kSbMediaVideoCodecNone);
+        return decode_target_graphics_context_provider_;
+      }
 
-  scoped_ptr<AudioRenderer> CreateAudioRenderer(
-      const AudioParameters& audio_parameters,
-      std::string* error_message);
+      SbDrmSystem drm_system() const { return drm_system_; }
 
-  scoped_ptr<VideoRenderer> CreateVideoRenderer(
-      const VideoParameters& video_parameters,
-      MediaTimeProvider* media_time_provider,
-      std::string* error_message);
+     private:
+      void TryToCopyAudioSpecificConfig();
+
+      // The following members are only used by the audio stream, and only need
+      // to be set when |audio_codec| isn't kSbMediaAudioCodecNone.
+      // |audio_codec| can be set to kSbMediaAudioCodecNone for audioless video.
+      SbMediaAudioCodec audio_codec_ = kSbMediaAudioCodecNone;
+      std::string audio_mime_;
+      SbMediaAudioSampleInfo audio_sample_info_ = {};
+
+      // The following members are only used by the video stream, and only need
+      // to be set when |video_codec| isn't kSbMediaVideoCodecNone.
+      // |video_codec| can be set to kSbMediaVideoCodecNone for audio only
+      // video.
+      SbMediaVideoCodec video_codec_ = kSbMediaVideoCodecNone;
+      std::string video_mime_;
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+      SbMediaVideoSampleInfo video_sample_info_ = {};
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+      std::string max_video_capabilities_;
+      SbPlayer player_ = kSbPlayerInvalid;
+      SbPlayerOutputMode output_mode_ = kSbPlayerOutputModeInvalid;
+      SbDecodeTargetGraphicsContextProvider*
+          decode_target_graphics_context_provider_ = nullptr;
+
+      // The following member are used by both the audio stream and the video
+      // stream, when they are encrypted.
+      SbDrmSystem drm_system_ = kSbDrmSystemInvalid;
+
+      std::vector<uint8_t> audio_specific_config_;
+    };
+
+    virtual ~Factory() {}
+
+    // TODO: Consider making it return Factory*.
+    // Individual platform should implement this function to allow the creation
+    // of a Factory instance.
+    static scoped_ptr<Factory> Create();
+
+    virtual scoped_ptr<PlayerComponents> CreateComponents(
+        const CreationParameters& creation_parameters,
+        std::string* error_message);
 
 #if COBALT_BUILD_TYPE_GOLD
- private:
+   private:
 #endif  // COBALT_BUILD_TYPE_GOLD
-  // Note that the following functions are exposed in non-Gold build to allow
-  // unit tests to run.
 
-  virtual bool CreateAudioComponents(
-      const AudioParameters& audio_parameters,
-      scoped_ptr<AudioDecoder>* audio_decoder,
-      scoped_ptr<AudioRendererSink>* audio_renderer_sink,
-      std::string* error_message) = 0;
+    // Note that the following function is exposed in non-Gold build to allow
+    // unit tests to run.
+    virtual bool CreateSubComponents(
+        const CreationParameters& creation_parameters,
+        scoped_ptr<AudioDecoder>* audio_decoder,
+        scoped_ptr<AudioRendererSink>* audio_renderer_sink,
+        scoped_ptr<VideoDecoder>* video_decoder,
+        scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
+        scoped_refptr<VideoRendererSink>* video_renderer_sink,
+        std::string* error_message) = 0;
 
-  virtual bool CreateVideoComponents(
-      const VideoParameters& video_parameters,
-      scoped_ptr<VideoDecoder>* video_decoder,
-      scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
-      scoped_refptr<VideoRendererSink>* video_renderer_sink,
-      std::string* error_message) = 0;
+   protected:
+    Factory() {}
 
- protected:
-  PlayerComponents() {}
+    void CreateStubAudioComponents(
+        const CreationParameters& creation_parameters,
+        scoped_ptr<AudioDecoder>* audio_decoder,
+        scoped_ptr<AudioRendererSink>* audio_renderer_sink);
 
-  void CreateStubAudioComponents(
-      const AudioParameters& audio_parameters,
-      scoped_ptr<AudioDecoder>* audio_decoder,
-      scoped_ptr<AudioRendererSink>* audio_renderer_sink);
+    void CreateStubVideoComponents(
+        const CreationParameters& creation_parameters,
+        scoped_ptr<VideoDecoder>* video_decoder,
+        scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
+        scoped_refptr<VideoRendererSink>* video_renderer_sink);
 
-  void CreateStubVideoComponents(
-      const VideoParameters& video_parameters,
-      scoped_ptr<VideoDecoder>* video_decoder,
-      scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
-      scoped_refptr<VideoRendererSink>* video_renderer_sink);
+    // Check AudioRenderer ctor for more details on the parameters.
+    void GetAudioRendererParams(const CreationParameters& creation_parameters,
+                                int* max_cached_frames,
+                                int* min_frames_per_append) const;
 
-  // Check AudioRenderer ctor for more details on the parameters.
-  void GetAudioRendererParams(const AudioParameters& audio_parameters,
-                              int* max_cached_frames,
-                              int* min_frames_per_append) const;
+   private:
+    SB_DISALLOW_COPY_AND_ASSIGN(Factory);
+  };
+
+  PlayerComponents() = default;
+  virtual ~PlayerComponents() {}
+
+  virtual MediaTimeProvider* GetMediaTimeProvider() = 0;
+  virtual AudioRenderer* GetAudioRenderer() = 0;
+  virtual VideoRenderer* GetVideoRenderer() = 0;
 
  private:
   SB_DISALLOW_COPY_AND_ASSIGN(PlayerComponents);
diff --git a/src/starboard/shared/starboard/player/filter/player_filter.gypi b/src/starboard/shared/starboard/player/filter/player_filter.gypi
index 1a32ffb..02024e1 100644
--- a/src/starboard/shared/starboard/player/filter/player_filter.gypi
+++ b/src/starboard/shared/starboard/player/filter/player_filter.gypi
@@ -50,6 +50,8 @@
       '<(DEPTH)/starboard/shared/starboard/player/filter/punchout_video_renderer_sink.h',
       '<(DEPTH)/starboard/shared/starboard/player/filter/stub_audio_decoder.cc',
       '<(DEPTH)/starboard/shared/starboard/player/filter/stub_audio_decoder.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/stub_player_components_factory.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/stub_player_components_factory.h',
       '<(DEPTH)/starboard/shared/starboard/player/filter/stub_video_decoder.cc',
       '<(DEPTH)/starboard/shared/starboard/player/filter/stub_video_decoder.h',
       '<(DEPTH)/starboard/shared/starboard/player/filter/video_decoder_internal.h',
diff --git a/src/starboard/shared/starboard/player/filter/stub_audio_decoder.cc b/src/starboard/shared/starboard/player/filter/stub_audio_decoder.cc
index 13ffdc3..ed80e22 100644
--- a/src/starboard/shared/starboard/player/filter/stub_audio_decoder.cc
+++ b/src/starboard/shared/starboard/player/filter/stub_audio_decoder.cc
@@ -13,6 +13,8 @@
 // limitations under the License.
 
 #include "starboard/shared/starboard/player/filter/stub_audio_decoder.h"
+
+#include "starboard/audio_sink.h"
 #include "starboard/common/log.h"
 
 namespace starboard {
diff --git a/src/starboard/shared/starboard/player/filter/stub_audio_decoder.h b/src/starboard/shared/starboard/player/filter/stub_audio_decoder.h
index 0fe3aa1..ae45e18 100644
--- a/src/starboard/shared/starboard/player/filter/stub_audio_decoder.h
+++ b/src/starboard/shared/starboard/player/filter/stub_audio_decoder.h
@@ -19,7 +19,7 @@
 
 #include "starboard/common/ref_counted.h"
 #include "starboard/shared/internal_only.h"
-#include "starboard/shared/starboard/player/filter/audio_renderer_internal.h"
+#include "starboard/shared/starboard/player/filter/audio_decoder_internal.h"
 #include "starboard/shared/starboard/player/job_queue.h"
 
 namespace starboard {
diff --git a/src/starboard/shared/starboard/player/filter/stub_player_components_factory.cc b/src/starboard/shared/starboard/player/filter/stub_player_components_factory.cc
new file mode 100644
index 0000000..f916ac4
--- /dev/null
+++ b/src/starboard/shared/starboard/player/filter/stub_player_components_factory.cc
@@ -0,0 +1,35 @@
+// Copyright 2017 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "starboard/shared/starboard/player/filter/stub_player_components_factory.h"
+
+#include "starboard/shared/starboard/player/filter/player_components.h"
+
+namespace starboard {
+namespace shared {
+namespace starboard {
+namespace player {
+namespace filter {
+
+// static
+scoped_ptr<PlayerComponents::Factory> StubPlayerComponentsFactory::Create() {
+  return make_scoped_ptr<PlayerComponents::Factory>(
+      new StubPlayerComponentsFactory);
+}
+
+}  // namespace filter
+}  // namespace player
+}  // namespace starboard
+}  // namespace shared
+}  // namespace starboard
diff --git a/src/starboard/shared/starboard/player/filter/stub_player_components_factory.h b/src/starboard/shared/starboard/player/filter/stub_player_components_factory.h
new file mode 100644
index 0000000..1a9f49e
--- /dev/null
+++ b/src/starboard/shared/starboard/player/filter/stub_player_components_factory.h
@@ -0,0 +1,66 @@
+// Copyright 2017 The Cobalt Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef STARBOARD_SHARED_STARBOARD_PLAYER_FILTER_STUB_PLAYER_COMPONENTS_FACTORY_H_
+#define STARBOARD_SHARED_STARBOARD_PLAYER_FILTER_STUB_PLAYER_COMPONENTS_FACTORY_H_
+
+#include <string>
+
+#include "starboard/common/log.h"
+#include "starboard/shared/starboard/player/filter/player_components.h"
+
+namespace starboard {
+namespace shared {
+namespace starboard {
+namespace player {
+namespace filter {
+
+class StubPlayerComponentsFactory : public PlayerComponents::Factory {
+ public:
+  static scoped_ptr<PlayerComponents::Factory> Create();
+
+  bool CreateSubComponents(
+      const CreationParameters& creation_parameters,
+      scoped_ptr<AudioDecoder>* audio_decoder,
+      scoped_ptr<AudioRendererSink>* audio_renderer_sink,
+      scoped_ptr<VideoDecoder>* video_decoder,
+      scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
+      scoped_refptr<VideoRendererSink>* video_renderer_sink,
+      std::string* error_message) override {
+    SB_DCHECK(error_message);
+
+    if (creation_parameters.audio_codec() != kSbMediaAudioCodecNone) {
+      CreateStubAudioComponents(creation_parameters, audio_decoder,
+                                audio_renderer_sink);
+    }
+    if (creation_parameters.video_codec() != kSbMediaVideoCodecNone) {
+      CreateStubVideoComponents(creation_parameters, video_decoder,
+                                video_render_algorithm, video_renderer_sink);
+    }
+    return true;
+  }
+
+ private:
+  StubPlayerComponentsFactory() {}
+
+  SB_DISALLOW_COPY_AND_ASSIGN(StubPlayerComponentsFactory);
+};
+
+}  // namespace filter
+}  // namespace player
+}  // namespace starboard
+}  // namespace shared
+}  // namespace starboard
+
+#endif  // STARBOARD_SHARED_STARBOARD_PLAYER_FILTER_STUB_PLAYER_COMPONENTS_FACTORY_H_
diff --git a/src/starboard/shared/starboard/player/filter/stub_player_components_impl.cc b/src/starboard/shared/starboard/player/filter/stub_player_components_impl.cc
deleted file mode 100644
index 2947df4..0000000
--- a/src/starboard/shared/starboard/player/filter/stub_player_components_impl.cc
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2017 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "starboard/shared/starboard/player/filter/stub_player_components_impl.h"
-
-#include "starboard/shared/starboard/player/filter/player_components.h"
-
-namespace starboard {
-namespace shared {
-namespace starboard {
-namespace player {
-namespace filter {
-
-// static
-scoped_ptr<PlayerComponents> PlayerComponents::Create() {
-  return make_scoped_ptr<PlayerComponents>(new StubPlayerComponentsImpl);
-}
-
-// static
-bool VideoDecoder::OutputModeSupported(SbPlayerOutputMode output_mode,
-                                       SbMediaVideoCodec codec,
-                                       SbDrmSystem drm_system) {
-  return output_mode == kSbPlayerOutputModePunchOut;
-}
-
-}  // namespace filter
-}  // namespace player
-}  // namespace starboard
-}  // namespace shared
-}  // namespace starboard
diff --git a/src/starboard/shared/starboard/player/filter/stub_player_components_impl.h b/src/starboard/shared/starboard/player/filter/stub_player_components_impl.h
deleted file mode 100644
index bcdd39d..0000000
--- a/src/starboard/shared/starboard/player/filter/stub_player_components_impl.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2017 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef STARBOARD_SHARED_STARBOARD_PLAYER_FILTER_STUB_PLAYER_COMPONENTS_IMPL_H_
-#define STARBOARD_SHARED_STARBOARD_PLAYER_FILTER_STUB_PLAYER_COMPONENTS_IMPL_H_
-
-#include "starboard/shared/starboard/player/filter/player_components.h"
-
-#include <string>
-
-#include "starboard/common/log.h"
-
-namespace starboard {
-namespace shared {
-namespace starboard {
-namespace player {
-namespace filter {
-
-class StubPlayerComponentsImpl : public PlayerComponents {
- public:
-  bool CreateAudioComponents(const AudioParameters& audio_parameters,
-                             scoped_ptr<AudioDecoder>* audio_decoder,
-                             scoped_ptr<AudioRendererSink>* audio_renderer_sink,
-                             std::string* error_message) override {
-    SB_DCHECK(error_message);
-
-    CreateStubAudioComponents(audio_parameters, audio_decoder,
-                              audio_renderer_sink);
-    return true;
-  }
-
-  bool CreateVideoComponents(
-      const VideoParameters& video_parameters,
-      scoped_ptr<VideoDecoder>* video_decoder,
-      scoped_ptr<VideoRenderAlgorithm>* video_render_algorithm,
-      scoped_refptr<VideoRendererSink>* video_renderer_sink,
-      std::string* error_message) override {
-    SB_DCHECK(error_message);
-
-    CreateStubVideoComponents(video_parameters, video_decoder,
-                              video_render_algorithm, video_renderer_sink);
-    return true;
-  }
-};
-
-}  // namespace filter
-}  // namespace player
-}  // namespace starboard
-}  // namespace shared
-}  // namespace starboard
-
-#endif  // STARBOARD_SHARED_STARBOARD_PLAYER_FILTER_STUB_PLAYER_COMPONENTS_IMPL_H_
diff --git a/src/starboard/shared/starboard/player/filter/testing/adaptive_audio_decoder_test.cc b/src/starboard/shared/starboard/player/filter/testing/adaptive_audio_decoder_test.cc
index 0a67f32..048a9d2 100644
--- a/src/starboard/shared/starboard/player/filter/testing/adaptive_audio_decoder_test.cc
+++ b/src/starboard/shared/starboard/player/filter/testing/adaptive_audio_decoder_test.cc
@@ -22,7 +22,7 @@
 #include "starboard/shared/starboard/media/media_support_internal.h"
 #include "starboard/shared/starboard/player/filter/audio_decoder_internal.h"
 #include "starboard/shared/starboard/player/filter/player_components.h"
-#include "starboard/shared/starboard/player/filter/stub_player_components_impl.h"
+#include "starboard/shared/starboard/player/filter/stub_player_components_factory.h"
 #include "starboard/shared/starboard/player/video_dmp_reader.h"
 #include "starboard/thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -125,22 +125,21 @@
       ASSERT_GT(dmp_reader->number_of_audio_buffers(), 0);
     }
 
-    PlayerComponents::AudioParameters audio_parameters = {
-        dmp_readers_[0]->audio_codec(), dmp_readers_[0]->audio_sample_info(),
-        kSbDrmSystemInvalid};
+    PlayerComponents::Factory::CreationParameters creation_parameters(
+        dmp_readers_[0]->audio_codec(), "",
+        dmp_readers_[0]->audio_sample_info());
 
     scoped_ptr<AudioRendererSink> audio_renderer_sink;
-    scoped_ptr<PlayerComponents> components;
+    scoped_ptr<PlayerComponents::Factory> factory;
     if (using_stub_decoder_) {
-      components = make_scoped_ptr<StubPlayerComponentsImpl>(
-          new StubPlayerComponentsImpl);
+      factory = StubPlayerComponentsFactory::Create();
     } else {
-      components = PlayerComponents::Create();
+      factory = PlayerComponents::Factory::Create();
     }
     std::string error_message;
-    ASSERT_TRUE(components->CreateAudioComponents(
-        audio_parameters, &audio_decoder_, &audio_renderer_sink,
-        &error_message));
+    ASSERT_TRUE(factory->CreateSubComponents(
+        creation_parameters, &audio_decoder_, &audio_renderer_sink, nullptr,
+        nullptr, nullptr, &error_message));
     ASSERT_TRUE(audio_decoder_);
 
     audio_decoder_->Initialize(
diff --git a/src/starboard/shared/starboard/player/filter/testing/audio_decoder_test.cc b/src/starboard/shared/starboard/player/filter/testing/audio_decoder_test.cc
index 5810751..891b638 100644
--- a/src/starboard/shared/starboard/player/filter/testing/audio_decoder_test.cc
+++ b/src/starboard/shared/starboard/player/filter/testing/audio_decoder_test.cc
@@ -28,7 +28,7 @@
 #include "starboard/shared/starboard/media/media_util.h"
 #include "starboard/shared/starboard/player/decoded_audio_internal.h"
 #include "starboard/shared/starboard/player/filter/player_components.h"
-#include "starboard/shared/starboard/player/filter/stub_player_components_impl.h"
+#include "starboard/shared/starboard/player/filter/stub_player_components_factory.h"
 #include "starboard/shared/starboard/player/video_dmp_reader.h"
 #include "starboard/thread.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -111,24 +111,25 @@
     audio_renderer_sink->reset();
     audio_decoder->reset();
 
-    PlayerComponents::AudioParameters audio_parameters = {
-        codec, audio_sample_info, kSbDrmSystemInvalid};
+    PlayerComponents::Factory::CreationParameters creation_parameters(
+        codec, "", audio_sample_info);
 
-    scoped_ptr<PlayerComponents> components;
+    scoped_ptr<PlayerComponents::Factory> factory;
     if (using_stub_decoder_) {
-      components = make_scoped_ptr<StubPlayerComponentsImpl>(
-          new StubPlayerComponentsImpl);
+      factory = StubPlayerComponentsFactory::Create();
     } else {
-      components = PlayerComponents::Create();
+      factory = PlayerComponents::Factory::Create();
     }
     std::string error_message;
-    components->CreateAudioComponents(audio_parameters, audio_decoder,
-                                      audio_renderer_sink, &error_message);
-
-    if (*audio_decoder) {
+    if (factory->CreateSubComponents(creation_parameters, audio_decoder,
+                                     audio_renderer_sink, nullptr, nullptr,
+                                     nullptr, &error_message)) {
+      SB_CHECK(*audio_decoder);
       (*audio_decoder)
           ->Initialize(std::bind(&AudioDecoderTest::OnOutput, this),
                        std::bind(&AudioDecoderTest::OnError, this));
+    } else {
+      audio_decoder->reset();
     }
   }
 
diff --git a/src/starboard/shared/starboard/player/filter/testing/audio_renderer_internal_test.cc b/src/starboard/shared/starboard/player/filter/testing/audio_renderer_internal_test.cc
index 501aed2..dd36779 100644
--- a/src/starboard/shared/starboard/player/filter/testing/audio_renderer_internal_test.cc
+++ b/src/starboard/shared/starboard/player/filter/testing/audio_renderer_internal_test.cc
@@ -132,7 +132,7 @@
 
     int frames_written = 0;
 
-    while (audio_renderer_->IsSeekingInProgress()) {
+    while (!prerolled_) {
       SbTime timestamp =
           frames_written * kSbTimeSecond / kDefaultSamplesPerSecond;
       scoped_refptr<InputBuffer> input_buffer = CreateInputBuffer(timestamp);
@@ -168,9 +168,11 @@
     job_queue_.RunUntilIdle();
   }
   void Seek(SbTime seek_to_time) {
+    EXPECT_TRUE(prerolled_);
+    prerolled_ = false;
     audio_renderer_->Seek(seek_to_time);
     job_queue_.RunUntilIdle();
-    EXPECT_TRUE(audio_renderer_->IsSeekingInProgress());
+    EXPECT_FALSE(prerolled_);
   }
 
   void CallConsumedCB() {
@@ -218,7 +220,10 @@
   }
 
   void OnError() {}
-  void OnPrerolled() {}
+  void OnPrerolled() {
+    SB_DCHECK(job_queue_.BelongsToCurrentThread());
+    prerolled_ = true;
+  }
   void OnEnded() {}
 
   SbMediaAudioSampleType sample_type_;
@@ -229,6 +234,7 @@
 
   AudioDecoder::OutputCB output_cb_;
   AudioDecoder::ConsumedCB consumed_cb_;
+  bool prerolled_ = true;
 
   scoped_ptr<AudioRenderer> audio_renderer_;
   MockAudioDecoder* audio_decoder_;
@@ -292,7 +298,6 @@
   EXPECT_FALSE(audio_renderer_->IsEndOfStreamWritten());
   EXPECT_FALSE(audio_renderer_->IsEndOfStreamPlayed());
   EXPECT_TRUE(audio_renderer_->CanAcceptMoreData());
-  EXPECT_FALSE(audio_renderer_->IsSeekingInProgress());
   bool is_playing = true;
   bool is_eos_played = true;
   bool is_underflow = true;
@@ -331,7 +336,7 @@
             0);
   EXPECT_FALSE(is_playing);
   EXPECT_FALSE(is_eos_played);
-  EXPECT_FALSE(audio_renderer_->IsSeekingInProgress());
+  EXPECT_TRUE(prerolled_);
 
   audio_renderer_->Play();
 
@@ -423,7 +428,7 @@
             0);
   EXPECT_FALSE(is_playing);
   EXPECT_FALSE(is_eos_played);
-  EXPECT_FALSE(audio_renderer_->IsSeekingInProgress());
+  EXPECT_TRUE(prerolled_);
 
   audio_renderer_->Play();
 
@@ -567,13 +572,13 @@
 
   EXPECT_TRUE(audio_renderer_->IsEndOfStreamWritten());
   EXPECT_FALSE(audio_renderer_->CanAcceptMoreData());
-  EXPECT_TRUE(audio_renderer_->IsSeekingInProgress());
+  EXPECT_FALSE(prerolled_);
 
   // Return EOS from decoder without sending any audio data, which is valid.
   SendDecoderOutput(new DecodedAudio);
 
   EXPECT_TRUE(audio_renderer_->IsEndOfStreamPlayed());
-  EXPECT_FALSE(audio_renderer_->IsSeekingInProgress());
+  EXPECT_TRUE(prerolled_);
   bool is_playing = true;
   bool is_eos_played = false;
   bool is_underflow = true;
@@ -614,13 +619,13 @@
 
   EXPECT_TRUE(audio_renderer_->IsEndOfStreamWritten());
   EXPECT_FALSE(audio_renderer_->CanAcceptMoreData());
-  EXPECT_TRUE(audio_renderer_->IsSeekingInProgress());
+  EXPECT_FALSE(prerolled_);
 
   // Return EOS from decoder without sending any audio data, which is valid.
   SendDecoderOutput(new DecodedAudio);
 
   EXPECT_TRUE(audio_renderer_->IsEndOfStreamPlayed());
-  EXPECT_FALSE(audio_renderer_->IsSeekingInProgress());
+  EXPECT_TRUE(prerolled_);
   bool is_playing = true;
   bool is_eos_played = false;
   bool is_underflow = true;
@@ -650,7 +655,7 @@
 
   int frames_written = 0;
 
-  while (audio_renderer_->IsSeekingInProgress()) {
+  while (!prerolled_) {
     SbTime timestamp =
         frames_written * kSbTimeSecond / kDefaultSamplesPerSecond;
     WriteSample(CreateInputBuffer(timestamp));
@@ -672,7 +677,7 @@
             0);
   EXPECT_FALSE(is_playing);
   EXPECT_FALSE(is_eos_played);
-  EXPECT_FALSE(audio_renderer_->IsSeekingInProgress());
+  EXPECT_TRUE(prerolled_);
 
   audio_renderer_->Play();
 
@@ -750,7 +755,7 @@
 
   int frames_written = 0;
 
-  while (audio_renderer_->IsSeekingInProgress()) {
+  while (!prerolled_) {
     SbTime timestamp =
         frames_written * kSbTimeSecond / kDefaultSamplesPerSecond;
     SbTime output_time = timestamp;
@@ -772,7 +777,7 @@
   EXPECT_EQ(audio_renderer_->GetCurrentMediaTime(&is_playing, &is_eos_played,
                                                  &is_underflow),
             0);
-  EXPECT_FALSE(audio_renderer_->IsSeekingInProgress());
+  EXPECT_TRUE(prerolled_);
 
   audio_renderer_->Play();
 
@@ -850,7 +855,7 @@
   EXPECT_EQ(audio_renderer_->GetCurrentMediaTime(&is_playing, &is_eos_played,
                                                  &is_underflow),
             0);
-  EXPECT_FALSE(audio_renderer_->IsSeekingInProgress());
+  EXPECT_TRUE(prerolled_);
 
   audio_renderer_->Play();
 
@@ -892,7 +897,7 @@
   EXPECT_GE(audio_renderer_->GetCurrentMediaTime(&is_playing, &is_eos_played,
                                                  &is_underflow),
             seek_time);
-  EXPECT_FALSE(audio_renderer_->IsSeekingInProgress());
+  EXPECT_TRUE(prerolled_);
 
   audio_renderer_->Play();
   SendDecoderOutput(new DecodedAudio);
diff --git a/src/starboard/shared/starboard/player/filter/testing/media_time_provider_impl_test.cc b/src/starboard/shared/starboard/player/filter/testing/media_time_provider_impl_test.cc
index 9c1637e..8cf4555 100644
--- a/src/starboard/shared/starboard/player/filter/testing/media_time_provider_impl_test.cc
+++ b/src/starboard/shared/starboard/player/filter/testing/media_time_provider_impl_test.cc
@@ -86,16 +86,9 @@
         // tests.
         media_time_provider_impl_(make_scoped_ptr<MonotonicSystemTimeProvider>(
             system_time_provider_)) {
-    media_time_provider_impl_.Initialize(
-        std::bind(&MediaTimeProviderImplTest::OnError, this),
-        std::bind(&MediaTimeProviderImplTest::OnPrerolled, this),
-        std::bind(&MediaTimeProviderImplTest::OnEnded, this));
+    media_time_provider_impl_.SetPlaybackRate(1.0);
   }
 
-  void OnError() {}
-  void OnPrerolled() {}
-  void OnEnded() {}
-
   JobQueue job_queue_;
   StrictMock<MockMonotonicSystemTimeProvider>* system_time_provider_;
   MediaTimeProviderImpl media_time_provider_impl_;
@@ -250,54 +243,6 @@
                           0));
 }
 
-TEST_F(MediaTimeProviderImplTest, EndOfStream) {
-  const SbTime kVideoDuration = kSbTimeSecond;
-  system_time_provider_->AdvanceTime(kSbTimeSecond);
-
-  media_time_provider_impl_.UpdateVideoDuration(kVideoDuration);
-  system_time_provider_->AdvanceTime(kSbTimeSecond);
-
-  bool is_playing = true, is_eos_played = true, is_underflow = true;
-  // Query for media time and ignore the result.
-  media_time_provider_impl_.GetCurrentMediaTime(&is_playing, &is_eos_played,
-                                                &is_underflow);
-  EXPECT_FALSE(is_playing);
-  EXPECT_FALSE(is_eos_played);
-  EXPECT_FALSE(is_underflow);
-
-  media_time_provider_impl_.Play();
-  // Advance to 1 millisecond past the |kVideoDuration|.
-  system_time_provider_->AdvanceTime(kSbTimeSecond + kSbTimeMillisecond);
-  media_time_provider_impl_.GetCurrentMediaTime(&is_playing, &is_eos_played,
-                                                &is_underflow);
-  EXPECT_TRUE(is_playing);
-  EXPECT_FALSE(is_eos_played);
-  EXPECT_FALSE(is_underflow);
-
-  media_time_provider_impl_.VideoEndOfStreamReached();
-  media_time_provider_impl_.GetCurrentMediaTime(&is_playing, &is_eos_played,
-                                                &is_underflow);
-  EXPECT_TRUE(is_playing);
-  EXPECT_TRUE(is_eos_played);
-  EXPECT_FALSE(is_underflow);
-
-  media_time_provider_impl_.Pause();
-  media_time_provider_impl_.SetPlaybackRate(0);
-  SbTime current_time = media_time_provider_impl_.GetCurrentMediaTime(
-      &is_playing, &is_eos_played, &is_underflow);
-  EXPECT_FALSE(is_playing);
-  EXPECT_TRUE(is_eos_played);
-  EXPECT_FALSE(is_underflow);
-
-  // Seek() should clear the EOS state
-  media_time_provider_impl_.Seek(current_time);
-  media_time_provider_impl_.GetCurrentMediaTime(&is_playing, &is_eos_played,
-                                                &is_underflow);
-  EXPECT_FALSE(is_playing);
-  EXPECT_FALSE(is_eos_played);
-  EXPECT_FALSE(is_underflow);
-}
-
 }  // namespace
 }  // namespace testing
 }  // namespace filter
diff --git a/src/starboard/shared/starboard/player/filter/testing/video_decoder_test.cc b/src/starboard/shared/starboard/player/filter/testing/video_decoder_test.cc
index bc1d828..c39c3ca 100644
--- a/src/starboard/shared/starboard/player/filter/testing/video_decoder_test.cc
+++ b/src/starboard/shared/starboard/player/filter/testing/video_decoder_test.cc
@@ -30,7 +30,7 @@
 #include "starboard/memory.h"
 #include "starboard/shared/starboard/media/media_support_internal.h"
 #include "starboard/shared/starboard/media/media_util.h"
-#include "starboard/shared/starboard/player/filter/stub_player_components_impl.h"
+#include "starboard/shared/starboard/player/filter/stub_player_components_factory.h"
 #include "starboard/shared/starboard/player/job_queue.h"
 #include "starboard/shared/starboard/player/video_dmp_reader.h"
 #include "starboard/testing/fake_graphics_context_provider.h"
@@ -107,6 +107,24 @@
          << "time " << time1 << " doesn't match with time " << time2;
 }
 
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+SbMediaVideoSampleInfo CreateVideoSampleInfo(SbMediaVideoCodec codec) {
+  SbMediaVideoSampleInfo video_sample_info = {};
+
+  video_sample_info.codec = codec;
+
+  video_sample_info.color_metadata.primaries = kSbMediaPrimaryIdBt709;
+  video_sample_info.color_metadata.transfer = kSbMediaTransferIdBt709;
+  video_sample_info.color_metadata.matrix = kSbMediaMatrixIdBt709;
+  video_sample_info.color_metadata.range = kSbMediaRangeIdLimited;
+
+  video_sample_info.frame_width = 1920;
+  video_sample_info.frame_height = 1080;
+
+  return video_sample_info;
+}
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+
 class VideoDecoderTest
     : public ::testing::TestWithParam<std::tuple<TestParam, bool>> {
  public:
@@ -131,21 +149,24 @@
     ASSERT_TRUE(VideoDecoder::OutputModeSupported(
         output_mode, dmp_reader_.video_codec(), kSbDrmSystemInvalid));
 
-    PlayerComponents::VideoParameters video_parameters = {
-        &player_, dmp_reader_.video_codec(), kSbDrmSystemInvalid, output_mode,
-        fake_graphics_context_provider_.decoder_target_provider()};
+    PlayerComponents::Factory::CreationParameters creation_parameters(
+        dmp_reader_.video_codec(), "",
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+        GetVideoInputBuffer(0)->video_sample_info(),
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+        "", &player_, output_mode,
+        fake_graphics_context_provider_.decoder_target_provider(), nullptr);
 
-    scoped_ptr<PlayerComponents> components;
+    scoped_ptr<PlayerComponents::Factory> factory;
     if (using_stub_decoder_) {
-      components = make_scoped_ptr<StubPlayerComponentsImpl>(
-          new StubPlayerComponentsImpl);
+      factory = StubPlayerComponentsFactory::Create();
     } else {
-      components = PlayerComponents::Create();
+      factory = PlayerComponents::Factory::Create();
     }
     std::string error_message;
-    ASSERT_TRUE(components->CreateVideoComponents(
-        video_parameters, &video_decoder_, &video_render_algorithm_,
-        &video_renderer_sink_, &error_message));
+    ASSERT_TRUE(factory->CreateSubComponents(
+        creation_parameters, nullptr, nullptr, &video_decoder_,
+        &video_render_algorithm_, &video_renderer_sink_, &error_message));
     ASSERT_TRUE(video_decoder_);
 
     if (video_renderer_sink_) {
@@ -534,7 +555,8 @@
   // Create three more decoders for each supported combinations.
   const int kDecodersToCreate = 3;
 
-  scoped_ptr<PlayerComponents> components = PlayerComponents::Create();
+  scoped_ptr<PlayerComponents::Factory> factory =
+      PlayerComponents::Factory::Create();
 
   SbPlayerOutputMode kOutputModes[] = {kSbPlayerOutputModeDecodeToTexture,
                                        kSbPlayerOutputModePunchOut};
@@ -566,15 +588,25 @@
             video_renderer_sinks[kDecodersToCreate];
 
         for (int i = 0; i < kDecodersToCreate; ++i) {
-          PlayerComponents::VideoParameters video_parameters = {
-              &players[i], dmp_reader_.video_codec(), kSbDrmSystemInvalid,
-              output_mode,
-              fake_graphics_context_provider_.decoder_target_provider()};
+          SbMediaAudioSampleInfo dummy_audio_sample_info = {
+#if SB_API_VERSION >= 11
+            kSbMediaAudioCodecNone
+#endif  // SB_API_VERSION >= 11
+          };
+          PlayerComponents::Factory::CreationParameters creation_parameters(
+              dmp_reader_.video_codec(), "",
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+              CreateVideoSampleInfo(dmp_reader_.video_codec()),
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+              "", &players[i], output_mode,
+              fake_graphics_context_provider_.decoder_target_provider(),
+              nullptr);
 
           std::string error_message;
-          ASSERT_TRUE(components->CreateVideoComponents(
-              video_parameters, &video_decoders[i], &video_render_algorithms[i],
-              &video_renderer_sinks[i], &error_message));
+          ASSERT_TRUE(factory->CreateSubComponents(
+              creation_parameters, nullptr, nullptr, &video_decoders[i],
+              &video_render_algorithms[i], &video_renderer_sinks[i],
+              &error_message));
           ASSERT_TRUE(video_decoders[i]);
 
           if (video_renderer_sinks[i]) {
diff --git a/src/starboard/shared/starboard/player/filter/tools/audio_dmp_player.cc b/src/starboard/shared/starboard/player/filter/tools/audio_dmp_player.cc
index 2750620..c56a7e4 100644
--- a/src/starboard/shared/starboard/player/filter/tools/audio_dmp_player.cc
+++ b/src/starboard/shared/starboard/player/filter/tools/audio_dmp_player.cc
@@ -38,6 +38,12 @@
 using starboard::shared::starboard::player::JobThread;
 using starboard::scoped_ptr;
 
+#ifdef SB_MEDIA_PLAYER_THREAD_STACK_SIZE
+const int kJobThreadStackSize = SB_MEDIA_PLAYER_THREAD_STACK_SIZE;
+#else   // SB_MEDIA_PLAYER_THREAD_STACK_SIZE
+const int kJobThreadStackSize = 0;
+#endif  // SB_MEDIA_PLAYER_THREAD_STACK_SIZE
+
 // TODO: Merge test file resolving function with the ones used in the player
 // filter tests.
 std::string GetTestInputDirectory() {
@@ -62,7 +68,7 @@
 }
 
 scoped_ptr<VideoDmpReader> s_video_dmp_reader;
-scoped_ptr<AudioRenderer> s_audio_renderer;
+scoped_ptr<PlayerComponents> s_player_components;
 int s_audio_sample_index;
 scoped_ptr<JobThread> s_job_thread;
 SbTime s_duration;
@@ -89,19 +95,19 @@
 }
 
 void OnTimer() {
-  if (!s_audio_renderer->CanAcceptMoreData()) {
+  if (!s_player_components->GetAudioRenderer()->CanAcceptMoreData()) {
     s_job_thread->job_queue()->Schedule(std::bind(OnTimer), kSbTimeMillisecond);
     return;
   }
 
   if (s_audio_sample_index == s_video_dmp_reader->number_of_audio_buffers()) {
     SB_LOG(INFO) << "EOS written, duration " << s_duration << " microseconds.";
-    s_audio_renderer->WriteEndOfStream();
+    s_player_components->GetAudioRenderer()->WriteEndOfStream();
     return;
   } else {
     auto input_buffer = GetAudioInputBuffer(s_audio_sample_index);
     s_duration = input_buffer->timestamp();
-    s_audio_renderer->WriteSample(input_buffer);
+    s_player_components->GetAudioRenderer()->WriteSample(input_buffer);
     ++s_audio_sample_index;
   }
 
@@ -115,12 +121,12 @@
 
 void PrerolledCB() {
   SB_LOG(INFO) << "Playback started.";
-  s_audio_renderer->Play();
+  s_player_components->GetAudioRenderer()->Play();
 }
 
 void EndedCB() {
   SB_LOG(INFO) << "Playback finished.";
-  s_audio_renderer.reset();
+  s_player_components.reset();
   s_video_dmp_reader.reset();
   SbSystemRequestStop(0);
 }
@@ -129,23 +135,25 @@
   SB_LOG(INFO) << "Loading " << filename;
   s_video_dmp_reader.reset(
       new VideoDmpReader(ResolveTestFileName(filename).c_str()));
-  scoped_ptr<PlayerComponents> player_components = PlayerComponents::Create();
-  PlayerComponents::AudioParameters audio_parameters = {
-      s_video_dmp_reader->audio_codec(),
-      s_video_dmp_reader->audio_sample_info(), kSbDrmSystemInvalid};
+  scoped_ptr<PlayerComponents::Factory> factory =
+      PlayerComponents::Factory::Create();
+  PlayerComponents::Factory::CreationParameters creation_parameters(
+      s_video_dmp_reader->audio_codec(), "",
+      s_video_dmp_reader->audio_sample_info());
   std::string error_message;
-  s_audio_renderer =
-      player_components->CreateAudioRenderer(audio_parameters, &error_message);
-  SB_DCHECK(s_audio_renderer);
+  s_player_components =
+      factory->CreateComponents(creation_parameters, &error_message);
+  SB_DCHECK(s_player_components);
+  SB_DCHECK(s_player_components->GetAudioRenderer());
 
   using std::placeholders::_1;
   using std::placeholders::_2;
 
-  s_audio_renderer->Initialize(std::bind(ErrorCB, _1, _2),
-                               std::bind(PrerolledCB), std::bind(EndedCB));
-  s_audio_renderer->SetPlaybackRate(1.0);
-  s_audio_renderer->SetVolume(1.0);
-  s_audio_renderer->Seek(0);
+  s_player_components->GetAudioRenderer()->Initialize(
+      std::bind(ErrorCB, _1, _2), std::bind(PrerolledCB), std::bind(EndedCB));
+  s_player_components->GetAudioRenderer()->SetPlaybackRate(1.0);
+  s_player_components->GetAudioRenderer()->SetVolume(1.0);
+  s_player_components->GetAudioRenderer()->Seek(0);
   s_job_thread->job_queue()->Schedule(std::bind(OnTimer));
 }
 
@@ -167,7 +175,7 @@
         return;
       }
 
-      s_job_thread.reset(new JobThread("audio"));
+      s_job_thread.reset(new JobThread("audio", kJobThreadStackSize));
       s_job_thread->job_queue()->Schedule(
           std::bind(Start, data->argument_values[1]));
       break;
diff --git a/src/starboard/shared/starboard/player/player_create.cc b/src/starboard/shared/starboard/player/player_create.cc
index c8dfbdd..72ab379 100644
--- a/src/starboard/shared/starboard/player/player_create.cc
+++ b/src/starboard/shared/starboard/player/player_create.cc
@@ -68,7 +68,9 @@
 
   SbMediaAudioCodec audio_codec = creation_param->audio_sample_info.codec;
   SbMediaVideoCodec video_codec = creation_param->video_sample_info.codec;
+#if SB_PLAYER_ENABLE_VIDEO_DUMPER && SB_HAS(PLAYER_FILTER_TESTS)
   SbDrmSystem drm_system = creation_param->drm_system;
+#endif  // SB_PLAYER_ENABLE_VIDEO_DUMPER && SB_HAS(PLAYER_FILTER_TESTS)
   const SbMediaAudioSampleInfo* audio_sample_info =
       &creation_param->audio_sample_info;
   const char* max_video_capabilities = creation_param->max_video_capabilities;
@@ -179,10 +181,15 @@
 
   UpdateActiveSessionPlatformPlaybackState(kPlaying);
 
+#if SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
+  starboard::scoped_ptr<PlayerWorker::Handler> handler(
+      new FilterBasedPlayerWorkerHandler(creation_param, provider));
+#else   // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
   starboard::scoped_ptr<PlayerWorker::Handler> handler(
       new FilterBasedPlayerWorkerHandler(video_codec, audio_codec, drm_system,
                                          audio_sample_info, output_mode,
                                          provider));
+#endif  // SB_HAS(PLAYER_CREATION_AND_OUTPUT_MODE_QUERY_IMPROVEMENT)
 
   SbPlayer player = SbPlayerPrivate::CreateInstance(
       audio_codec, video_codec, audio_sample_info, sample_deallocate_func,
diff --git a/src/starboard/shared/starboard/player/player_worker.cc b/src/starboard/shared/starboard/player/player_worker.cc
index 0b1f1c3..4d1ab24 100644
--- a/src/starboard/shared/starboard/player/player_worker.cc
+++ b/src/starboard/shared/starboard/player/player_worker.cc
@@ -35,9 +35,9 @@
 
 #ifdef SB_MEDIA_PLAYER_THREAD_STACK_SIZE
 const int kPlayerStackSize = SB_MEDIA_PLAYER_THREAD_STACK_SIZE;
-#else
+#else   // SB_MEDIA_PLAYER_THREAD_STACK_SIZE
 const int kPlayerStackSize = 0;
-#endif
+#endif  // SB_MEDIA_PLAYER_THREAD_STACK_SIZE
 
 // 8 ms is enough to ensure that DoWritePendingSamples() is called twice for
 // every frame in HFR.
diff --git a/src/starboard/starboard_all.gyp b/src/starboard/starboard_all.gyp
index bfc58b3..caf7e36 100644
--- a/src/starboard/starboard_all.gyp
+++ b/src/starboard/starboard_all.gyp
@@ -17,12 +17,12 @@
 
 {
   'variables': {
-    'has_platform_tests%' : '<!(python ../build/file_exists.py <(DEPTH)/<(starboard_path)/starboard_platform_tests.gyp)',
+    'has_platform_tests%' : '<!(python <(DEPTH)/build/file_exists.py <(DEPTH)/<(starboard_path)/starboard_platform_tests.gyp)',
   },
   'conditions': [
     # If 'starboard_platform_tests' is not defined by the platform, then an
     # empty 'starboard_platform_tests' target is defined.
-    ['has_platform_tests=="False"', {
+    ['has_platform_tests==0', {
       'targets': [
         {
           'target_name': 'starboard_platform_tests',
@@ -74,7 +74,7 @@
             '<(DEPTH)/starboard/examples/glclear/glclear.gyp:starboard_glclear_example',
           ],
         }],
-        ['has_platform_tests=="True"', {
+        ['has_platform_tests==1', {
           'dependencies': [
             '<(DEPTH)/<(starboard_path)/starboard_platform_tests.gyp:*',
           ],
diff --git a/src/starboard/stub/BUILD.gn b/src/starboard/stub/BUILD.gn
index e0425b6..32a6ec3 100644
--- a/src/starboard/stub/BUILD.gn
+++ b/src/starboard/stub/BUILD.gn
@@ -167,7 +167,7 @@
     "//starboard/shared/starboard/file_mode_string_to_flags.cc",
     "//starboard/shared/starboard/player/filter/stub_audio_decoder.cc",
     "//starboard/shared/starboard/player/filter/stub_audio_decoder.h",
-    "//starboard/shared/starboard/player/filter/stub_player_components_impl.cc",
+    "//starboard/shared/starboard/player/filter/stub_player_components_factory.cc",
     "//starboard/shared/starboard/player/filter/stub_video_decoder.cc",
     "//starboard/shared/starboard/player/filter/stub_video_decoder.h",
     "//starboard/shared/starboard/queue_application.cc",
diff --git a/src/starboard/stub/stub_sources.gypi b/src/starboard/stub/stub_sources.gypi
index a153f2d..431269a 100644
--- a/src/starboard/stub/stub_sources.gypi
+++ b/src/starboard/stub/stub_sources.gypi
@@ -20,7 +20,6 @@
         '<(DEPTH)/starboard/shared/starboard/event_cancel.cc',
         '<(DEPTH)/starboard/shared/starboard/event_schedule.cc',
         '<(DEPTH)/starboard/shared/starboard/file_mode_string_to_flags.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/stub_player_components_impl.cc',
         '<(DEPTH)/starboard/shared/starboard/queue_application.cc',
         '<(DEPTH)/starboard/shared/stub/accessibility_get_caption_settings.cc',
         '<(DEPTH)/starboard/shared/stub/accessibility_get_display_settings.cc',
diff --git a/src/starboard/tools/build.py b/src/starboard/tools/build.py
index d28d8d4..7a071e3 100644
--- a/src/starboard/tools/build.py
+++ b/src/starboard/tools/build.py
@@ -250,7 +250,7 @@
     else:
       module_path = os.path.join('config', '%s.py' % platform_name)
       platform_module = importlib.import_module('config.%s' % platform_name)
-  except ImportError:
+  except (ImportError, IOError):
     logging.exception('Unable to import "%s".', module_path)
     return None
 
diff --git a/src/starboard/tools/command_line.py b/src/starboard/tools/command_line.py
index cd8bb0f..cecccb5 100644
--- a/src/starboard/tools/command_line.py
+++ b/src/starboard/tools/command_line.py
@@ -123,5 +123,5 @@
   if args.target_params is None:
     launcher_params.target_params = []
   else:
-    launcher_params.target_params = [args.target_params]
+    launcher_params.target_params = args.target_params.split(' ')
   return launcher_params
diff --git a/src/starboard/tools/example/app_launcher_client.py b/src/starboard/tools/example/app_launcher_client.py
index 3dd8bad..53231fc 100644
--- a/src/starboard/tools/example/app_launcher_client.py
+++ b/src/starboard/tools/example/app_launcher_client.py
@@ -32,19 +32,18 @@
   command_line.AddLauncherArguments(arg_parser)
   arg_parser.add_argument(
       "-t", "--target_name", required=True, help="Name of executable target.")
-  args = arg_parser.parse_args()
-
-  target_params = []
-  if args.target_params:
-    target_params = args.target_params.split(" ")
+  launcher_params = command_line.CreateLauncherParams(arg_parser)
 
   launcher = abstract_launcher.LauncherFactory(
-      args.platform,
-      args.target_name,
-      args.config,
-      device_id=args.device_id,
-      target_params=target_params,
-      out_directory=args.out_directory)
+      launcher_params.platform,
+      launcher_params.target_name,
+      launcher_params.config,
+      device_id=launcher_params.device_id,
+      target_params=launcher_params.target_params,
+      out_directory=launcher_params.out_directory,
+      loader_platform=launcher_params.loader_platform,
+      loader_config=launcher_params.loader_config,
+      loader_out_directory=launcher_params.loader_out_directory)
 
   def Abort(signum, frame):
     del signum, frame  # Unused.
diff --git a/src/starboard/tools/toolchain/cmd.py b/src/starboard/tools/toolchain/cmd.py
index bbf354f..15a7963 100644
--- a/src/starboard/tools/toolchain/cmd.py
+++ b/src/starboard/tools/toolchain/cmd.py
@@ -1,85 +1,85 @@
-# Copyright 2018 Google Inc. All Rights Reserved.

-#

-# Licensed under the Apache License, Version 2.0 (the "License");

-# you may not use this file except in compliance with the License.

-# You may obtain a copy of the License at

-#

-#     http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed under the License is distributed on an "AS IS" BASIS,

-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-# See the License for the specific language governing permissions and

-# limitations under the License.

-"""Allows to use cmd as a shell."""

-

-import re

-

-from starboard.tools.toolchain import abstract

-

-

-def _MaybeJoin(shell, command):

-  if isinstance(command, basestring):

-    return command

-  return shell.Join(command)

-

-

-class Shell(abstract.Shell):

-  """Constructs command lines using Cmd syntax."""

-

-  def MaybeQuoteArgument(self, arg):

-    # Rather than attempting to enumerate the bad shell characters, just

-    # whitelist common OK ones and quote anything else.

-    if re.match(r'^[a-zA-Z0-9_=.\\/-]+$', arg):

-      return arg  # No quoting necessary.

-    return self.QuoteForRspFile(arg)

-

-  def QuoteForRspFile(self, arg):

-    """Quote a command line argument.

-

-    Quote the argument so that it appears as one argument when

-    processed via cmd.exe and parsed by CommandLineToArgvW (as is typical for

-    Windows programs).

-

-    Args:

-      arg: The argument to quote.

-

-    Returns:

-      The quoted argument.

-    """

-

-    # See http://goo.gl/cuFbX and http://goo.gl/dhPnp including the comment

-    # threads. This is actually the quoting rules for CommandLineToArgvW, not

-    # for the shell, because the shell doesn't do anything in Windows. This

-    # works more or less because most programs (including the compiler, etc.)

-    # use that function to handle command line arguments.

-

-    # For a literal quote, CommandLineToArgvW requires 2n+1 backslashes

-    # preceding it, and results in n backslashes + the quote. So we substitute

-    # in 2* what we match, +1 more, plus the quote.

-    windows_quoter_regex = re.compile(r'(\\*)"')

-    arg = windows_quoter_regex.sub(lambda mo: 2 * mo.group(1) + '\\"', arg)

-

-    # %'s also need to be doubled otherwise they're interpreted as batch

-    # positional arguments. Also make sure to escape the % so that they're

-    # passed literally through escaping so they can be singled to just the

-    # original %. Otherwise, trying to pass the literal representation that

-    # looks like an environment variable to the shell (e.g. %PATH%) would fail.

-    arg = arg.replace('%', '%%')

-

-    # These commands are used in rsp files, so no escaping for the shell (via ^)

-    # is necessary.

-

-    # Finally, wrap the whole thing in quotes so that the above quote rule

-    # applies and whitespace isn't a word break.

-    return '"' + arg + '"'

-

-  def Join(self, command):

-    assert not isinstance(command, basestring)

-    return ' '.join(self.MaybeQuoteArgument(argument) for argument in command)

-

-  def And(self, *commands):

-    return ' && '.join(_MaybeJoin(self, command) for command in commands)

-

-  def Or(self, *commands):

-    return ' || '.join(_MaybeJoin(self, command) for command in commands)

+# Copyright 2018 Google Inc. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Allows to use cmd as a shell."""
+
+import re
+
+from starboard.tools.toolchain import abstract
+
+
+def _MaybeJoin(shell, command):
+  if isinstance(command, basestring):
+    return command
+  return shell.Join(command)
+
+
+class Shell(abstract.Shell):
+  """Constructs command lines using Cmd syntax."""
+
+  def MaybeQuoteArgument(self, arg):
+    # Rather than attempting to enumerate the bad shell characters, just
+    # whitelist common OK ones and quote anything else.
+    if re.match(r'^[a-zA-Z0-9_=.\\/-]+$', arg):
+      return arg  # No quoting necessary.
+    return self.QuoteForRspFile(arg)
+
+  def QuoteForRspFile(self, arg):
+    """Quote a command line argument.
+
+    Quote the argument so that it appears as one argument when
+    processed via cmd.exe and parsed by CommandLineToArgvW (as is typical for
+    Windows programs).
+
+    Args:
+      arg: The argument to quote.
+
+    Returns:
+      The quoted argument.
+    """
+
+    # See http://goo.gl/cuFbX and http://goo.gl/dhPnp including the comment
+    # threads. This is actually the quoting rules for CommandLineToArgvW, not
+    # for the shell, because the shell doesn't do anything in Windows. This
+    # works more or less because most programs (including the compiler, etc.)
+    # use that function to handle command line arguments.
+
+    # For a literal quote, CommandLineToArgvW requires 2n+1 backslashes
+    # preceding it, and results in n backslashes + the quote. So we substitute
+    # in 2* what we match, +1 more, plus the quote.
+    windows_quoter_regex = re.compile(r'(\\*)"')
+    arg = windows_quoter_regex.sub(lambda mo: 2 * mo.group(1) + '\\"', arg)
+
+    # %'s also need to be doubled otherwise they're interpreted as batch
+    # positional arguments. Also make sure to escape the % so that they're
+    # passed literally through escaping so they can be singled to just the
+    # original %. Otherwise, trying to pass the literal representation that
+    # looks like an environment variable to the shell (e.g. %PATH%) would fail.
+    arg = arg.replace('%', '%%')
+
+    # These commands are used in rsp files, so no escaping for the shell (via ^)
+    # is necessary.
+
+    # Finally, wrap the whole thing in quotes so that the above quote rule
+    # applies and whitespace isn't a word break.
+    return '"' + arg + '"'
+
+  def Join(self, command):
+    assert not isinstance(command, basestring)
+    return ' '.join(self.MaybeQuoteArgument(argument) for argument in command)
+
+  def And(self, *commands):
+    return ' && '.join(_MaybeJoin(self, command) for command in commands)
+
+  def Or(self, *commands):
+    return ' || '.join(_MaybeJoin(self, command) for command in commands)
diff --git a/src/starboard/tools/toolchain/python.py b/src/starboard/tools/toolchain/python.py
index 90c353a..bee8841 100644
--- a/src/starboard/tools/toolchain/python.py
+++ b/src/starboard/tools/toolchain/python.py
@@ -1,83 +1,83 @@
-# Copyright 2018 Google Inc. All Rights Reserved.

-#

-# Licensed under the Apache License, Version 2.0 (the "License");

-# you may not use this file except in compliance with the License.

-# You may obtain a copy of the License at

-#

-#     http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed under the License is distributed on an "AS IS" BASIS,

-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-# See the License for the specific language governing permissions and

-# limitations under the License.

-"""Allow to use gyp-win-tool via python as a copy and a stamp tools."""

-

-import sys

-from starboard.tools.toolchain import abstract

-

-

-class Copy(abstract.Copy):

-  """Copies individual files using python.exe."""

-

-  def __init__(self, **kwargs):

-    self._path = kwargs.get('path', sys.executable)

-    self._extra_flags = kwargs.get('extra_flags', [])

-

-  def GetPath(self):

-    return self._path

-

-  def GetExtraFlags(self):

-    return self._extra_flags

-

-  def GetMaxConcurrentProcesses(self):

-    # Run as much concurrent processes as possible.

-    return None

-

-  def GetCommand(self, path, extra_flags, flags, shell):

-    del flags, shell  # Not used.

-    return '{0} {1} $in $out'.format(path, extra_flags)

-

-  def GetDescription(self):

-    return 'COPY $in $out'

-

-  def GetRspFilePath(self):

-    # A command line only contains one input and one output file.

-    pass

-

-  def GetRspFileContent(self):

-    # A command line only contains one input and one output file.

-    pass

-

-

-class Stamp(abstract.Stamp):

-  """Updates the access and modification times of a file to the current time."""

-

-  def __init__(self, **kwargs):

-    self._path = kwargs.get('path', sys.executable)

-    self._extra_flags = kwargs.get('extra_flags', [])

-

-  def GetPath(self):

-    return self._path

-

-  def GetExtraFlags(self):

-    return self._extra_flags

-

-  def GetMaxConcurrentProcesses(self):

-    # Run as much concurrent processes as possible.

-    return None

-

-  def GetCommand(self, path, extra_flags, flags, shell):

-    del flags, shell  # Not used.

-    return '{0} {1} $out'.format(path, extra_flags)

-

-  def GetDescription(self):

-    return 'STAMP $out'

-

-  def GetRspFilePath(self):

-    # A command line only contains one input file.

-    pass

-

-  def GetRspFileContent(self):

-    # A command line only contains one input file.

-    pass

+# Copyright 2018 Google Inc. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Allow to use gyp-win-tool via python as a copy and a stamp tools."""
+
+import sys
+from starboard.tools.toolchain import abstract
+
+
+class Copy(abstract.Copy):
+  """Copies individual files using python.exe."""
+
+  def __init__(self, **kwargs):
+    self._path = kwargs.get('path', sys.executable)
+    self._extra_flags = kwargs.get('extra_flags', [])
+
+  def GetPath(self):
+    return self._path
+
+  def GetExtraFlags(self):
+    return self._extra_flags
+
+  def GetMaxConcurrentProcesses(self):
+    # Run as much concurrent processes as possible.
+    return None
+
+  def GetCommand(self, path, extra_flags, flags, shell):
+    del flags, shell  # Not used.
+    return '{0} {1} $in $out'.format(path, extra_flags)
+
+  def GetDescription(self):
+    return 'COPY $in $out'
+
+  def GetRspFilePath(self):
+    # A command line only contains one input and one output file.
+    pass
+
+  def GetRspFileContent(self):
+    # A command line only contains one input and one output file.
+    pass
+
+
+class Stamp(abstract.Stamp):
+  """Updates the access and modification times of a file to the current time."""
+
+  def __init__(self, **kwargs):
+    self._path = kwargs.get('path', sys.executable)
+    self._extra_flags = kwargs.get('extra_flags', [])
+
+  def GetPath(self):
+    return self._path
+
+  def GetExtraFlags(self):
+    return self._extra_flags
+
+  def GetMaxConcurrentProcesses(self):
+    # Run as much concurrent processes as possible.
+    return None
+
+  def GetCommand(self, path, extra_flags, flags, shell):
+    del flags, shell  # Not used.
+    return '{0} {1} $out'.format(path, extra_flags)
+
+  def GetDescription(self):
+    return 'STAMP $out'
+
+  def GetRspFilePath(self):
+    # A command line only contains one input file.
+    pass
+
+  def GetRspFileContent(self):
+    # A command line only contains one input file.
+    pass
diff --git a/src/testing/gmock/METADATA b/src/testing/gmock/METADATA
new file mode 100644
index 0000000..8f87f92
--- /dev/null
+++ b/src/testing/gmock/METADATA
@@ -0,0 +1,20 @@
+name: "gmock"
+description:
+  "Subtree at testing/gmock."
+
+third_party {
+  url {
+    type: LOCAL_SOURCE
+    value: "/external/gmock_mirror"
+  }
+  url {
+    type: GIT
+    value: "https://github.com/google/googlemock.git"
+  }
+  version: "38513a8bb154f0b6d0a4088814fe92552696d465"
+  last_upgrade_date {
+    year: 2012
+    month: 11
+    day: 15
+  }
+}
diff --git a/src/testing/gtest-parallel/METADATA b/src/testing/gtest-parallel/METADATA
new file mode 100644
index 0000000..e43837d
--- /dev/null
+++ b/src/testing/gtest-parallel/METADATA
@@ -0,0 +1,20 @@
+name: "gtest-parallel"
+description:
+  "Subtree at testing/gtest-parallel."
+
+third_party {
+  url {
+    type: LOCAL_SOURCE
+    value: "/testing/gtest-parallel_mirror"
+  }
+  url {
+    type: GIT
+    value: "https://github.com/google/gtest-parallel.git"
+  }
+  version: "d0cebaba01c5dbf3af8a1c89b64eed7596c2b56c"
+  last_upgrade_date {
+    year: 2016
+    month: 8
+    day: 3
+  }
+}
diff --git a/src/testing/gtest/METADATA b/src/testing/gtest/METADATA
new file mode 100644
index 0000000..6bbeaa9
--- /dev/null
+++ b/src/testing/gtest/METADATA
@@ -0,0 +1,20 @@
+name: "gtest"
+description:
+  "Subtree at testing/gtest."
+
+third_party {
+  url {
+    type: LOCAL_SOURCE
+    value: "/external/gtest_mirror"
+  }
+  url {
+    type: GIT
+    value: "https://github.com/google/googletest.git"
+  }
+  version: "a1c4b46bc2c12ea7c61108f001a5b5eb4a8ccad0"
+  last_upgrade_date {
+    year: 2012
+    month: 7
+    day: 9
+  }
+}
diff --git a/src/third_party/QR-Code-generator/METADATA b/src/third_party/QR-Code-generator/METADATA
new file mode 100644
index 0000000..5c33ade
--- /dev/null
+++ b/src/third_party/QR-Code-generator/METADATA
@@ -0,0 +1,20 @@
+name: "QR-Code-generator"
+description:
+  "Subtree at third_party/QR-Code-generator."
+
+third_party {
+  url {
+    type: LOCAL_SOURCE
+    value: "/third_party/qr-code-generator_mirror"
+  }
+  url {
+    type: GIT
+    value: "https://github.com/nayuki/QR-Code-generator.git"
+  }
+  version: "9728f19f59ce7bfda2601bd14f06ad1b284e2e77"
+  last_upgrade_date {
+    year: 2018
+    month: 2
+    day: 26
+  }
+}
diff --git a/src/third_party/angle/BUILD.gn b/src/third_party/angle/BUILD.gn
index d930bab..42d92c7 100644
--- a/src/third_party/angle/BUILD.gn
+++ b/src/third_party/angle/BUILD.gn
@@ -31,18 +31,19 @@
 
   # Don't build extra (test, samples etc) for Windows UWP. We don't have
   # infrastructure (e.g. windowing helper functions) in place to run them.
-  angle_build_all = !angle_is_winuwp && angle_has_build
+  angle_build_all = !build_with_chromium && !angle_is_winuwp && angle_has_build
 }
 
-if (!build_with_chromium && angle_build_all) {
+if (angle_build_all) {
   group("all") {
     testonly = true
     deps = [
+      ":angle",
       ":angle_shader_translator",
       ":translator_fuzzer",
       ":xxhash_fuzzer",
-      "//samples:all",
-      "//src/tests:all",
+      "$angle_root/samples:angle_samples",
+      "$angle_root/src/tests:angle_tests",
     ]
   }
 }
@@ -449,6 +450,10 @@
     defines += [ "ANGLE_ENABLE_METAL" ]
   }
 
+  if (angle_enable_swiftshader) {
+    defines += [ "ANGLE_ENABLE_SWIFTSHADER" ]
+  }
+
   public_configs += [ ":external_config" ]
 
   deps = [
@@ -549,12 +554,14 @@
     defines += [ "ANGLE_ENABLE_NULL" ]
   }
 
+  configs = []
+
   if (angle_enable_metal) {
-    configs = [ "src/libANGLE/renderer/metal:angle_metal_backend_config" ]
+    configs += [ "src/libANGLE/renderer/metal:angle_metal_backend_config" ]
   }
 
   if (angle_enable_vulkan) {
-    configs = [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend_config" ]
+    configs += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend_config" ]
   }
 }
 
@@ -633,8 +640,10 @@
   ]
 
   if (is_win) {
+    if (angle_enable_d3d9) {
+      libs += [ "delayimp.lib" ]
+    }
     libs += [
-      "delayimp.lib",
       "gdi32.lib",
       "user32.lib",
     ]
@@ -1133,8 +1142,7 @@
     if (is_fuchsia) {
       sources += util_fuchsia_sources
       public_deps += [
-        "$angle_root/src/common/fuchsia_egl",
-        "src/libANGLE/renderer/vulkan:angle_vulkan",
+        "src/common/fuchsia_egl",
         "//third_party/fuchsia-sdk/sdk:async_loop_cpp",
         "//third_party/fuchsia-sdk/sdk:async_loop_default",
         "//third_party/fuchsia-sdk/sdk:fdio",
@@ -1174,7 +1182,6 @@
 
 # Convenience targets for some of the samples so they can be built
 # with Chromium's toolchain.
-
 angle_executable("angle_shader_translator") {
   testonly = true
 
@@ -1295,9 +1302,9 @@
   }
 }
 
-# Note: libGLESv1_CM is not presently included because most Chrome users don't care about it.
 group("angle") {
   data_deps = [
+    ":libGLESv1_CM",
     ":libGLESv2",
     ":libEGL",
   ]
diff --git a/src/third_party/angle/CONTRIBUTORS b/src/third_party/angle/CONTRIBUTORS
index 07ba2b6..c4edc87 100644
--- a/src/third_party/angle/CONTRIBUTORS
+++ b/src/third_party/angle/CONTRIBUTORS
@@ -157,6 +157,7 @@
  Hyunseok Ko
  Jaedon Lee
  Jeff Vigil
+ Kevin Jung
  Kyeongmin Kim
  Minkyu Jeong
  Mohan Maiya
diff --git a/src/third_party/angle/METADATA b/src/third_party/angle/METADATA
new file mode 100644
index 0000000..7d65f1c
--- /dev/null
+++ b/src/third_party/angle/METADATA
@@ -0,0 +1,20 @@
+name: "angle"
+description:
+  "Subtree at third_party/angle."
+
+third_party {
+  url {
+    type: LOCAL_SOURCE
+    value: "/external/angle_mirror"
+  }
+  url {
+    type: GIT
+    value: "https://chromium.googlesource.com/angle/angle"
+  }
+  version: "c1776c61e5c3722cb2de95aac1119289ff822469"
+  last_upgrade_date {
+    year: 2019
+    month: 11
+    day: 20
+  }
+}
diff --git a/src/third_party/angle/android/angle_apk.gni b/src/third_party/angle/android/angle_apk.gni
index 5b9bf20..4207ce2 100644
--- a/src/third_party/angle/android/angle_apk.gni
+++ b/src/third_party/angle/android/angle_apk.gni
@@ -44,14 +44,14 @@
       ]
       if (symbol_level != 0) {
         deps += [ ":compressed_symbols" ]
-        if (build_apk_secondary_abi && android_64bit_target_cpu) {
+        if (android_64bit_target_cpu) {
           deps += [ ":compressed_symbols($android_secondary_abi_toolchain)" ]
         }
       }
 
       uncompress_shared_libraries = true
 
-      if (build_apk_secondary_abi && android_64bit_target_cpu) {
+      if (android_64bit_target_cpu) {
         if (symbol_level == 0) {
           secondary_abi_shared_libraries = []
           foreach(_library, angle_libraries) {
diff --git a/src/third_party/angle/doc/CaptureAndReplay.md b/src/third_party/angle/doc/CaptureAndReplay.md
index 1f84791..25eae75 100644
--- a/src/third_party/angle/doc/CaptureAndReplay.md
+++ b/src/third_party/angle/doc/CaptureAndReplay.md
@@ -68,3 +68,66 @@
 ```
 
 Note that we specify `ANGLE_CAPTURE_ENABLED=0` to prevent re-capturing when running the replay.
+
+## Capturing an Android application
+
+In order to capture on Android, the following additional steps must be taken. These steps
+presume you've built and installed the ANGLE APK with capture enabled, and selected ANGLE
+as the GLES driver for your application.
+
+1. Create the output directory
+
+    Determine your package name:
+    ```
+    export PACKAGE_NAME com.android.gl2jni
+    ```
+    Then create an output directory that it can write to:
+    ```
+    $ adb shell mkdir -p /sdcard/Android/data/$PACKAGE_NAME/angle_capture
+    ```
+
+2. Set properties to use for environment variable
+
+    On Android, it is difficult to set an environment variable before starting native code.
+    To work around this, ANGLE will read debug system properties before starting the capture
+    and use them to prime environment variables used by the capture code.
+
+    Note: Mid-execution capture doesn't work for Android just yet, so frame_start must be
+    zero, which is the default. This it is sufficient to only set the end frame.
+    ```
+    $ adb shell setprop debug.angle.capture.frame_end 200
+    ```
+
+    There are other properties that can be set that match 1:1 with the env vars, but
+    they are not required for capture:
+    ```
+    # Optional
+    $ adb shell setprop debug.angle.capture.enabled 0
+    $ adb shell setprop debug.angle.capture.out_dir foo
+    $ adb shell setprop debug.angle.capture.frame_start 0
+    ```
+
+3.  Run the application, then pull the files to the capture_replay directory
+    ```
+    $ cd samples/capture_replay
+    $ adb pull /sdcard/Android/data/$PACKAGE_NAME/angle_capture replay_files
+    $ cp replay_files/* .
+    ```
+
+4. Update your GN args to specifiy which context will be replayed.
+
+    By default Context ID 1 will be replayed. On Android, Context ID 2 is more typical, some apps
+    we've run go as high as ID 6.
+    Note: this solution is temporary until EGL capture is in place.
+    ```
+    angle_capture_replay_sample_context_id = 2
+    ```
+
+5. Replay the capture on desktop
+
+    Until we have samples building for Android, the replay sample must be run on desktop.
+    We will also be plumbing replay files into perf and correctness tests which will run on Android.
+    ```
+    $ autoninja -C out/Release capture_replay_sample
+    $ out/Release/capture_replay_sample
+    ```
\ No newline at end of file
diff --git a/src/third_party/angle/doc/ContributingCode.md b/src/third_party/angle/doc/ContributingCode.md
index 9a78241..cef5823 100644
--- a/src/third_party/angle/doc/ContributingCode.md
+++ b/src/third_party/angle/doc/ContributingCode.md
@@ -2,112 +2,208 @@
 
 ## Communicate
 
- * Whether you're writing a new feature or fixing an existing bug, it pays to get a second opinion before you get too far. If it's a new feature idea, post to the discussion group ([angleproject](https://groups.google.com/forum/?fromgroups#!forum/angleproject)) and propose it or talk with the ANGLE team on IRC in the #ANGLEproject channel on FreeNode.
- * Not all bugs in our [bug system](https://bugs.chromium.org/p/angleproject/issues/list) are assigned, but if the one you're interested in fixing is, send a note to the person it's assigned to and ask if they would like a patch.
- * Behavior changes and anything nontrivial (i.e. anything other than simple cleanups and style fixes) should generally be tracked in the bug system. Please [file a bug](http://anglebug.com/new) and describe what you're doing if there isn't one already.
- * If you would like bug-editing rights, simply ask a team member via email or the disussion group.
+* Whether you're writing a new feature or fixing an existing bug, it pays to get a second opinion
+  before you get too far. If it's a new feature idea, post to the discussion group
+  ([angleproject][ANGLE-website]) and propose it or talk with the ANGLE team on IRC in the
+  `#ANGLEproject` channel on FreeNode.
+* Not all bugs in our [bug system][anglebug.com] are assigned, but if the one you're interested in
+  fixing is, send a note to the person it's assigned to and ask if they would like a patch.
+* Behavior changes and anything nontrivial (i.e. anything other than simple cleanups and style
+  fixes) should generally be tracked in the bug system. Please [file a bug][anglebug-new] and
+  describe what you're doing if there isn't one already.
+* If you would like bug-editing rights, simply ask a team member via email or the discussion group.
+
+[ANGLE-website]: https://groups.google.com/forum/?fromgroups#!forum/angleproject
+[anglebug.com]: http://anglebug.com
+[anglebug-new]: http://anglebug.com/new
 
 ## Get your code ready
+
 ### Code
- 1. Must conform to the [ANGLE style](CodingStandard.md) guidelines.
- 2. Must be tested. (see the 'Testing' section below)
- 3.  Should be a reasonable size to review.  Giant patches are unlikely to get reviewed quickly.
+
+1. Must conform to the [ANGLE style][ANGLE-style] guidelines.
+2. Must be tested. (see the 'Testing' section below)
+3. Should be a reasonable size to review.  Giant patches are unlikely to get reviewed quickly.
+
+[ANGLE-style]: CodingStandard.md
 
 ### Build maintenance
- 1. If you added or removed source files:
-    * You _must_ update the build files with your changes. See `src/libGLESv2.gni` and `src/compiler.gni`.
- 2. ANGLE's BUILD.gn script is used by [Chromium's gn build](https://www.chromium.org/developers/gn-build-configuration). If you change build files other than to add or remove source files be aware you could break the Chromium build. ANGLE's commit queue (CQ) will detect such breakage. Ask a project member for help with Chromium issues if you don't have a Chromium checkout.
- 3. If you modified `glslang.y` or `glslang.l`:
-    * You _must_ update the bison-generated compiler sources. Download and install the latest 64-bit Bison and flex from official [Cygwin](https://cygwin.com/install.html) on _Windows_. From the Cygwin shell run `generate_parser.sh` in `src/compiler/translator` and update your CL. Do not edit the generated files by hand.
-    * _NOTE:_ You can ignore failing chunk messages if there are no compile errors.
-    * If you modified `ExpressionParser.y` or `Tokenizer.l`, follow the same process by running `src/compiler/preprocessor/generate_parser.sh`.
+
+1. If you added or removed source files:
+   * You _must_ update the build files with your changes. See `src/libGLESv2.gni` and
+   `src/compiler.gni`.
+2. ANGLE's BUILD.gn script is used by [Chromium's gn build][gn-build-config]. If you change build
+   files other than to add or remove source files be aware you could break the Chromium build.
+   ANGLE's commit queue (CQ) will detect such breakage. Ask a project member for help with Chromium
+   issues if you don't have a Chromium checkout.
+3. Some generated code is baked into the repository. If you modify the source of these files, such
+   as the translator's `glslang.l`, or one of the internal shaders in the Vulkan backend, you will
+   need to run `scripts/run_code_generation.py` and include the autogenerated files in your change.
+   `git cl upload` should warn you if you are missing this step.
+    * Note that updating the translator's lexer and parser (using `flex` and `bison`) is only
+      supported on Linux and Windows.
+
+[gn-build-config]: https://www.chromium.org/developers/gn-build-configuration
 
 ### Testing
- * ANGLE uses trybots to test on a variety of platforms. Please run your changes against our bots and check the results before landing changes or requesting reviews.
-    * Upload your change (see [Making changes](#making-changes)).
-    * To kick of a try job, use the 'CQ Dry Run' button, or set the Commit-Queue +1 label to trigger a dry run of the CQ (will not land the change).
-    * If you are not part of the `angle-committers` group, you will need to either ask to be added or ask a member of the group to submit the tryjob for you. Add jmadill or geofflang as a reviewer for assistance.
-    * Wait for the bots to report the result on the code review page. The bot results should be visible in Gerrit as yellow (in-progress), green (passed), or red (failed). This can take up to two hours for some of the debug bots. Click on the colored rectangle to open the bot log to triage failed tests.
-    * If a failure is unexpected, or seems likely unrelated to your change, ask an ANGLE project member for advice.
-    * We do not currently have the capability to run individual bots or tests in a run.
- * Tests can also be run locally, ANGLE's main testing methods are:
-    * `angle_unittests`, `angle_end2end_tests` and `angle_white_box_tests` targets.
-    * The [Top-of-Tree WebGL Conformance tests](https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html).
-      * If you are a Chromium developer, see [Building ANGLE for Chromium Development](BuildingAngleForChromiumDevelopment.md) for instructions on building ANGLE within Chromium.
-      * If you aren't a browser developer, you should be able to drop your compiled DLLs into a Chrome installation, in place of those distributed with Chrome, to check WebGL conformance. [Chrome Canary](https://www.google.com/chrome/browser/canary.html) is well-suited for this.
-    * If your code isn't covered by an existing test, you are *strongly encouraged* to add new test coverage. This both ensures that your code is correct and that new contributors won't break it in the future.
-    * Add new tests to `angle_end2end_tests` for OpenGL-based API tests, `angle_unittests` for cross-platform internal tests, and `angle_white_box_tests` for rendering tests which also need visibility into internal ANGLE classes.
-   * If you are submitting a performance fix, test your code with `angle_perftests` and add a new performance test if it is not covered by the existing benchmarks. For more documentation on `angle_perftests` see the [README](../src/tests/perf_tests/README.md).
-   * The [Chromium GPU FYI bot waterfall](http://build.chromium.org/p/chromium.gpu.fyi/console) provides continuous integration for ANGLE patches that have been committed.  There may be hardware configurations that are not tested by the ANGLE trybots, if you notice breakage on this waterfall after landing a patch, please notify a project member.
-   * ANGLE also includes the [drawElements Quality Program (dEQP)](dEQP.md) for additional testing. If you're working on a new feature, there may be some extensive tests for it already written.
+
+* ANGLE uses trybots to test on a variety of platforms. Please run your changes against our bots
+  and check the results before landing changes or requesting reviews.
+   * Upload your change (see [Making changes](#making-changes)).
+   * To kick off a try job, use the 'CQ Dry Run' button, or set the Commit-Queue +1 label to trigger
+     a dry run of the CQ (will not land the change).
+   * If you are not part of the `angle-committers` group, you will need to either ask to be added or
+     ask a member of the group to submit the tryjob for you. Add jmadill or geofflang as a reviewer
+     for assistance.
+   * Wait for the bots to report the result on the code review page. The bot results should be
+     visible in Gerrit as yellow (in-progress), green (passed), or red (failed). This can take up to
+     two hours for some of the debug bots. Click on the colored rectangle to open the bot log to
+     triage failed tests.
+   * If a failure is unexpected, or seems likely unrelated to your change, ask an ANGLE project
+     member for advice.
+   * We do not currently have the capability to run individual bots or tests in a run.
+* Tests can also be run locally, ANGLE's main testing methods are:
+   * `angle_unittests`, `angle_end2end_tests` and `angle_white_box_tests` targets.
+   * The [Top-of-Tree WebGL Conformance tests][WebGL-CTS].
+     * If you are a Chromium developer, see
+       [Building ANGLE for Chromium Development][build-ANGLE-for-chromium] for instructions on
+       building ANGLE within Chromium.
+     * If you aren't a browser developer, you should be able to drop your compiled DLLs into a
+       Chrome installation, in place of those distributed with Chrome, to check WebGL conformance.
+       [Chrome Canary][Chrome-Canary] is well-suited for this.
+   * If your code isn't covered by an existing test, you are *strongly encouraged* to add new test
+     coverage. This both ensures that your code is correct and that new contributors won't break it
+     in the future.
+   * Add new tests to `angle_end2end_tests` for OpenGL-based API tests, `angle_unittests` for
+     cross-platform internal tests, and `angle_white_box_tests` for rendering tests which also need
+     visibility into internal ANGLE classes.
+  * If you are submitting a performance fix, test your code with `angle_perftests` and add a new
+    performance test if it is not covered by the existing benchmarks. For more documentation on
+    `angle_perftests` see the [README][README].
+  * The [Chromium GPU FYI bot waterfall][Chromium-waterfall] provides continuous integration for
+    ANGLE patches that have been committed.  There may be hardware configurations that are not
+    tested by the ANGLE trybots, if you notice breakage on this waterfall after landing a patch,
+    please notify a project member.
+  * ANGLE also includes the [drawElements Quality Program (dEQP)](dEQP.md) for additional testing.
+    If you're working on a new feature, there may be some extensive tests for it already written.
+
+[WebGL-CTS]: https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html
+[build-ANGLE-for-Chromium]: BuildingAngleForChromiumDevelopment.md
+[Chrome-Canary]: https://www.google.com/chrome/browser/canary.html
+[README]: ../src/tests/perf_tests/README.md
+[Chromium-waterfall]: https://ci.chromium.org/p/chromium/g/chromium.gpu.fyi/console
 
 ### Legal
- 1. You must complete the [Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual). You can do this online, and it only takes a minute. If you are contributing on behalf of a corporation, you must fill out the [Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate) and send it to Google as described on that page.
- 2. Once you've submitted the CLA, please email the following information (as entered on the CLA) to `shannonwoods at chromium dot org` for record keeping purposes:
-    * Full Name:
-    * Email:
-    * Company (If applicable):
- 3. If you've never submitted code before, you must add your (or your organization's) name and contact info to the [AUTHORS](../AUTHORS) file.
- 4. *NOTE TO REVIEWERS*: Follow the [External Contributor Checklist](http://www.chromium.org/developers/contributing-code/external-contributor-checklist).
+
+1. You must complete the [Individual Contributor License Agreement][Individual-CLA]. You can do this
+   online, and it only takes a minute. If you are contributing on behalf of a corporation, you must
+   fill out the [Corporate Contributor License Agreement][Corporate-CLA] and send it to Google as
+   described on that page.
+2. Once you've submitted the CLA, please email the following information (as entered on the CLA) to
+   `shannonwoods at chromium dot org` for record keeping purposes:
+   * Full Name:
+   * Email:
+   * Company (If applicable):
+3. If you've never submitted code before, you must add your (or your organization's) name and
+   contact info to the [AUTHORS](../AUTHORS) file.
+4. *NOTE TO REVIEWERS*: Follow the [External Contributor Checklist][Contributor-checklist].
+
+[Individual-CLA]: https://cla.developers.google.com/about/google-individual
+[Corporate-CLA]: https://cla.developers.google.com/about/google-corporate
+[Contributor-checklist]: http://www.chromium.org/developers/contributing-code/external-contributor-checklist
 
 ## Life of a Change List
 
 ### Getting started with Gerrit for ANGLE
-  1. Go to [https://chromium-review.googlesource.com/new-password](https://chromium-review.googlesource.com/new-password)
-  2. Log in with the email you use for your git commits.
-  3. Follow the directions on the new-password page to set up authentication with your Google account.
-  4. Make sure to set your real name.
-     * Visit [https://chromium-review.googlesource.com/#/settings](https://chromium-review.googlesource.com/#/settings) and check the "Full Name" field.
-  5. Check out the repository (see [DevSetup](DevSetup.md)).
-  6. Install the Gerrit `commit_msg` hook
-     * Gerrit requires a hook to append a change ID tag to each commit, so that it can associate your CL with a particular review, and track dependencies between commits.
-     * Download the hook from [https://chromium-review.googlesource.com/tools/hooks/commit-msg](https://chromium-review.googlesource.com/tools/hooks/commit-msg) and copy this file to `.git/hooks/commit-msg` within your local repository. On non-Windows, platforms, ensure that permissions are set to allow execution.
-     * *BE AWARE:* Some patch management tools, such as StGit, currently bypass git hooks. They should not currently be used with changes intended for review.
+
+1. Go to [https://chromium-review.googlesource.com/new-password][CR-passwd]
+2. Log in with the email you use for your git commits.
+3. Follow the directions on the new-password page to set up authentication with your Google account.
+4. Make sure to set your real name.
+   * Visit [https://chromium-review.googlesource.com/#/settings][CR-settings] and check the "Full
+     Name" field.
+5. Check out the repository (see [DevSetup](DevSetup.md)).
+6. Install the Gerrit `commit_msg` hook
+   * Gerrit requires a hook to append a change ID tag to each commit, so that it can associate your
+     CL with a particular review, and track dependencies between commits.
+   * Download the hook from
+     [https://chromium-review.googlesource.com/tools/hooks/commit-msg][commit-msg-hook] and copy
+     this file to `.git/hooks/commit-msg` within your local repository. On non-Windows, platforms,
+     ensure that permissions are set to allow execution.
+   * *BE AWARE:* Some patch management tools, such as StGit, currently bypass git hooks. They should
+     not currently be used with changes intended for review.
+
+[CR-passwd]: https://chromium-review.googlesource.com/new-password
+[CR-settings]: https://chromium-review.googlesource.com/#/settings
+[commit-msg-hook]: https://chromium-review.googlesource.com/tools/hooks/commit-msg
 
 ### Making changes
- 1. Commit your changes locally:
-    * `git add src/../FileName.cpp`
-    * `git commit`
-    * A text editor will open. Add a description at the top of the file.
-       * If your changes are associated with an issue in the issue tracker (e.g. a fix for a reported bug), please associate the CL with that issue by adding the following line to the commit message: `BUG=angleproject:<issue number>`.
-    * Save.
-    * Close the text editor.
-    * Use `git commit --amend` to update your CL with new changes.
-    * Use `git cl format` to amend the style of your CL. This saves both your time and the reviewers'!
- 2. Ensure your code is landed on top of latest changes
-    * `git pull --rebase`
-    * Resolve conflicts if necessary
- 3. Upload the change list
-    * `git cl upload`
-    * The change list and modified files will be uploaded to
-      [ANGLE Gerrit](https://chromium-review.googlesource.com/q/project:angle/angle).
-    * Follow the generated URL to the new issue.
-    * Take a moment to perform a self-review of your code. Gerrit's viewer makes it easy to see whitespace errors, erroneous tabs, and other simple style problems.
-    * [Select reviewers](#selecting-reviewers).  If you don't do this, reviewers may not realize you're requesting a review!
-    * Make changes, upload and repeat as necessary.
-    * Project members and others will review your code as described in the [CodeReviewProcess](CodeReviewProcess.md).
- 5. If your change list needs revision:
-    * If you have correctly installed the commit hook from the section above, Gerrit will be able to track your changes by Change-Id.
-    * You should need only to update your commit with `git commit --amend` and re-upload with `git cl upload`.
- 6. Landing change after it receives +2 Code Review:
-    * If you are a committer, you may submit the change yourself via the Gerrit web interface.
-    * If you are not a committer, ask your reviewer to submit the change list.
- 7. Pull and integrate reviewed CL:
-    * `git pull --rebase`
+
+1. Commit your changes locally:
+   * `git add src/../FileName.cpp`
+   * `git commit`
+   * A text editor will open. Add a description at the top of the file.
+      * If your changes are associated with an issue in the issue tracker (e.g. a fix for a reported
+        bug), please associate the CL with that issue by adding the following line to the commit
+        message: `Bug: angleproject:<issue number>`.
+   * Save.
+   * Close the text editor.
+   * Use `git commit --amend` to update your CL with new changes.
+   * Use `git cl format` to amend the style of your CL. This saves both your time and the reviewers'!
+2. Ensure your code is landed on top of latest changes
+   * `git pull --rebase`
+   * Resolve conflicts if necessary
+3. Upload the change list
+   * `git cl upload`
+   * The change list and modified files will be uploaded to [ANGLE Gerrit][ANGLE-Gerrit].
+   * Follow the generated URL to the new issue.
+   * Take a moment to perform a self-review of your code. Gerrit's viewer makes it easy to see
+     whitespace errors, erroneous tabs, and other simple style problems.
+   * [Select reviewers](#selecting-reviewers).  If you don't do this, reviewers may not realize
+     you're requesting a review!
+   * Make changes, upload and repeat as necessary.
+   * Project members and others will review your code as described in the
+     [CodeReviewProcess](CodeReviewProcess.md).
+5. If your change list needs revision:
+   * If you have correctly installed the commit hook from the section above, Gerrit will be able to
+     track your changes by Change-Id.
+   * You should need only to update your commit with `git commit --amend` and re-upload with
+     `git cl upload`.
+6. Landing change after it receives +2 Code Review:
+   * If you are a committer, you may submit the change yourself via the Gerrit web interface.
+   * If you are not a committer, ask your reviewer to submit the change list.
+7. Pull and integrate reviewed CL:
+   * `git pull --rebase`
+
+[ANGLE-Gerrit]: https://chromium-review.googlesource.com/q/project:angle/angle
 
 ### Selecting reviewers
-When your CL is ready to review, add any of the following reviewers. They will be able to route your CL to additional reviewers as neccssary and answer any questions you may have about the process. All non-trival CLs should be reviewed by two reviewers.
- * `geofflang at chromium dot org`
- * `jmadill at chromium dot org`
- * `syoussefi at chromium dot org`
- * `ynovikov at chromium dot org`
+
+When your CL is ready to review, add any of the following reviewers. They will be able to route your
+CL to additional reviewers as neccessary and answer any questions you may have about the process. All
+non-trival CLs should be reviewed by two reviewers.
+
+* `geofflang at chromium dot org`
+* `jmadill at chromium dot org`
+* `syoussefi at chromium dot org`
+* `ynovikov at chromium dot org`
 
 ### Committer status
-Similar to [Chromium's committer status](https://dev.chromium.org/getting-involved/become-a-committer), long-term contributors to the ANGLE project may request to join the `angle-committers` group.  This allows you to give `+2` on code reviews and land patches without assistance.  After about 6 months of regular contributions, you may request committer status from a core ANGLE team member via email or code review.  Chromium committers may ask at any time.
+
+Similar to [Chromium's committer status][Committer-status], long-term contributors to the ANGLE
+project may request to join the `angle-committers` group.  This allows you to give `+2` on code
+reviews and land patches without assistance.  After about 6 months of regular contributions, you may
+request committer status from a core ANGLE team member via email or code review.  Chromium
+committers may ask at any time.
 
 See also:
 
-* [ANGLE Gerrit](https://chromium-review.googlesource.com/q/project:angle/angle)
-* [Chromium Projects: Contributing Code](http://www.chromium.org/developers/contributing-code/)
-* [depot_tools tutorial](http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html)
-* [angle_perftests README](../src/tests/perf_tests/README.md)
+* [ANGLE Gerrit][ANGLE-Gerrit]
+* [Chromium Projects: Contributing Code][Contributing-code]
+* [depot_tools tutorial][depot-tools-tutorial]
+* [angle_perftests README][Perftest-README]
+
+[Committer-status]: https://dev.chromium.org/getting-involved/become-a-committer
+[Contributing-code]: http://www.chromium.org/developers/contributing-code/
+[depot-tools-tutorial]: http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html
+[Perftest-README]: ../src/tests/perf_tests/README.md
diff --git a/src/third_party/angle/doc/DevSetup.md b/src/third_party/angle/doc/DevSetup.md
index f00abc0..8866480 100644
--- a/src/third_party/angle/doc/DevSetup.md
+++ b/src/third_party/angle/doc/DevSetup.md
@@ -20,8 +20,6 @@
  * [Visual Studio Community 2019](https://visualstudio.microsoft.com/vs/)
  * [Windows 10 Standalone SDK version 10.0.17134 exactly](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk).
    * Comes with additional features that aid development, such as the Debug runtime for D3D11. Required for the D3D Compiler DLL.
- * (optional) [Cygwin's Bison, flex, and patch](https://cygwin.com/setup-x86_64.exe)
-   * This is only required if you need to modify GLSL ES grammar files (`glslang.l` and `glslang.y` under `src/compiler/translator`, or `ExpressionParser.y` and `Tokenizer.l` in `src/compiler/preprocessor`).
  * (optional) See the [Chromium Windows build instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md) for more info.
 
 On Linux:
diff --git a/src/third_party/angle/doc/dEQP.md b/src/third_party/angle/doc/dEQP.md
index 0d04869..a7cbdf5 100644
--- a/src/third_party/angle/doc/dEQP.md
+++ b/src/third_party/angle/doc/dEQP.md
@@ -47,7 +47,7 @@
   * `--deqp-egl-display-type=angle-gl` for OpenGL Desktop (OSX, Linux and Windows)
   * `--deqp-egl-display-type=angle-gles` for OpenGL ES (Android/ChromeOS, some Windows platforms)
   * `--deqp-egl-display-type=angle-vulkan` for Vulkan (Android, Linux, Windows)
-  * `--deqp-egl-display-type=angle-swiftshader` for Vulkan with SwiftShader as driver (Android, Linux, Windows)
+  * `--deqp-egl-display-type=angle-swiftshader` for Vulkan with SwiftShader as driver (Android, Linux, Mac, Windows)
 
 The flag `--use-angle=X` has the same effect as `--deqp-egl-display-type=angle-X`.
 
diff --git a/src/third_party/angle/gni/angle.gni b/src/third_party/angle/gni/angle.gni
index 6fc1764..5b55768 100644
--- a/src/third_party/angle/gni/angle.gni
+++ b/src/third_party/angle/gni/angle.gni
@@ -93,10 +93,10 @@
   # Vulkan Validation Layers compatibility issues, see http://crrev/c/1405714.
   # Otherwise, API level 24 would have been enough.
   angle_enable_vulkan =
-      angle_has_build &&
-      ((is_win && !angle_is_winuwp) ||
-       (is_linux && angle_use_x11 && !is_chromeos) ||
-       (is_android && ndk_api_level_at_least_26) || is_fuchsia || is_ggp)
+      angle_has_build && ((is_win && !angle_is_winuwp) ||
+                          (is_linux && angle_use_x11 && !is_chromeos) ||
+                          (is_android && ndk_api_level_at_least_26) ||
+                          is_fuchsia || is_ggp || is_mac)
   angle_enable_null = true
   angle_enable_essl = true
   angle_enable_glsl = true
@@ -106,14 +106,21 @@
 }
 
 declare_args() {
+  # Currently SwiftShader's Vulkan front-end doesn't build on Android.
+  # SwiftShader is not needed on Fuchsia because Vulkan is supported on all
+  # devices that run Fuchsia.
+  angle_enable_swiftshader =
+      angle_enable_vulkan && !is_android && !is_fuchsia && !is_ggp
+
   angle_enable_gl_null = angle_enable_gl
   angle_enable_hlsl = angle_enable_d3d9 || angle_enable_d3d11
   angle_enable_trace = false
 
   # Disable the layers in ubsan builds because of really slow builds.
+  # TODO(anglebug.com/4082) enable validation layers on mac for swiftshader
   angle_enable_vulkan_validation_layers =
       angle_enable_vulkan && !is_ubsan && !is_tsan && !is_asan &&
-      (is_debug || dcheck_always_on)
+      (is_debug || dcheck_always_on) && !is_mac
 
   # Disable overlay by default
   angle_enable_overlay = false
@@ -140,7 +147,13 @@
 
   # Disabled to enable better stack traces.
   if (angle_better_stack_traces) {
-    angle_remove_configs += [ "//build/config/gcc:symbol_visibility_hidden" ]
+    # This line causes in-class-inline-functions in glslang to be weak symbols.  The KHR dEQP tests
+    # link against glslang as well as libGLESv2.so, resulting in angle_deqp_khr_gles*_tests to link
+    # those weak symbols.  Due to glslang's usage of a global variable in InitializeDll.cpp, a bug
+    # is created where ANGLE sometimes calls into its own copy of glslang and sometimes the KHR
+    # dEQP's version, with the two copies of the global variable being inconsistent.
+    # Commented out until the underlying issue is resolved.  http://anglebug.com/4123
+    # angle_remove_configs += [ "//build/config/gcc:symbol_visibility_hidden" ]
   }
 }
 
diff --git a/src/third_party/angle/include/GLES2/gl2ext_explicit_context_autogen.inc b/src/third_party/angle/include/GLES2/gl2ext_explicit_context_autogen.inc
index 75f663a..1fe03d2 100644
--- a/src/third_party/angle/include/GLES2/gl2ext_explicit_context_autogen.inc
+++ b/src/third_party/angle/include/GLES2/gl2ext_explicit_context_autogen.inc
@@ -172,8 +172,14 @@
 typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLint first, GLsizei count, GLsizei primcount);
 typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLint start, GLsizei count, GLsizei primcount);
 typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLenum *bufs);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
 typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
 typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
 typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLeglImageOES image);
 typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLeglImageOES image);
 typedef void (GL_APIENTRYP PFNGLENDQUERYEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target);
@@ -225,6 +231,7 @@
 typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
 typedef void (GL_APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRCONTEXTANGLEPROC)(GLeglContext ctx, GLuint count);
 typedef void (GL_APIENTRYP PFNGLMEMORYOBJECTPARAMETERIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint memoryObject, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
 typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRCONTEXTANGLEPROC)(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
 typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRCONTEXTANGLEPROC)(GLeglContext ctx, const void *ptr, GLsizei length, const GLchar *label);
 typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRCONTEXTANGLEPROC)(GLeglContext ctx);
@@ -540,8 +547,14 @@
 GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLEContextANGLE(GLeglContext ctx, GLenum mode, GLint first, GLsizei count, GLsizei primcount);
 GL_APICALL void GL_APIENTRY glDrawArraysInstancedEXTContextANGLE(GLeglContext ctx, GLenum mode, GLint start, GLsizei count, GLsizei primcount);
 GL_APICALL void GL_APIENTRY glDrawBuffersEXTContextANGLE(GLeglContext ctx, GLsizei n, const GLenum *bufs);
+GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexEXTContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexOESContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
 GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLEContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexEXTContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
+GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexOESContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
 GL_APICALL void GL_APIENTRY glDrawElementsInstancedEXTContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexEXTContextANGLE(GLeglContext ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
+GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexOESContextANGLE(GLeglContext ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
 GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOESContextANGLE(GLeglContext ctx, GLenum target, GLeglImageOES image);
 GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOESContextANGLE(GLeglContext ctx, GLenum target, GLeglImageOES image);
 GL_APICALL void GL_APIENTRY glEndQueryEXTContextANGLE(GLeglContext ctx, GLenum target);
@@ -593,6 +606,7 @@
 GL_APICALL void *GL_APIENTRY glMapBufferRangeEXTContextANGLE(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
 GL_APICALL void GL_APIENTRY glMaxShaderCompilerThreadsKHRContextANGLE(GLeglContext ctx, GLuint count);
 GL_APICALL void GL_APIENTRY glMemoryObjectParameterivEXTContextANGLE(GLeglContext ctx, GLuint memoryObject, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXTContextANGLE(GLeglContext ctx, GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
 GL_APICALL void GL_APIENTRY glObjectLabelKHRContextANGLE(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
 GL_APICALL void GL_APIENTRY glObjectPtrLabelKHRContextANGLE(GLeglContext ctx, const void *ptr, GLsizei length, const GLchar *label);
 GL_APICALL void GL_APIENTRY glPopDebugGroupKHRContextANGLE(GLeglContext ctx);
diff --git a/src/third_party/angle/include/GLSLANG/ShaderLang.h b/src/third_party/angle/include/GLSLANG/ShaderLang.h
index 964e937..22fdf33 100644
--- a/src/third_party/angle/include/GLSLANG/ShaderLang.h
+++ b/src/third_party/angle/include/GLSLANG/ShaderLang.h
@@ -26,7 +26,7 @@
 
 // Version number for shader translation API.
 // It is incremented every time the API changes.
-#define ANGLE_SH_VERSION 218
+#define ANGLE_SH_VERSION 219
 
 enum ShShaderSpec
 {
@@ -693,6 +693,7 @@
 GLenum GetGeometryShaderOutputPrimitiveType(const ShHandle handle);
 int GetGeometryShaderInvocations(const ShHandle handle);
 int GetGeometryShaderMaxVertices(const ShHandle handle);
+unsigned int GetShaderSharedMemorySize(const ShHandle handle);
 
 //
 // Helper function to identify specs that are based on the WebGL spec.
diff --git a/src/third_party/angle/include/GLSLANG/ShaderVars.h b/src/third_party/angle/include/GLSLANG/ShaderVars.h
index e2a67a2..52f6ad0 100644
--- a/src/third_party/angle/include/GLSLANG/ShaderVars.h
+++ b/src/third_party/angle/include/GLSLANG/ShaderVars.h
@@ -100,6 +100,8 @@
     // ARRAY_SIZE value that can be queried through the API.
     unsigned int getBasicTypeElementCount() const;
 
+    unsigned int getExternalSize() const;
+
     bool isStruct() const { return !fields.empty(); }
 
     // All of the shader's variables are described using nested data
diff --git a/src/third_party/angle/infra/ANGLEWrangling.md b/src/third_party/angle/infra/ANGLEWrangling.md
index 3763ee6..f40ebc1 100644
--- a/src/third_party/angle/infra/ANGLEWrangling.md
+++ b/src/third_party/angle/infra/ANGLEWrangling.md
@@ -77,13 +77,20 @@
 
 We also use additional auto-rollers to roll third party libraries into ANGLE once per day:
 
- * [SPIRV-Tools into ANGLE](https://autoroll.skia.org/r/spirv-tools-angle-autoroll),
- * [glslang into ANGLE](https://autoroll.skia.org/r/glslang-angle-autoroll) and
+ * [SPIRV-Tools into ANGLE](https://autoroll.skia.org/r/spirv-tools-angle-autoroll)
+ * [glslang into ANGLE](https://autoroll.skia.org/r/glslang-angle-autoroll)
  * [SwiftShader into ANGLE](https://autoroll.skia.org/r/swiftshader-angle-autoroll)
+ * [Vulkan-Tools into ANGLE](https://autoroll.skia.org/r/vulkan-tools-angle-autoroll)
+ * [Vulkan-Loader into ANGLE](https://autoroll.skia.org/r/vulkan-loader-angle-autoroll)
+ * [Vulkan-Headers into ANGLE](https://autoroll.skia.org/r/vulkan-headers-angle-autoroll)
+ * [Vulkan-ValidationLayers into ANGLE](https://autoroll.skia.org/r/vulkan-validation-layers-angle-autoroll)
 
 Please ensure these rollers are also healthy and unblocked. You can trigger manual rolls using the dashboards
 to land high-priority changes.
 
+The autoroller configurations live in the [skia/buildbot repository](https://skia.googlesource.com/buildbot/)
+in the [autoroll/config](https://skia.googlesource.com/buildbot/+/master/autoroll/config) folder.
+
 ## Task 4: ANGLE Standalone Testing
 
 See more detailed instructions on by following [this link](README.md).
diff --git a/src/third_party/angle/samples/BUILD.gn b/src/third_party/angle/samples/BUILD.gn
index f394d55..020b05f 100644
--- a/src/third_party/angle/samples/BUILD.gn
+++ b/src/third_party/angle/samples/BUILD.gn
@@ -7,16 +7,9 @@
 declare_args() {
   # Determines if we build the capture_replay sample. Off by default.
   angle_build_capture_replay_sample = false
-}
 
-angle_executable("shader_translator") {
-  sources = [
-    "shader_translator/shader_translator.cpp",
-  ]
-  include_dirs = [ "../include" ]
-  deps = [
-    "../:translator",
-  ]
+  # Decide which context to replay, starting with desktop default
+  angle_capture_replay_sample_context_id = 1
 }
 
 config("sample_util_config") {
@@ -228,22 +221,31 @@
   # To use the capture replay sample first move your capture sources into
   # the capture_replay folder and enable the gn arg above.
   angle_sample("capture_replay_sample") {
+    _contextid = angle_capture_replay_sample_context_id
     sources =
-        rebase_path(read_file("capture_replay/angle_capture_context1_files.txt",
-                              "list lines"), ".", "capture_replay") +
+        rebase_path(
+            read_file(
+                "capture_replay/angle_capture_context${_contextid}_files.txt",
+                "list lines"),
+            ".",
+            "capture_replay") +
         [
           "capture_replay/CaptureReplay.cpp",
-          "capture_replay/angle_capture_context1.cpp",
-          "capture_replay/angle_capture_context1.h",
+          "capture_replay/angle_capture_context${_contextid}.cpp",
+          "capture_replay/angle_capture_context${_contextid}.h",
         ]
 
     _data_path = rebase_path("capture_replay", root_out_dir)
-    defines = [ "ANGLE_CAPTURE_REPLAY_SAMPLE_DATA_DIR=\"${_data_path}\"" ]
+    defines = [
+      "ANGLE_CAPTURE_REPLAY_SAMPLE_DATA_DIR=\"${_data_path}\"",
+      "ANGLE_CAPTURE_REPLAY_SAMPLE_CONTEXT_ID=${_contextid}",
+      "ANGLE_CAPTURE_REPLAY_SAMPLE_HEADER=angle_capture_context${_contextid}.h",
+    ]
     suppressed_configs = [ "$angle_root:constructor_and_destructor_warnings" ]
   }
 }
 
-group("all") {
+group("angle_samples") {
   testonly = true
   deps = [
     ":gles1_draw_texture",
diff --git a/src/third_party/angle/samples/capture_replay/CaptureReplay.cpp b/src/third_party/angle/samples/capture_replay/CaptureReplay.cpp
index be6de16..c282476 100644
--- a/src/third_party/angle/samples/capture_replay/CaptureReplay.cpp
+++ b/src/third_party/angle/samples/capture_replay/CaptureReplay.cpp
@@ -7,7 +7,24 @@
 
 #include "SampleApplication.h"
 
-#include "angle_capture_context1.h"
+#include <functional>
+
+#define ANGLE_MACRO_STRINGIZE_AUX(a) #a
+#define ANGLE_MACRO_STRINGIZE(a) ANGLE_MACRO_STRINGIZE_AUX(a)
+#define ANGLE_MACRO_CONCAT_AUX(a, b) a##b
+#define ANGLE_MACRO_CONCAT(a, b) ANGLE_MACRO_CONCAT_AUX(a, b)
+
+// Build the right context header based on replay ID
+// This will expand to "angle_capture_context<#>.h"
+#include ANGLE_MACRO_STRINGIZE(ANGLE_CAPTURE_REPLAY_SAMPLE_HEADER)
+
+// Assign the context numbered functions based on GN arg selecting replay ID
+std::function<void()> SetupContextReplay = reinterpret_cast<void (*)()>(
+    ANGLE_MACRO_CONCAT(SetupContext,
+                       ANGLE_MACRO_CONCAT(ANGLE_CAPTURE_REPLAY_SAMPLE_CONTEXT_ID, Replay)));
+std::function<void(int)> ReplayContextFrame = reinterpret_cast<void (*)(int)>(
+    ANGLE_MACRO_CONCAT(ReplayContext,
+                       ANGLE_MACRO_CONCAT(ANGLE_CAPTURE_REPLAY_SAMPLE_CONTEXT_ID, Frame)));
 
 class CaptureReplaySample : public SampleApplication
 {
@@ -23,7 +40,7 @@
         if (!angle::SetCWD(exeDir.c_str()))
             return false;
         SetBinaryDataDir(ANGLE_CAPTURE_REPLAY_SAMPLE_DATA_DIR);
-        SetupContext1Replay();
+        SetupContextReplay();
 
         eglSwapInterval(getDisplay(), 1);
         return true;
@@ -36,7 +53,7 @@
         // Compute the current frame, looping from kReplayFrameStart to kReplayFrameEnd.
         uint32_t frame =
             kReplayFrameStart + (mCurrentFrame % (kReplayFrameEnd - kReplayFrameStart));
-        ReplayContext1Frame(frame);
+        ReplayContextFrame(frame);
         mCurrentFrame++;
     }
 
diff --git a/src/third_party/angle/scripts/code_generation_hashes/ANGLE_shader_preprocessor.json b/src/third_party/angle/scripts/code_generation_hashes/ANGLE_shader_preprocessor.json
new file mode 100644
index 0000000..99a7154
--- /dev/null
+++ b/src/third_party/angle/scripts/code_generation_hashes/ANGLE_shader_preprocessor.json
@@ -0,0 +1,28 @@
+{
+  "src/compiler/preprocessor/generate_parser.py":
+    "cc871de99688a35bfe32ef501f965d5a",
+  "src/compiler/preprocessor/preprocessor.l":
+    "143dec2269b9a49a9588391bb57580ec",
+  "src/compiler/preprocessor/preprocessor.y":
+    "a3a7dcbf9fd1cf1721ab635cea0189b2",
+  "src/compiler/preprocessor/preprocessor_lex_autogen.cpp":
+    "5e2dd7b0f74393db96ca6d9b0adeae0b",
+  "src/compiler/preprocessor/preprocessor_tab_autogen.cpp":
+    "1faa877557cf67e564cabc547aa3f3c0",
+  "tools/flex-bison/linux/bison.sha1":
+    "efa86001f00e7bcfdbe899dd15fc88e0",
+  "tools/flex-bison/linux/flex.sha1":
+    "3e73ddbd801cf3e8ed759c49572c8bf2",
+  "tools/flex-bison/windows/bison.exe.sha1":
+    "ad6345f2fbf1112bae67f0d54a92e574",
+  "tools/flex-bison/windows/flex.exe.sha1":
+    "45668fa0dafd4a7e68c2b0480e50e650",
+  "tools/flex-bison/windows/m4.exe.sha1":
+    "0e0332c889b12576458bc481f34d6142",
+  "tools/flex-bison/windows/msys-2.0.dll.sha1":
+    "59854139bd445e5193812e2b910dc7b5",
+  "tools/flex-bison/windows/msys-iconv-2.dll.sha1":
+    "5da154b537d340991bb4cd06eca6d523",
+  "tools/flex-bison/windows/msys-intl-8.dll.sha1":
+    "3b5cd216061b9dff4d2ae3956bc344a8"
+}
\ No newline at end of file
diff --git a/src/third_party/angle/scripts/code_generation_hashes/ANGLE_shader_translator.json b/src/third_party/angle/scripts/code_generation_hashes/ANGLE_shader_translator.json
new file mode 100644
index 0000000..196a335
--- /dev/null
+++ b/src/third_party/angle/scripts/code_generation_hashes/ANGLE_shader_translator.json
@@ -0,0 +1,30 @@
+{
+  "src/compiler/translator/generate_parser.py":
+    "566178ecdfae3a29803b3687fc518ebb",
+  "src/compiler/translator/glslang.l":
+    "75adc098def35a464dfb5ca1a0e99799",
+  "src/compiler/translator/glslang.y":
+    "7b6b24685a467cbb7f50dc62176c2fef",
+  "src/compiler/translator/glslang_lex_autogen.cpp":
+    "5f55ca207583009489d136e47c71beb5",
+  "src/compiler/translator/glslang_tab_autogen.cpp":
+    "050bddb6103769b9e55f7fe62972ac86",
+  "src/compiler/translator/glslang_tab_autogen.h":
+    "4133ae84a4c17051cf114f404fea0046",
+  "tools/flex-bison/linux/bison.sha1":
+    "efa86001f00e7bcfdbe899dd15fc88e0",
+  "tools/flex-bison/linux/flex.sha1":
+    "3e73ddbd801cf3e8ed759c49572c8bf2",
+  "tools/flex-bison/windows/bison.exe.sha1":
+    "ad6345f2fbf1112bae67f0d54a92e574",
+  "tools/flex-bison/windows/flex.exe.sha1":
+    "45668fa0dafd4a7e68c2b0480e50e650",
+  "tools/flex-bison/windows/m4.exe.sha1":
+    "0e0332c889b12576458bc481f34d6142",
+  "tools/flex-bison/windows/msys-2.0.dll.sha1":
+    "59854139bd445e5193812e2b910dc7b5",
+  "tools/flex-bison/windows/msys-iconv-2.dll.sha1":
+    "5da154b537d340991bb4cd06eca6d523",
+  "tools/flex-bison/windows/msys-intl-8.dll.sha1":
+    "3b5cd216061b9dff4d2ae3956bc344a8"
+}
\ No newline at end of file
diff --git a/src/third_party/angle/scripts/code_generation_hashes/GL_EGL_WGL_loader.json b/src/third_party/angle/scripts/code_generation_hashes/GL_EGL_WGL_loader.json
index b810ea0..917d48d 100644
--- a/src/third_party/angle/scripts/code_generation_hashes/GL_EGL_WGL_loader.json
+++ b/src/third_party/angle/scripts/code_generation_hashes/GL_EGL_WGL_loader.json
@@ -6,7 +6,7 @@
   "scripts/generate_loader.py":
     "48c60c668bec42a80378179aae2acc61",
   "scripts/registry_xml.py":
-    "f5fe888247ca4da9df81266a0123f7de",
+    "4f1fdc6158306914b149ade7549ad30a",
   "scripts/wgl.xml":
     "aa96419c582af2f6673430e2847693f4",
   "src/libEGL/egl_loader_autogen.cpp":
@@ -18,9 +18,9 @@
   "util/egl_loader_autogen.h":
     "6349dd7847bd72466919816befb6841d",
   "util/gles_loader_autogen.cpp":
-    "8f5e1cd93093e54d3287609680cae33c",
+    "c3025da071517953912c174680e65962",
   "util/gles_loader_autogen.h":
-    "5d349366c734f6f7a9cce58714fef1df",
+    "f26590cfa63a665d94b180ebd0748d21",
   "util/windows/wgl_loader_autogen.cpp":
     "12ffb44e5e743c826e4d84ac65cdba82",
   "util/windows/wgl_loader_autogen.h":
diff --git a/src/third_party/angle/scripts/code_generation_hashes/GL_EGL_entry_points.json b/src/third_party/angle/scripts/code_generation_hashes/GL_EGL_entry_points.json
index 3927f7c..dd0fc86 100644
--- a/src/third_party/angle/scripts/code_generation_hashes/GL_EGL_entry_points.json
+++ b/src/third_party/angle/scripts/code_generation_hashes/GL_EGL_entry_points.json
@@ -4,7 +4,7 @@
   "scripts/egl_angle_ext.xml":
     "24d4348e6c064b6837f46c955cc219a8",
   "scripts/entry_point_packed_gl_enums.json":
-    "3b72a1d43df45cf53784b2a0002b93e5",
+    "bcf97f16fd4cd4d4e50d66622982e67e",
   "scripts/generate_entry_points.py":
     "36f89f5514fff27ecb4baeded89ae64d",
   "scripts/gl.xml":
@@ -12,7 +12,7 @@
   "scripts/gl_angle_ext.xml":
     "d6907cd84d95ac0b32a164194eadcf53",
   "scripts/registry_xml.py":
-    "f5fe888247ca4da9df81266a0123f7de",
+    "4f1fdc6158306914b149ade7549ad30a",
   "scripts/wgl.xml":
     "aa96419c582af2f6673430e2847693f4",
   "src/libANGLE/Context_gl_1_0_autogen.h":
@@ -36,7 +36,7 @@
   "src/libANGLE/Context_gl_3_1_autogen.h":
     "1a35b7ccc5288d1f3a455152a6cc2e2c",
   "src/libANGLE/Context_gl_3_2_autogen.h":
-    "d956c7353be50a046b33928b347880a8",
+    "75726a2093163c9e9635e0b12df0f8f9",
   "src/libANGLE/Context_gl_3_3_autogen.h":
     "b7b4c2cb4ed98e35b176dca69fdb99e0",
   "src/libANGLE/Context_gl_4_0_autogen.h":
@@ -62,9 +62,9 @@
   "src/libANGLE/Context_gles_3_1_autogen.h":
     "8aef8ceb87eed9cc7e9586f6c98796e3",
   "src/libANGLE/Context_gles_3_2_autogen.h":
-    "72bf9e9e488c16ddfaf700afa3335d60",
+    "022bf1da90cc56f2e52998b87d274e64",
   "src/libANGLE/Context_gles_ext_autogen.h":
-    "4a24e91315986187921051585d04f66f",
+    "262f1af8a8cf25bb107afc80a664c69e",
   "src/libANGLE/capture_gles_1_0_autogen.cpp":
     "01eb0a76c176e5cdba3102cae58334af",
   "src/libANGLE/capture_gles_1_0_autogen.h":
@@ -82,19 +82,19 @@
   "src/libANGLE/capture_gles_3_1_autogen.h":
     "1739a558c3e77bef37d9fa710eb78932",
   "src/libANGLE/capture_gles_3_2_autogen.cpp":
-    "f74e229e52cc19b0678207e6204b563d",
+    "88cb88100c1f910254f0934359ba456e",
   "src/libANGLE/capture_gles_3_2_autogen.h":
-    "8d96d227765ee9b0d7b532edcc9f3bf1",
+    "fd5e95c49bb708635e5226f963a71eb5",
   "src/libANGLE/capture_gles_ext_autogen.cpp":
-    "3bd6fcda980f381cbbad2956b896afd9",
+    "9ad4c94c48e1190ee7a7fe7360ef2f52",
   "src/libANGLE/capture_gles_ext_autogen.h":
-    "2626f039751578bd51c1cbbc1e233f5d",
+    "10dc30fe9afca0b3454bb23bd716cd82",
   "src/libANGLE/entry_points_enum_autogen.cpp":
-    "6f259507f339880bf81920738e82e688",
+    "552afb6f0ec70ff4f848fec13d676531",
   "src/libANGLE/entry_points_enum_autogen.h":
-    "3be0bc6eaae7fe2dd4f491213e5c9c81",
+    "f8c1025b36be5451fb423ccec37e1c0f",
   "src/libANGLE/frame_capture_replay_autogen.cpp":
-    "48b7051879562ab15c83e4de7af8c75d",
+    "cb1c9b95ea7ba99b8dcaecbafa2c66ef",
   "src/libANGLE/frame_capture_utils_autogen.cpp":
     "f0a704d60de3f1f175a7799b49c45408",
   "src/libANGLE/frame_capture_utils_autogen.h":
@@ -106,11 +106,11 @@
   "src/libANGLE/validationES31_autogen.h":
     "9bf34098be328bee8f9fc04d1afbdfde",
   "src/libANGLE/validationES32_autogen.h":
-    "54ddf9c7d7d8071a33264e40353e00c6",
+    "4892ff4d6de709fe7f36ab49bf304b41",
   "src/libANGLE/validationES3_autogen.h":
     "1b470a8e190aa007f093f1f13f3b1a8c",
   "src/libANGLE/validationESEXT_autogen.h":
-    "eeabee2f488207f70931f2e3a2ff9c55",
+    "5b65651171876c5f9fd9087e56cb82de",
   "src/libANGLE/validationGL11_autogen.h":
     "c5ac1ca523a39df2621d11e92c9c821a",
   "src/libANGLE/validationGL12_autogen.h":
@@ -130,7 +130,7 @@
   "src/libANGLE/validationGL31_autogen.h":
     "05f50143f918acb954fd3a9888441ecd",
   "src/libANGLE/validationGL32_autogen.h":
-    "a74eaaea1b45684af766041b3e537a8c",
+    "0bcb618f8118715e7ac48989730fecb1",
   "src/libANGLE/validationGL33_autogen.h":
     "9a419eace66f443c5e28a52a3da758d9",
   "src/libANGLE/validationGL3_autogen.h":
@@ -190,7 +190,7 @@
   "src/libGL/entry_points_gl_3_1_autogen.h":
     "6ee6613c0206d99c6afdcd3faddb52a3",
   "src/libGL/entry_points_gl_3_2_autogen.cpp":
-    "85c8dad28022855d4b08189abd0c45f9",
+    "dbef4cb705baaf30df98e95ae138444f",
   "src/libGL/entry_points_gl_3_2_autogen.h":
     "347e40b5c9fd08a693bf4ffe713c61e6",
   "src/libGL/entry_points_gl_3_3_autogen.cpp":
@@ -246,19 +246,19 @@
   "src/libGLESv2/entry_points_gles_3_1_autogen.h":
     "043d09a964c740067bf4279e0b544aed",
   "src/libGLESv2/entry_points_gles_3_2_autogen.cpp":
-    "09693d9b4cd5f015ee1b1bd46a2a0e0a",
+    "b894d2b9b3024e69685ea430764f3962",
   "src/libGLESv2/entry_points_gles_3_2_autogen.h":
     "e06eb4df7dc6fb29c5fd632a54b0b162",
   "src/libGLESv2/entry_points_gles_ext_autogen.cpp":
-    "760cbaad5c626c1b27d579d6ca1b0049",
+    "58a0d9710588ca58b63f98c7fbb62bcf",
   "src/libGLESv2/entry_points_gles_ext_autogen.h":
-    "a8dad3044b98f7988207a65987836143",
+    "62b5f609fd34c47b0b1aa9e757b0f180",
   "src/libGLESv2/libGLESv2_autogen.cpp":
-    "7b0682a27fa050660b54ae73063f3b2d",
+    "9e7ff9ce5120295b9e61135ee01bc008",
   "src/libGLESv2/libGLESv2_autogen.def":
-    "cfa8370ea276c98b9bb3752bf75cb5d8",
+    "fb94a511a505ed79461b1677a185d301",
   "src/libGLESv2/libGLESv2_no_capture_autogen.def":
-    "a932f323fa7cfc13b4099f1741b5dc65",
+    "d9222e76f0b5ecc824bd82c975dec7ee",
   "src/libGLESv2/libGLESv2_with_capture_autogen.def":
-    "bd52aea6901faff81f0b0cb5f706528b"
+    "782e85c5bb72eebc8651fbcf86e0059d"
 }
\ No newline at end of file
diff --git a/src/third_party/angle/scripts/code_generation_hashes/GLenum_value_to_string_map.json b/src/third_party/angle/scripts/code_generation_hashes/GLenum_value_to_string_map.json
index 640edd5..a547ee8 100644
--- a/src/third_party/angle/scripts/code_generation_hashes/GLenum_value_to_string_map.json
+++ b/src/third_party/angle/scripts/code_generation_hashes/GLenum_value_to_string_map.json
@@ -6,7 +6,7 @@
   "scripts/gl_angle_ext.xml":
     "d6907cd84d95ac0b32a164194eadcf53",
   "scripts/registry_xml.py":
-    "f5fe888247ca4da9df81266a0123f7de",
+    "4f1fdc6158306914b149ade7549ad30a",
   "src/libANGLE/gl_enum_utils_autogen.cpp":
     "3178466fb9ef26a3349fe59a76295dc3",
   "src/libANGLE/gl_enum_utils_autogen.h":
diff --git a/src/third_party/angle/scripts/code_generation_hashes/Vulkan_internal_shader_programs.json b/src/third_party/angle/scripts/code_generation_hashes/Vulkan_internal_shader_programs.json
index 96011e5..19c035b 100644
--- a/src/third_party/angle/scripts/code_generation_hashes/Vulkan_internal_shader_programs.json
+++ b/src/third_party/angle/scripts/code_generation_hashes/Vulkan_internal_shader_programs.json
@@ -96,89 +96,39 @@
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertIndirectLineLoop.comp.00000000.inc":
     "523d3207d424614197ace9601ce56950",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000000.inc":
-    "f5ef892346ee10e5d0d9f8cba2a491b2",
+    "021ad52cea91db420280e4406081e8f2",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000001.inc":
-    "59128c2f079f511d3945c974567385ac",
+    "2d618000d8c839338a9faa3c800acbaf",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000002.inc":
-    "0867e61a34a642983b9a6b617def8497",
+    "6f02318375b02ce2121cd409f9f0a1bc",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000003.inc":
-    "a566c782ee8ac336851db8b1f695dcca",
+    "7d2128cc8962c0e0c4cb03c773ec03bb",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000004.inc":
-    "531a0b3b412bf252b7fa71eb92d8e3c6",
+    "199e8d2f931aa43c3dff9aaa9ec26bcd",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000005.inc":
-    "e1e1fd5754cce8d5f6157972a8f650d1",
+    "90c8f5720161febcdeea675c083d503b",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000006.inc":
-    "f6615e6c90eba9c92d1516b8d07e0b34",
+    "dfb6b6e51f6bbb022f592a254ad067a2",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000007.inc":
-    "bb62a58562d954c5a0946c291c2afca2",
+    "420785373b15743e3a29effe12ccdc4a",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000008.inc":
-    "5228214dc4d40eebed9b66806d604ef0",
+    "b369a5a2e93b302eeddef0185c55ae02",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000009.inc":
-    "18cf63360b3030cb637dd1129bd04e6b",
+    "9f8a2a28737b4cd354d62873c261e1b4",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.0000000A.inc":
-    "61b2ac99ab77bea128bfe97dd34b4fa7",
+    "ecc200fd8bd6f9054fe7fcd921bcb399",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.0000000B.inc":
-    "42a2ba6a02b07e5e22912950e65a9841",
+    "e20cba5aea8256f6fb9f287d22c6a188",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.0000000C.inc":
-    "14d935497b4e3e511ed765dfbee0d1f7",
+    "b17a1b7bfcf94e4e248abd18860c2a34",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.0000000D.inc":
-    "f2b99ccc857d814498b67d0d39edbe44",
+    "3c24f4f3309ce1dadd5802681ee8f680",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.0000000E.inc":
-    "b66ede43a25847955caa42a9f681854d",
+    "f19e58c8b9f1dac479d31f551a92e031",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.0000000F.inc":
-    "0d9058cddfe4033353c476a4a9c5410b",
+    "5a6a7d5cdfd96e45101cd6fe7dc20371",
   "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000010.inc":
-    "11139111ebc5610e9f90f8900260b6c1",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000011.inc":
-    "ac8c255a9c59f2f197c00c615255fcd8",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000012.inc":
-    "1166c798f406767182b1f0245bfa967b",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000013.inc":
-    "bae7085d6d6915eb27e380b3caa93da6",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000014.inc":
-    "8dbe3e2af70babae7603a34ec9340451",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000015.inc":
-    "bce92a380a3ae9eae0268c147fdfd1ca",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000016.inc":
-    "38eee786134a82a8f3ecd3e9f9cb4fc0",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000017.inc":
-    "c9a4c3100ce405279425855655f1ef50",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000018.inc":
-    "5f2b521b8c31ecf08d2776c554c0c699",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000019.inc":
-    "4b364dc33cf595d2fa382b9321f48dbc",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.0000001A.inc":
-    "ee4f06ba87a3dde490e01a0ec4561e10",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.0000001B.inc":
-    "d2b62347cd2b80f885adfa31f6aeccc0",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.0000001C.inc":
-    "92ea6760ba66b603fcbc1bebf207aa78",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.0000001D.inc":
-    "72bbe32670195bcf4be9d1edd8152178",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.0000001E.inc":
-    "e5131c8ba46eaf2674aad854eb3bc787",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.0000001F.inc":
-    "45f2705df7389be715506e9c3e484d74",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000020.inc":
-    "d79651c76fdfefb0949ae18e006a6d22",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000021.inc":
-    "52d7d35300cbdc1825bb75445a4784ba",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000022.inc":
-    "3cb10ed1f526018215af300c40614fd7",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000023.inc":
-    "cf7d1cfe77021df82b8c2ff5ec97ac59",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000024.inc":
-    "44fd4a3c651d31fd783a42dfc0bde182",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000025.inc":
-    "25b270092f8e6a1bfeb3c6f5e441d792",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000026.inc":
-    "a77252550fef5aa63bb49faecb6de265",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000027.inc":
-    "1bac85ed8b670bbe4b68ffa4064bf31f",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000028.inc":
-    "d6cfcf49825f3da242d0f8935b0e30f6",
-  "src/libANGLE/renderer/vulkan/shaders/gen/ConvertVertex.comp.00000029.inc":
-    "59e6c4a829283dc6db1664bb397ed6a2",
+    "6a4da57f0c84d217711b51eea99c061c",
   "src/libANGLE/renderer/vulkan/shaders/gen/FullScreenQuad.vert.00000000.inc":
     "235ca7c3979ce29a49c320d000ee7409",
   "src/libANGLE/renderer/vulkan/shaders/gen/ImageClear.frag.00000000.inc":
@@ -294,7 +244,7 @@
   "src/libANGLE/renderer/vulkan/shaders/src/ConvertIndirectLineLoop.comp":
     "c4fe0f463b41cd59bae33f9711e0b67b",
   "src/libANGLE/renderer/vulkan/shaders/src/ConvertVertex.comp":
-    "d93560cac4f8877a928cfec712045462",
+    "e0967dcc25d76797864dd5c0ab9847ce",
   "src/libANGLE/renderer/vulkan/shaders/src/FullScreenQuad.vert":
     "805ec8b2f87d4bd4242dc5b1c58ba3b4",
   "src/libANGLE/renderer/vulkan/shaders/src/ImageClear.frag":
@@ -306,9 +256,9 @@
   "src/libANGLE/renderer/vulkan/shaders/src/OverlayDraw.comp":
     "dcc246b398b2e07a869a264666499362",
   "src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp":
-    "05c79365e12eb3c9f1f9252dba3e62e6",
+    "7e0bc36d24abb773260a7bbd47b9d1d0",
   "src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.h":
-    "5796f01116800b6ec062a2a66edbbf99",
+    "350020dbc136ae8cc67455694ed13f31",
   "tools/glslang/glslang_validator.exe.sha1":
     "289f30598865a987a21b79ae525fc66f",
   "tools/glslang/glslang_validator.sha1":
diff --git a/src/third_party/angle/scripts/code_generation_hashes/Vulkan_mandatory_format_support_table.json b/src/third_party/angle/scripts/code_generation_hashes/Vulkan_mandatory_format_support_table.json
index 2eb03b5..ff5e543 100644
--- a/src/third_party/angle/scripts/code_generation_hashes/Vulkan_mandatory_format_support_table.json
+++ b/src/third_party/angle/scripts/code_generation_hashes/Vulkan_mandatory_format_support_table.json
@@ -8,5 +8,5 @@
   "src/libANGLE/renderer/vulkan/vk_mandatory_format_support_table_autogen.cpp":
     "5f691ffce5ea540f9835a715896619ca",
   "third_party/vulkan-headers/src/registry/vk.xml":
-    "85ae10e58a369a6e40f0f403104253cd"
+    "835ea353c9ddafbf772c407d46994fb8"
 }
\ No newline at end of file
diff --git a/src/third_party/angle/scripts/code_generation_hashes/proc_table.json b/src/third_party/angle/scripts/code_generation_hashes/proc_table.json
index d3a4531..7c5c78b 100644
--- a/src/third_party/angle/scripts/code_generation_hashes/proc_table.json
+++ b/src/third_party/angle/scripts/code_generation_hashes/proc_table.json
@@ -10,11 +10,11 @@
   "scripts/gl_angle_ext.xml":
     "d6907cd84d95ac0b32a164194eadcf53",
   "scripts/registry_xml.py":
-    "f5fe888247ca4da9df81266a0123f7de",
+    "4f1fdc6158306914b149ade7549ad30a",
   "scripts/wgl.xml":
     "aa96419c582af2f6673430e2847693f4",
   "src/libGL/proc_table_wgl_autogen.cpp":
     "6844abf06aa6fb7a26878acb0d69df07",
   "src/libGLESv2/proc_table_egl_autogen.cpp":
-    "24f519e153ade8e0fdc3bff3ae05954d"
+    "9436c346cf67f3fea38ee2654dd43bf8"
 }
\ No newline at end of file
diff --git a/src/third_party/angle/scripts/entry_point_packed_gl_enums.json b/src/third_party/angle/scripts/entry_point_packed_gl_enums.json
index 1761267..27b671e 100644
--- a/src/third_party/angle/scripts/entry_point_packed_gl_enums.json
+++ b/src/third_party/angle/scripts/entry_point_packed_gl_enums.json
@@ -333,6 +333,10 @@
         "mode": "PrimitiveMode",
         "type": "DrawElementsType"
     },
+    "glDrawElementsBaseVertex": {
+        "mode": "PrimitiveMode",
+        "type": "DrawElementsType"
+    },
     "glDrawElementsIndirect": {
         "mode": "PrimitiveMode",
         "type": "DrawElementsType"
@@ -341,6 +345,10 @@
         "mode": "PrimitiveMode",
         "type": "DrawElementsType"
     },
+    "glDrawElementsInstancedBaseVertex": {
+        "mode": "PrimitiveMode",
+        "type": "DrawElementsType"
+    },
     "glDrawElementsInstancedBaseVertexBaseInstance": {
         "mode": "PrimitiveMode",
         "type": "DrawElementsType"
@@ -349,6 +357,10 @@
         "mode": "PrimitiveMode",
         "type": "DrawElementsType"
     },
+    "glDrawRangeElementsBaseVertex": {
+        "mode": "PrimitiveMode",
+        "type": "DrawElementsType"
+    },
     "glDrawTransformFeedback": {
         "id": "TransformFeedbackID"
     },
@@ -1011,6 +1023,10 @@
         "mode": "PrimitiveMode",
         "type": "DrawElementsType"
     },
+    "glMultiDrawElementsBaseVertex": {
+        "mode": "PrimitiveMode",
+        "type": "DrawElementsType"
+    },
     "glMultiDrawElementsInstanced": {
         "mode": "PrimitiveMode",
         "type": "DrawElementsType"
diff --git a/src/third_party/angle/scripts/export_targets.py b/src/third_party/angle/scripts/export_targets.py
index e5e3c19..95a75fe 100755
--- a/src/third_party/angle/scripts/export_targets.py
+++ b/src/third_party/angle/scripts/export_targets.py
@@ -193,6 +193,7 @@
     b'libANGLE/renderer/vulkan/android/DisplayVkAndroid.h',
     b'libANGLE/renderer/vulkan/fuchsia/DisplayVkFuchsia.h',
     b'libANGLE/renderer/vulkan/ggp/DisplayVkGGP.h',
+    b'libANGLE/renderer/vulkan/mac/DisplayVkMac.h',
     b'libANGLE/renderer/vulkan/win32/DisplayVkWin32.h',
     b'libANGLE/renderer/vulkan/xcb/DisplayVkXcb.h',
     b'kernel/image.h',
diff --git a/src/third_party/angle/scripts/generate_vulkan_layers_json.py b/src/third_party/angle/scripts/generate_vulkan_layers_json.py
deleted file mode 100755
index 513f694..0000000
--- a/src/third_party/angle/scripts/generate_vulkan_layers_json.py
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2016 The ANGLE Project Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-"""Generate copies of the Vulkan layers JSON files, with no paths, forcing
-Vulkan to use the default search path to look for layers."""
-
-from __future__ import print_function
-
-import argparse
-import glob
-import json
-import os
-import platform
-import sys
-
-
-def glob_slash(dirname):
-    """Like regular glob but replaces \ with / in returned paths."""
-    return [s.replace('\\', '/') for s in glob.glob(dirname)]
-
-
-def main():
-    parser = argparse.ArgumentParser(description=__doc__)
-    parser.add_argument('--icd', action='store_true')
-    parser.add_argument('source_dir')
-    parser.add_argument('target_dir')
-    parser.add_argument('version_header', help='path to vulkan_core.h')
-    parser.add_argument('json_files', nargs='*')
-    parser.add_argument('--replacement', help='replacement for the library', default=None)
-    args = parser.parse_args()
-
-    source_dir = args.source_dir
-    target_dir = args.target_dir
-
-    json_files = [j for j in args.json_files if j.endswith('.json')]
-    json_in_files = [j for j in args.json_files if j.endswith('.json.in')]
-
-    data_key = 'ICD' if args.icd else 'layer'
-
-    if not os.path.isdir(source_dir):
-        print(source_dir + ' is not a directory.', file=sys.stderr)
-        return 1
-
-    if not os.path.exists(target_dir):
-        os.makedirs(target_dir)
-
-    # Copy the *.json files from source dir to target dir
-    if (set(glob_slash(os.path.join(source_dir, '*.json'))) !=
-            set(json_files)) and data_key != 'ICD':
-        print(glob.glob(os.path.join(source_dir, '*.json')))
-        print('.json list in gn file is out-of-date', file=sys.stderr)
-        return 1
-
-    for json_fname in json_files:
-        if not json_fname.endswith('.json'):
-            continue
-        with open(json_fname) as infile:
-            data = json.load(infile)
-
-        # Update the path.
-        if not data_key in data:
-            raise Exception("Could not find '%s' key in %s" % (data_key, json_fname))
-
-        # The standard validation layer has no library path.
-        if 'library_path' in data[data_key]:
-            prev_name = os.path.basename(data[data_key]['library_path'])
-            if args.replacement:
-                data[data_key]['library_path'] = args.replacement
-            else:
-                data[data_key]['library_path'] = prev_name
-
-        target_fname = os.path.join(target_dir, os.path.basename(json_fname))
-        with open(target_fname, 'wb') as outfile:
-            json.dump(data, outfile)
-
-    # Get the Vulkan version from the vulkan_core.h file
-    vk_header_filename = args.version_header
-    vk_version = None
-    if data_key != 'ICD':
-        with open(vk_header_filename) as vk_header_file:
-            for line in vk_header_file:
-                if line.startswith('#define VK_HEADER_VERSION'):
-                    vk_version = line.split()[-1]
-                    break
-        if not vk_version:
-            print('failed to extract vk_version', file=sys.stderr)
-            return 1
-
-    # Set json file prefix and suffix for generating files, default to Linux.
-    relative_path_prefix = '../lib'
-    file_type_suffix = '.so'
-    if platform.system() == 'Windows':
-        relative_path_prefix = r'..\\'  # json-escaped, hence two backslashes.
-        file_type_suffix = '.dll'
-
-    # For each *.json.in template files in source dir generate actual json file
-    # in target dir
-    if (set(glob_slash(os.path.join(source_dir, '*.json.in'))) != set(json_in_files)):
-        print('.json.in list in gn file is out-of-date', file=sys.stderr)
-        return 1
-    for json_in_name in json_in_files:
-        if not json_in_name.endswith('.json.in'):
-            continue
-        json_in_fname = os.path.basename(json_in_name)
-        layer_name = json_in_fname[:-len('.json.in')]
-        layer_lib_name = layer_name + file_type_suffix
-        json_out_fname = os.path.join(target_dir, json_in_fname[:-len('.in')])
-        with open(json_out_fname,'w') as json_out_file, \
-             open(json_in_name) as infile:
-            for line in infile:
-                line = line.replace('@RELATIVE_LAYER_BINARY@',
-                                    relative_path_prefix + layer_lib_name)
-                line = line.replace('@VK_VERSION@', '1.1.' + vk_version)
-                json_out_file.write(line)
-
-
-if __name__ == '__main__':
-    sys.exit(main())
diff --git a/src/third_party/angle/scripts/registry_xml.py b/src/third_party/angle/scripts/registry_xml.py
index f093a69..3b967e4 100644
--- a/src/third_party/angle/scripts/registry_xml.py
+++ b/src/third_party/angle/scripts/registry_xml.py
@@ -64,6 +64,7 @@
     "GL_EXT_discard_framebuffer",
     "GL_EXT_disjoint_timer_query",
     "GL_EXT_draw_buffers",
+    "GL_EXT_draw_elements_base_vertex",
     "GL_EXT_geometry_shader",
     "GL_EXT_instanced_arrays",
     "GL_EXT_map_buffer_range",
@@ -80,6 +81,7 @@
     "GL_KHR_parallel_shader_compile",
     "GL_NV_fence",
     "GL_OES_EGL_image",
+    "GL_OES_draw_elements_base_vertex",
     "GL_OES_get_program_binary",
     "GL_OES_mapbuffer",
     "GL_OES_texture_3D",
diff --git a/src/third_party/angle/scripts/roll_deps.py b/src/third_party/angle/scripts/roll_deps.py
index 3f289fa..805f24e 100644
--- a/src/third_party/angle/scripts/roll_deps.py
+++ b/src/third_party/angle/scripts/roll_deps.py
@@ -34,17 +34,13 @@
     'build',
     'buildtools',
     'testing',
-    'third_party/fuchsia-sdk',
     'third_party/googletest',
-    'third_party/googletest/src',
     'third_party/libjpeg_turbo',
     'third_party/jsoncpp',
-    'third_party/jsoncpp/source',
     'third_party/Python-Markdown',
     'third_party/qemu-linux-x64',
     'third_party/qemu-mac-x64',
     'third_party/yasm',
-    'third_party/yasm/source/patched-yasm',
     'third_party/zlib',
     'tools/clang',
     'tools/md_browser',
diff --git a/src/third_party/angle/scripts/run_code_generation.py b/src/third_party/angle/scripts/run_code_generation.py
index 545b296..b912bd7 100755
--- a/src/third_party/angle/scripts/run_code_generation.py
+++ b/src/third_party/angle/scripts/run_code_generation.py
@@ -73,6 +73,10 @@
         'src/libANGLE/renderer/gen_angle_format_table.py',
     'ANGLE load functions table':
         'src/libANGLE/renderer/gen_load_functions_table.py',
+    'ANGLE shader preprocessor':
+        'src/compiler/preprocessor/generate_parser.py',
+    'ANGLE shader translator':
+        'src/compiler/translator/generate_parser.py',
     'D3D11 blit shader selection':
         'src/libANGLE/renderer/d3d/d3d11/gen_blit11helper.py',
     'D3D11 format':
diff --git a/src/third_party/angle/src/common/FastVector.h b/src/third_party/angle/src/common/FastVector.h
index 7c86a28..a51871d 100644
--- a/src/third_party/angle/src/common/FastVector.h
+++ b/src/third_party/angle/src/common/FastVector.h
@@ -224,14 +224,12 @@
 ANGLE_INLINE typename FastVector<T, N, Storage>::const_pointer
 angle::FastVector<T, N, Storage>::data() const
 {
-    ASSERT(!empty());
     return mData;
 }
 
 template <class T, size_t N, class Storage>
 ANGLE_INLINE typename FastVector<T, N, Storage>::pointer angle::FastVector<T, N, Storage>::data()
 {
-    ASSERT(!empty());
     return mData;
 }
 
diff --git a/src/third_party/angle/src/common/system_utils_winuwp.cpp b/src/third_party/angle/src/common/system_utils_winuwp.cpp
index 72d5509..24b60c5 100644
--- a/src/third_party/angle/src/common/system_utils_winuwp.cpp
+++ b/src/third_party/angle/src/common/system_utils_winuwp.cpp
@@ -33,14 +33,24 @@
     return "";
 }
 
+const char *GetPathSeparatorForEnvironmentVar()
+{
+    return ";";
+}
+
 const char *GetSharedLibraryExtension()
 {
     return "dll";
 }
 
-const char *GetPathSeparator()
+const char *GetExecutableExtension()
 {
-    return ";";
+    return ".exe";
+}
+
+char GetPathSeparator()
+{
+    return '\\';
 }
 
 double GetCurrentTime()
diff --git a/src/third_party/angle/src/common/utilities.cpp b/src/third_party/angle/src/common/utilities.cpp
index b48b5bb..8cf275a 100644
--- a/src/third_party/angle/src/common/utilities.cpp
+++ b/src/third_party/angle/src/common/utilities.cpp
@@ -8,6 +8,7 @@
 
 #include "common/utilities.h"
 #include <GLSLANG/ShaderVars.h>
+#include "GLES3/gl3.h"
 #include "common/mathutil.h"
 #include "common/platform.h"
 
diff --git a/src/third_party/angle/src/compiler.gni b/src/third_party/angle/src/compiler.gni
index ed31ecb..25d575e 100644
--- a/src/third_party/angle/src/compiler.gni
+++ b/src/third_party/angle/src/compiler.gni
@@ -108,9 +108,9 @@
   "src/compiler/translator/VariablePacker.h",
   "src/compiler/translator/blocklayout.cpp",
   "src/compiler/translator/glslang.h",
-  "src/compiler/translator/glslang_lex.cpp",
-  "src/compiler/translator/glslang_tab.cpp",
-  "src/compiler/translator/glslang_tab.h",
+  "src/compiler/translator/glslang_lex_autogen.cpp",
+  "src/compiler/translator/glslang_tab_autogen.cpp",
+  "src/compiler/translator/glslang_tab_autogen.h",
   "src/compiler/translator/length_limits.h",
   "src/compiler/translator/util.cpp",
   "src/compiler/translator/util.h",
@@ -325,7 +325,6 @@
   "src/compiler/preprocessor/DirectiveHandlerBase.h",
   "src/compiler/preprocessor/DirectiveParser.cpp",
   "src/compiler/preprocessor/DirectiveParser.h",
-  "src/compiler/preprocessor/ExpressionParser.cpp",
   "src/compiler/preprocessor/ExpressionParser.h",
   "src/compiler/preprocessor/Input.cpp",
   "src/compiler/preprocessor/Input.h",
@@ -335,12 +334,13 @@
   "src/compiler/preprocessor/Macro.h",
   "src/compiler/preprocessor/MacroExpander.cpp",
   "src/compiler/preprocessor/MacroExpander.h",
+  "src/compiler/preprocessor/preprocessor_lex_autogen.cpp",
+  "src/compiler/preprocessor/preprocessor_tab_autogen.cpp",
   "src/compiler/preprocessor/Preprocessor.cpp",
   "src/compiler/preprocessor/Preprocessor.h",
   "src/compiler/preprocessor/SourceLocation.h",
   "src/compiler/preprocessor/Token.cpp",
   "src/compiler/preprocessor/Token.h",
-  "src/compiler/preprocessor/Tokenizer.cpp",
   "src/compiler/preprocessor/Tokenizer.h",
   "src/compiler/preprocessor/numeric_lex.h",
 ]
diff --git a/src/third_party/angle/src/compiler.gypi b/src/third_party/angle/src/compiler.gypi
index 8449e02..7be0ac3 100644
--- a/src/third_party/angle/src/compiler.gypi
+++ b/src/third_party/angle/src/compiler.gypi
@@ -120,9 +120,9 @@
             '<(DEPTH)/third_party/angle/src/compiler/translator/VariablePacker.h',
             '<(DEPTH)/third_party/angle/src/compiler/translator/blocklayout.cpp',
             '<(DEPTH)/third_party/angle/src/compiler/translator/glslang.h',
-            '<(DEPTH)/third_party/angle/src/compiler/translator/glslang_lex.cpp',
-            '<(DEPTH)/third_party/angle/src/compiler/translator/glslang_tab.cpp',
-            '<(DEPTH)/third_party/angle/src/compiler/translator/glslang_tab.h',
+            '<(DEPTH)/third_party/angle/src/compiler/translator/glslang_lex_autogen.cpp',
+            '<(DEPTH)/third_party/angle/src/compiler/translator/glslang_tab_autogen.cpp',
+            '<(DEPTH)/third_party/angle/src/compiler/translator/glslang_tab_autogen.h',
             '<(DEPTH)/third_party/angle/src/compiler/translator/length_limits.h',
             '<(DEPTH)/third_party/angle/src/compiler/translator/util.cpp',
             '<(DEPTH)/third_party/angle/src/compiler/translator/util.h',
@@ -323,9 +323,7 @@
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/DirectiveHandlerBase.h',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/DirectiveParser.cpp',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/DirectiveParser.h',
-            '<(DEPTH)/third_party/angle/src/compiler/preprocessor/ExpressionParser.cpp',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/ExpressionParser.h',
-            '<(DEPTH)/third_party/angle/src/compiler/preprocessor/ExpressionParser.y',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/Input.cpp',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/Input.h',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/Lexer.cpp',
@@ -334,14 +332,14 @@
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/Macro.h',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/MacroExpander.cpp',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/MacroExpander.h',
+            '<(DEPTH)/third_party/angle/src/compiler/preprocessor/preprocessor_lex_autogen.cpp',
+            '<(DEPTH)/third_party/angle/src/compiler/preprocessor/preprocessor_tab_autogen.cpp',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/Preprocessor.cpp',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/Preprocessor.h',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/SourceLocation.h',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/Token.cpp',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/Token.h',
-            '<(DEPTH)/third_party/angle/src/compiler/preprocessor/Tokenizer.cpp',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/Tokenizer.h',
-            '<(DEPTH)/third_party/angle/src/compiler/preprocessor/Tokenizer.l',
             '<(DEPTH)/third_party/angle/src/compiler/preprocessor/numeric_lex.h',
         ],
     },
diff --git a/src/third_party/angle/src/compiler/generate_parser_tools.py b/src/third_party/angle/src/compiler/generate_parser_tools.py
new file mode 100644
index 0000000..38ede1c
--- /dev/null
+++ b/src/third_party/angle/src/compiler/generate_parser_tools.py
@@ -0,0 +1,153 @@
+#!/usr/bin/python
+# Copyright 2019 The ANGLE Project Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# generate_parser_tools.py:
+#   Common functionality to call flex and bison to generate lexer and parser of
+#   the translator and preprocessor.
+
+import os
+import platform
+import subprocess
+import sys
+
+is_linux = platform.system() == 'Linux'
+is_windows = platform.system() == 'Windows'
+
+
+def get_tool_path_platform(tool_name, platform):
+    exe_path = os.path.join(sys.path[0], '..', '..', '..', 'tools', 'flex-bison', platform)
+
+    return os.path.join(exe_path, tool_name)
+
+
+def get_tool_path(tool_name):
+    if is_linux:
+        platform = 'linux'
+        ext = ''
+    else:
+        assert (is_windows)
+        platform = 'windows'
+        ext = '.exe'
+
+    return get_tool_path_platform(tool_name + ext, platform)
+
+
+def get_tool_file_sha1s():
+    files = [
+        get_tool_path_platform('flex', 'linux'),
+        get_tool_path_platform('bison', 'linux'),
+        get_tool_path_platform('flex.exe', 'windows'),
+        get_tool_path_platform('bison.exe', 'windows'),
+        get_tool_path_platform('m4.exe', 'windows')
+    ]
+
+    files += [
+        get_tool_path_platform(dll, 'windows')
+        for dll in ['msys-2.0.dll', 'msys-iconv-2.dll', 'msys-intl-8.dll']
+    ]
+
+    return [f + '.sha1' for f in files]
+
+
+def run_flex(basename):
+    flex = get_tool_path('flex')
+    input_file = basename + '.l'
+    output_source = basename + '_lex_autogen.cpp'
+
+    flex_args = [flex, '--noline', '--nounistd', '--outfile=' + output_source, input_file]
+
+    flex_env = os.environ.copy()
+    if is_windows:
+        flex_env['M4'] = get_tool_path_platform('m4.exe', 'windows')
+
+    process = subprocess.Popen(flex_args, env=flex_env, cwd=sys.path[0])
+    process.communicate()
+    if process.returncode != 0:
+        return process.returncode
+
+    # Patch flex output for 64-bit.  The patch is simple enough that we could do a string
+    # replacement.  More importantly, the location of the line of code that needs to be substituted
+    # can vary based on flex version, and the string substitution will find the correct place
+    # automatically.
+
+    patch_in = """
+		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+			yyg->yy_n_chars, num_to_read );"""
+    patch_out = """
+		yy_size_t ret = 0;
+		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+			ret, num_to_read );
+		yyg->yy_n_chars = static_cast<int>(ret);"""
+
+    with open(output_source, 'r') as flex_output:
+        output = flex_output.read()
+
+        # If flex's output changes such that this line no longer exists, the patch needs to be
+        # updated, or possibly removed.
+        assert (output.find(patch_in) != -1)
+
+        patched = output.replace(patch_in, patch_out)
+
+    with open(output_source, 'w') as flex_output_patched:
+        flex_output_patched.write(patched)
+
+    return 0
+
+
+def run_bison(basename, generate_header):
+    bison = get_tool_path('bison')
+    input_file = basename + '.y'
+    output_header = basename + '_tab_autogen.h'
+    output_source = basename + '_tab_autogen.cpp'
+
+    bison_args = [bison, '--no-lines', '--skeleton=yacc.c']
+    if generate_header:
+        bison_args += ['--defines=' + output_header]
+    bison_args += ['--output=' + output_source, input_file]
+
+    bison_env = os.environ.copy()
+    bison_env['BISON_PKGDATADIR'] = get_tool_path_platform('', 'third_party')
+    if is_windows:
+        bison_env['M4'] = get_tool_path_platform('m4.exe', 'windows')
+
+    process = subprocess.Popen(bison_args, env=bison_env, cwd=sys.path[0])
+    process.communicate()
+    return process.returncode
+
+
+def get_input_files(basename):
+    files = [basename + '.l', basename + '.y']
+    return [os.path.join(sys.path[0], f) for f in files]
+
+
+def get_output_files(basename, generate_header):
+    optional_header = [basename + '_tab_autogen.h'] if generate_header else []
+    files = [basename + '_lex_autogen.cpp', basename + '_tab_autogen.cpp'] + optional_header
+    return [os.path.join(sys.path[0], f) for f in files]
+
+
+def generate_parser(basename, generate_header):
+    # Handle inputs/outputs for run_code_generation.py's auto_script
+    if len(sys.argv) > 1:
+        if sys.argv[1] == 'inputs':
+            inputs = get_tool_file_sha1s()
+            inputs += get_input_files(basename)
+            print(','.join(inputs))
+        if sys.argv[1] == 'outputs':
+            print(','.join(get_output_files(basename, generate_header)))
+        return 0
+
+    # Call flex and bison to generate the lexer and parser.
+    flex_result = run_flex(basename)
+    if flex_result != 0:
+        print 'Failed to run flex. Error ' + str(flex_result)
+        return 1
+
+    bison_result = run_bison(basename, generate_header)
+    if bison_result != 0:
+        print 'Failed to run bison. Error ' + str(bison_result)
+        return 2
+
+    return 0
diff --git a/src/third_party/angle/src/compiler/preprocessor/64bit-tokenizer-safety.patch b/src/third_party/angle/src/compiler/preprocessor/64bit-tokenizer-safety.patch
deleted file mode 100644
index 0c3b936..0000000
--- a/src/third_party/angle/src/compiler/preprocessor/64bit-tokenizer-safety.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/src/compiler/preprocessor/Tokenizer.cpp b/src/compiler/preprocessor/Tokenizer.cpp
-index 0d7ad58..5ef0e5e 100644
---- a/src/compiler/preprocessor/Tokenizer.cpp
-+++ b/src/compiler/preprocessor/Tokenizer.cpp
-@@ -1746,8 +1746,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
- 			num_to_read = YY_READ_BUF_SIZE;
- 
- 		/* Read in more data. */
-+		yy_size_t ret = 0;
- 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
--			yyg->yy_n_chars, num_to_read );
-+			ret, num_to_read );
-+		yyg->yy_n_chars = static_cast<int>(ret);
- 
- 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
- 		}
diff --git a/src/third_party/angle/src/compiler/preprocessor/ExpressionParser.cpp b/src/third_party/angle/src/compiler/preprocessor/ExpressionParser.cpp
deleted file mode 100644
index 1b71ef7..0000000
--- a/src/third_party/angle/src/compiler/preprocessor/ExpressionParser.cpp
+++ /dev/null
@@ -1,1909 +0,0 @@
-/* A Bison parser, made by GNU Bison 3.0.4.  */
-
-/* Bison implementation for Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-/* C LALR(1) parser skeleton written by Richard Stallman, by
-   simplifying the original so-called "semantic" parser.  */
-
-/* All symbols defined below should begin with yy or YY, to avoid
-   infringing on user name space.  This should be done even for local
-   variables, as they might otherwise be expanded by user macros.
-   There are some unavoidable exceptions within include files to
-   define necessary library symbols; they are noted "INFRINGES ON
-   USER NAME SPACE" below.  */
-
-/* Identify Bison output.  */
-#define YYBISON 1
-
-/* Bison version.  */
-#define YYBISON_VERSION "3.0.4"
-
-/* Skeleton name.  */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers.  */
-#define YYPURE 1
-
-/* Push parsers.  */
-#define YYPUSH 0
-
-/* Pull parsers.  */
-#define YYPULL 1
-
-/* Substitute the variable and function names.  */
-#define yyparse ppparse
-#define yylex pplex
-#define yyerror pperror
-#define yydebug ppdebug
-#define yynerrs ppnerrs
-
-/* Copy the first part of user declarations.  */
-
-//
-// Copyright 2012 The ANGLE Project 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 by generate_parser.sh. DO NOT EDIT!
-
-#if defined(__GNUC__)
-// Triggered by the auto-generated pplval variable.
-#    if !defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
-#        pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-#    else
-#        pragma GCC diagnostic ignored "-Wuninitialized"
-#    endif
-#elif defined(_MSC_VER)
-#    pragma warning(disable : 4065 4244 4701 4702)
-#endif
-#if defined(__clang__)
-#    pragma clang diagnostic ignored "-Wunreachable-code"
-#endif
-
-#include "ExpressionParser.h"
-
-#if defined(_MSC_VER)
-#    include <malloc.h>
-#else
-#    include <stdlib.h>
-#endif
-
-#include <stdint.h>
-#include <cassert>
-#include <sstream>
-
-#include "DiagnosticsBase.h"
-#include "Lexer.h"
-#include "Token.h"
-#include "common/mathutil.h"
-
-typedef int32_t YYSTYPE;
-typedef uint32_t UNSIGNED_TYPE;
-
-#define YYENABLE_NLS 0
-#define YYLTYPE_IS_TRIVIAL 1
-#define YYSTYPE_IS_TRIVIAL 1
-#define YYSTYPE_IS_DECLARED 1
-
-namespace
-{
-struct Context
-{
-    angle::pp::Diagnostics *diagnostics;
-    angle::pp::Lexer *lexer;
-    angle::pp::Token *token;
-    int *result;
-    bool parsePresetToken;
-
-    angle::pp::ExpressionParser::ErrorSettings errorSettings;
-    bool *valid;
-
-    void startIgnoreErrors() { ++ignoreErrors; }
-    void endIgnoreErrors() { --ignoreErrors; }
-
-    bool isIgnoringErrors() { return ignoreErrors > 0; }
-
-    int ignoreErrors;
-};
-}  // namespace
-
-static int yylex(YYSTYPE *lvalp, Context *context);
-static void yyerror(Context *context, const char *reason);
-
-#ifndef YY_NULLPTR
-#    if defined __cplusplus && 201103L <= __cplusplus
-#        define YY_NULLPTR nullptr
-#    else
-#        define YY_NULLPTR 0
-#    endif
-#endif
-
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-#    undef YYERROR_VERBOSE
-#    define YYERROR_VERBOSE 1
-#else
-#    define YYERROR_VERBOSE 0
-#endif
-
-/* Debug traces.  */
-#ifndef YYDEBUG
-#    define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int ppdebug;
-#endif
-
-/* Token type.  */
-#ifndef YYTOKENTYPE
-#    define YYTOKENTYPE
-enum yytokentype
-{
-    TOK_CONST_INT  = 258,
-    TOK_IDENTIFIER = 259,
-    TOK_OP_OR      = 260,
-    TOK_OP_AND     = 261,
-    TOK_OP_EQ      = 262,
-    TOK_OP_NE      = 263,
-    TOK_OP_LE      = 264,
-    TOK_OP_GE      = 265,
-    TOK_OP_LEFT    = 266,
-    TOK_OP_RIGHT   = 267,
-    TOK_UNARY      = 268
-};
-#endif
-
-/* Value type.  */
-#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED
-typedef int YYSTYPE;
-#    define YYSTYPE_IS_TRIVIAL 1
-#    define YYSTYPE_IS_DECLARED 1
-#endif
-
-int ppparse(Context *context);
-
-/* Copy the second part of user declarations.  */
-
-#ifdef short
-#    undef short
-#endif
-
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
-#endif
-
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#else
-typedef signed char yytype_int8;
-#endif
-
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
-
-#ifndef YYSIZE_T
-#    ifdef __SIZE_TYPE__
-#        define YYSIZE_T __SIZE_TYPE__
-#    elif defined size_t
-#        define YYSIZE_T size_t
-#    elif !defined YYSIZE_T
-#        include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-#        define YYSIZE_T size_t
-#    else
-#        define YYSIZE_T unsigned int
-#    endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T)-1)
-
-#ifndef YY_
-#    if defined YYENABLE_NLS && YYENABLE_NLS
-#        if ENABLE_NLS
-#            include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-#            define YY_(Msgid) dgettext("bison-runtime", Msgid)
-#        endif
-#    endif
-#    ifndef YY_
-#        define YY_(Msgid) Msgid
-#    endif
-#endif
-
-#ifndef YY_ATTRIBUTE
-#    if (defined __GNUC__ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) || \
-        defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-#        define YY_ATTRIBUTE(Spec) __attribute__(Spec)
-#    else
-#        define YY_ATTRIBUTE(Spec) /* empty */
-#    endif
-#endif
-
-#ifndef YY_ATTRIBUTE_PURE
-#    define YY_ATTRIBUTE_PURE YY_ATTRIBUTE((__pure__))
-#endif
-
-#ifndef YY_ATTRIBUTE_UNUSED
-#    define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE((__unused__))
-#endif
-
-#if !defined _Noreturn && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-#    if defined _MSC_VER && 1200 <= _MSC_VER
-#        define _Noreturn __declspec(noreturn)
-#    else
-#        define _Noreturn YY_ATTRIBUTE((__noreturn__))
-#    endif
-#endif
-
-/* Suppress unused-variable warnings by "using" E.  */
-#if !defined lint || defined __GNUC__
-#    define YYUSE(E) ((void)(E))
-#else
-#    define YYUSE(E) /* empty */
-#endif
-
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
-/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
-#    define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                                              \
-        _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") \
-            _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-#    define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop")
-#else
-#    define YY_INITIAL_VALUE(Value) Value
-#endif
-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-#    define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-#    define YY_IGNORE_MAYBE_UNINITIALIZED_END
-#endif
-#ifndef YY_INITIAL_VALUE
-#    define YY_INITIAL_VALUE(Value) /* Nothing. */
-#endif
-
-#if !defined yyoverflow || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols.  */
-
-#    ifdef YYSTACK_USE_ALLOCA
-#        if YYSTACK_USE_ALLOCA
-#            ifdef __GNUC__
-#                define YYSTACK_ALLOC __builtin_alloca
-#            elif defined __BUILTIN_VA_ARG_INCR
-#                include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-#            elif defined _AIX
-#                define YYSTACK_ALLOC __alloca
-#            elif defined _MSC_VER
-#                include <malloc.h> /* INFRINGES ON USER NAME SPACE */
-#                define alloca _alloca
-#            else
-#                define YYSTACK_ALLOC alloca
-#                if !defined _ALLOCA_H && !defined EXIT_SUCCESS
-#                    include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-/* Use EXIT_SUCCESS as a witness for stdlib.h.  */
-#                    ifndef EXIT_SUCCESS
-#                        define EXIT_SUCCESS 0
-#                    endif
-#                endif
-#            endif
-#        endif
-#    endif
-
-#    ifdef YYSTACK_ALLOC
-/* Pacify GCC's 'empty if-body' warning.  */
-#        define YYSTACK_FREE(Ptr) \
-            do                    \
-            { /* empty */         \
-                ;                 \
-            } while (0)
-#        ifndef YYSTACK_ALLOC_MAXIMUM
-/* The OS might guarantee only one guard page at the bottom of the stack,
-   and a page size can be as small as 4096 bytes.  So we cannot safely
-   invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
-   to allow for a few compiler-allocated temporary stack slots.  */
-#            define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-#        endif
-#    else
-#        define YYSTACK_ALLOC YYMALLOC
-#        define YYSTACK_FREE YYFREE
-#        ifndef YYSTACK_ALLOC_MAXIMUM
-#            define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-#        endif
-#        if (defined __cplusplus && !defined EXIT_SUCCESS && \
-             !((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free)))
-#            include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#            ifndef EXIT_SUCCESS
-#                define EXIT_SUCCESS 0
-#            endif
-#        endif
-#        ifndef YYMALLOC
-#            define YYMALLOC malloc
-#            if !defined malloc && !defined EXIT_SUCCESS
-void *malloc(YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-#            endif
-#        endif
-#        ifndef YYFREE
-#            define YYFREE free
-#            if !defined free && !defined EXIT_SUCCESS
-void free(void *);      /* INFRINGES ON USER NAME SPACE */
-#            endif
-#        endif
-#    endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
-#if (!defined yyoverflow && \
-     (!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member.  */
-union yyalloc
-{
-    yytype_int16 yyss_alloc;
-    YYSTYPE yyvs_alloc;
-};
-
-/* The size of the maximum gap between one aligned stack and the next.  */
-#    define YYSTACK_GAP_MAXIMUM (sizeof(union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
-   N elements.  */
-#    define YYSTACK_BYTES(N) ((N) * (sizeof(yytype_int16) + sizeof(YYSTYPE)) + YYSTACK_GAP_MAXIMUM)
-
-#    define YYCOPY_NEEDED 1
-
-/* Relocate STACK from its old location to the new one.  The
-   local variables YYSIZE and YYSTACKSIZE give the old and new number of
-   elements in the stack, and YYPTR gives the new location of the
-   stack.  Advance YYPTR to a properly aligned location for the next
-   stack.  */
-#    define YYSTACK_RELOCATE(Stack_alloc, Stack)                             \
-        do                                                                   \
-        {                                                                    \
-            YYSIZE_T yynewbytes;                                             \
-            YYCOPY(&yyptr->Stack_alloc, Stack, yysize);                      \
-            Stack      = &yyptr->Stack_alloc;                                \
-            yynewbytes = yystacksize * sizeof(*Stack) + YYSTACK_GAP_MAXIMUM; \
-            yyptr += yynewbytes / sizeof(*yyptr);                            \
-        } while (0)
-
-#endif
-
-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
-/* Copy COUNT objects from SRC to DST.  The source and destination do
-   not overlap.  */
-#    ifndef YYCOPY
-#        if defined __GNUC__ && 1 < __GNUC__
-#            define YYCOPY(Dst, Src, Count) __builtin_memcpy(Dst, Src, (Count) * sizeof(*(Src)))
-#        else
-#            define YYCOPY(Dst, Src, Count)             \
-                do                                      \
-                {                                       \
-                    YYSIZE_T yyi;                       \
-                    for (yyi = 0; yyi < (Count); yyi++) \
-                        (Dst)[yyi] = (Src)[yyi];        \
-                } while (0)
-#        endif
-#    endif
-#endif /* !YYCOPY_NEEDED */
-
-/* YYFINAL -- State number of the termination state.  */
-#define YYFINAL 15
-/* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST 176
-
-/* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS 28
-/* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS 5
-/* YYNRULES -- Number of rules.  */
-#define YYNRULES 29
-/* YYNSTATES -- Number of states.  */
-#define YYNSTATES 55
-
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
-   by yylex, with out-of-bounds checking.  */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 268
-
-#define YYTRANSLATE(YYX) ((unsigned int)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
-   as returned by yylex, without out-of-bounds checking.  */
-static const yytype_uint8 yytranslate[] = {
-    0, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 2,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 24, 2, 2,  2, 22, 9, 2, 26, 27, 20, 18, 2, 19, 2,  21, 2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 12, 2, 13, 2, 2,  2, 2, 2,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 8,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 2,  2,  2,  7,  2, 25, 2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 2,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 2,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 2,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 2,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 1,  2,  3,  4,  5, 6,  10, 11, 14, 15, 16, 17, 23};
-
-#if YYDEBUG
-/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
-static const yytype_uint16 yyrline[] = {0,   111, 111, 118, 119, 130, 130, 151, 151, 172,
-                                        175, 178, 181, 184, 187, 190, 193, 196, 199, 224,
-                                        246, 249, 252, 278, 305, 308, 311, 314, 326, 329};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE || 0
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
-static const char *const yytname[] = {
-    "$end",       "error",       "$undefined",   "TOK_CONST_INT", "TOK_IDENTIFIER",
-    "TOK_OP_OR",  "TOK_OP_AND",  "'|'",          "'^'",           "'&'",
-    "TOK_OP_EQ",  "TOK_OP_NE",   "'<'",          "'>'",           "TOK_OP_LE",
-    "TOK_OP_GE",  "TOK_OP_LEFT", "TOK_OP_RIGHT", "'+'",           "'-'",
-    "'*'",        "'/'",         "'%'",          "TOK_UNARY",     "'!'",
-    "'~'",        "'('",         "')'",          "$accept",       "input",
-    "expression", "$@1",         "$@2",          YY_NULLPTR};
-#endif
-
-#ifdef YYPRINT
-/* YYTOKNUM[NUM] -- (External) token number corresponding to the
-   (internal) symbol number NUM (which must be that of a token).  */
-static const yytype_uint16 yytoknum[] = {0,   256, 257, 258, 259, 260, 261, 124, 94, 38,
-                                         262, 263, 60,  62,  264, 265, 266, 267, 43, 45,
-                                         42,  47,  37,  268, 33,  126, 40,  41};
-#endif
-
-#define YYPACT_NINF -12
-
-#define yypact_value_is_default(Yystate) (!!((Yystate) == (-12)))
-
-#define YYTABLE_NINF -1
-
-#define yytable_value_is_error(Yytable_value) 0
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-static const yytype_int16 yypact[] = {
-    31,  -12, -12, 31,  31,  31,  31,  31,  51,  76,  -12, -12, -12, -12, 53,  -12, -12, -12, 31,
-    31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  -12, 31,  31,  124,
-    138, 26,  149, 149, -11, -11, -11, -11, 154, 154, -8,  -8,  -12, -12, -12, 93,  109};
-
-/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
-   Performed when YYTABLE does not specify something else to do.  Zero
-   means the default is an error.  */
-static const yytype_uint8 yydefact[] = {0,  3,  4,  0,  0,  0,  0,  0,  0,  2,  28, 27, 25, 26,
-                                        0,  1,  5,  7,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-                                        0,  0,  0,  0,  0,  0,  29, 0,  0,  9,  10, 11, 13, 12,
-                                        17, 16, 15, 14, 19, 18, 21, 20, 24, 23, 22, 6,  8};
-
-/* YYPGOTO[NTERM-NUM].  */
-static const yytype_int8 yypgoto[] = {-12, -12, -3, -12, -12};
-
-/* YYDEFGOTO[NTERM-NUM].  */
-static const yytype_int8 yydefgoto[] = {-1, 8, 9, 35, 36};
-
-/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule whose
-   number is the opposite.  If YYTABLE_NINF, syntax error.  */
-static const yytype_uint8 yytable[] = {
-    10, 11, 12, 13, 14, 27, 28, 29, 30, 31, 32, 33, 31, 32, 33, 37, 38, 39, 40, 41, 42, 43, 44,
-    45, 46, 47, 48, 49, 50, 51, 52, 0,  53, 54, 1,  2,  21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
-    31, 32, 33, 3,  4,  15, 0,  0,  0,  5,  6,  7,  16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
-    27, 28, 29, 30, 31, 32, 33, 0,  0,  0,  0,  34, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
-    27, 28, 29, 30, 31, 32, 33, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
-    33, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 19, 20, 21, 22, 23, 24,
-    25, 26, 27, 28, 29, 30, 31, 32, 33, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
-    23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 29, 30, 31, 32, 33};
-
-static const yytype_int8 yycheck[] = {
-    3,  4,  5,  6,  7,  16, 17, 18, 19, 20, 21, 22, 20, 21, 22, 18, 19, 20, 21, 22, 23, 24, 25,
-    26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 3,  4,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
-    20, 21, 22, 18, 19, 0,  -1, -1, -1, 24, 25, 26, 5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
-    22, 7,  8,  9,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 8,  9,  10, 11, 12, 13,
-    14, 15, 16, 17, 18, 19, 20, 21, 22, 9,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
-    12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 18, 19, 20, 21, 22};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
-static const yytype_uint8 yystos[] = {0,  3,  4,  18, 19, 24, 25, 26, 29, 30, 30, 30, 30, 30,
-                                      30, 0,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
-                                      17, 18, 19, 20, 21, 22, 27, 31, 32, 30, 30, 30, 30, 30,
-                                      30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30};
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint8 yyr1[] = {0,  28, 29, 30, 30, 31, 30, 32, 30, 30, 30, 30, 30, 30, 30,
-                                    30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30};
-
-/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] = {0, 2, 1, 1, 1, 0, 4, 0, 4, 3, 3, 3, 3, 3, 3,
-                                    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3};
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
-
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
-
-#define YYRECOVERING() (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value)                                     \
-    do                                                             \
-        if (yychar == YYEMPTY)                                     \
-        {                                                          \
-            yychar = (Token);                                      \
-            yylval = (Value);                                      \
-            YYPOPSTACK(yylen);                                     \
-            yystate = *yyssp;                                      \
-            goto yybackup;                                         \
-        }                                                          \
-        else                                                       \
-        {                                                          \
-            yyerror(context, YY_("syntax error: cannot back up")); \
-            YYERROR;                                               \
-        }                                                          \
-    while (0)
-
-/* Error token number */
-#define YYTERROR 1
-#define YYERRCODE 256
-
-/* Enable debugging if requested.  */
-#if YYDEBUG
-
-#    ifndef YYFPRINTF
-#        include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#        define YYFPRINTF fprintf
-#    endif
-
-#    define YYDPRINTF(Args)     \
-        do                      \
-        {                       \
-            if (yydebug)        \
-                YYFPRINTF Args; \
-        } while (0)
-
-/* This macro is provided for backward compatibility. */
-#    ifndef YY_LOCATION_PRINT
-#        define YY_LOCATION_PRINT(File, Loc) ((void)0)
-#    endif
-
-#    define YY_SYMBOL_PRINT(Title, Type, Value, Location)      \
-        do                                                     \
-        {                                                      \
-            if (yydebug)                                       \
-            {                                                  \
-                YYFPRINTF(stderr, "%s ", Title);               \
-                yy_symbol_print(stderr, Type, Value, context); \
-                YYFPRINTF(stderr, "\n");                       \
-            }                                                  \
-        } while (0)
-
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT.  |
-`----------------------------------------*/
-
-static void yy_symbol_value_print(FILE *yyoutput,
-                                  int yytype,
-                                  YYSTYPE const *const yyvaluep,
-                                  Context *context)
-{
-    FILE *yyo = yyoutput;
-    YYUSE(yyo);
-    YYUSE(context);
-    if (!yyvaluep)
-        return;
-#    ifdef YYPRINT
-    if (yytype < YYNTOKENS)
-        YYPRINT(yyoutput, yytoknum[yytype], *yyvaluep);
-#    endif
-    YYUSE(yytype);
-}
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-static void yy_symbol_print(FILE *yyoutput,
-                            int yytype,
-                            YYSTYPE const *const yyvaluep,
-                            Context *context)
-{
-    YYFPRINTF(yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
-
-    yy_symbol_value_print(yyoutput, yytype, yyvaluep, context);
-    YYFPRINTF(yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included).                                                   |
-`------------------------------------------------------------------*/
-
-static void yy_stack_print(yytype_int16 *yybottom, yytype_int16 *yytop)
-{
-    YYFPRINTF(stderr, "Stack now");
-    for (; yybottom <= yytop; yybottom++)
-    {
-        int yybot = *yybottom;
-        YYFPRINTF(stderr, " %d", yybot);
-    }
-    YYFPRINTF(stderr, "\n");
-}
-
-#    define YY_STACK_PRINT(Bottom, Top)          \
-        do                                       \
-        {                                        \
-            if (yydebug)                         \
-                yy_stack_print((Bottom), (Top)); \
-        } while (0)
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced.  |
-`------------------------------------------------*/
-
-static void yy_reduce_print(yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, Context *context)
-{
-    unsigned long int yylno = yyrline[yyrule];
-    int yynrhs              = yyr2[yyrule];
-    int yyi;
-    YYFPRINTF(stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno);
-    /* The symbols being reduced.  */
-    for (yyi = 0; yyi < yynrhs; yyi++)
-    {
-        YYFPRINTF(stderr, "   $%d = ", yyi + 1);
-        yy_symbol_print(stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)]),
-                        context);
-        YYFPRINTF(stderr, "\n");
-    }
-}
-
-#    define YY_REDUCE_PRINT(Rule)                             \
-        do                                                    \
-        {                                                     \
-            if (yydebug)                                      \
-                yy_reduce_print(yyssp, yyvsp, Rule, context); \
-        } while (0)
-
-/* Nonzero means print parse trace.  It is left uninitialized so that
-   multiple parsers can coexist.  */
-int yydebug;
-#else /* !YYDEBUG */
-#    define YYDPRINTF(Args)
-#    define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-#    define YY_STACK_PRINT(Bottom, Top)
-#    define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-/* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef YYINITDEPTH
-#    define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
-   if the built-in stack extension method is used).
-
-   Do not make this value too large; the results are undefined if
-   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
-   evaluated with infinite-precision integer arithmetic.  */
-
-#ifndef YYMAXDEPTH
-#    define YYMAXDEPTH 10000
-#endif
-
-#if YYERROR_VERBOSE
-
-#    ifndef yystrlen
-#        if defined __GLIBC__ && defined _STRING_H
-#            define yystrlen strlen
-#        else
-/* Return the length of YYSTR.  */
-static YYSIZE_T yystrlen(const char *yystr)
-{
-    YYSIZE_T yylen;
-    for (yylen = 0; yystr[yylen]; yylen++)
-        continue;
-    return yylen;
-}
-#        endif
-#    endif
-
-#    ifndef yystpcpy
-#        if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-#            define yystpcpy stpcpy
-#        else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
-   YYDEST.  */
-static char *yystpcpy(char *yydest, const char *yysrc)
-{
-    char *yyd       = yydest;
-    const char *yys = yysrc;
-
-    while ((*yyd++ = *yys++) != '\0')
-        continue;
-
-    return yyd - 1;
-}
-#        endif
-#    endif
-
-#    ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
-   quotes and backslashes, so that it's suitable for yyerror.  The
-   heuristic is that double-quoting is unnecessary unless the string
-   contains an apostrophe, a comma, or backslash (other than
-   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
-   null, do not copy; instead, return the length of what the result
-   would have been.  */
-static YYSIZE_T yytnamerr(char *yyres, const char *yystr)
-{
-    if (*yystr == '"')
-    {
-        YYSIZE_T yyn    = 0;
-        char const *yyp = yystr;
-
-        for (;;)
-            switch (*++yyp)
-            {
-                case '\'':
-                case ',':
-                    goto do_not_strip_quotes;
-
-                case '\\':
-                    if (*++yyp != '\\')
-                        goto do_not_strip_quotes;
-                    /* Fall through.  */
-                default:
-                    if (yyres)
-                        yyres[yyn] = *yyp;
-                    yyn++;
-                    break;
-
-                case '"':
-                    if (yyres)
-                        yyres[yyn] = '\0';
-                    return yyn;
-            }
-    do_not_strip_quotes:;
-    }
-
-    if (!yyres)
-        return yystrlen(yystr);
-
-    return yystpcpy(yyres, yystr) - yyres;
-}
-#    endif
-
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
-   about the unexpected token YYTOKEN for the state stack whose top is
-   YYSSP.
-
-   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
-   not large enough to hold the message.  In that case, also set
-   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
-   required number of bytes is too large to store.  */
-static int yysyntax_error(YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
-{
-    YYSIZE_T yysize0 = yytnamerr(YY_NULLPTR, yytname[yytoken]);
-    YYSIZE_T yysize  = yysize0;
-    enum
-    {
-        YYERROR_VERBOSE_ARGS_MAXIMUM = 5
-    };
-    /* Internationalized format string. */
-    const char *yyformat = YY_NULLPTR;
-    /* Arguments of yyformat. */
-    char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-    /* Number of reported tokens (one for the "unexpected", one per
-       "expected"). */
-    int yycount = 0;
-
-    /* There are many possibilities here to consider:
-       - If this state is a consistent state with a default action, then
-         the only way this function was invoked is if the default action
-         is an error action.  In that case, don't check for expected
-         tokens because there are none.
-       - The only way there can be no lookahead present (in yychar) is if
-         this state is a consistent state with a default action.  Thus,
-         detecting the absence of a lookahead is sufficient to determine
-         that there is no unexpected or expected token to report.  In that
-         case, just report a simple "syntax error".
-       - Don't assume there isn't a lookahead just because this state is a
-         consistent state with a default action.  There might have been a
-         previous inconsistent state, consistent state with a non-default
-         action, or user semantic action that manipulated yychar.
-       - Of course, the expected token list depends on states to have
-         correct lookahead information, and it depends on the parser not
-         to perform extra reductions after fetching a lookahead from the
-         scanner and before detecting a syntax error.  Thus, state merging
-         (from LALR or IELR) and default reductions corrupt the expected
-         token list.  However, the list is correct for canonical LR with
-         one exception: it will still contain any token that will not be
-         accepted due to an error action in a later state.
-    */
-    if (yytoken != YYEMPTY)
-    {
-        int yyn          = yypact[*yyssp];
-        yyarg[yycount++] = yytname[yytoken];
-        if (!yypact_value_is_default(yyn))
-        {
-            /* Start YYX at -YYN if negative to avoid negative indexes in
-               YYCHECK.  In other words, skip the first -YYN actions for
-               this state because they are default actions.  */
-            int yyxbegin = yyn < 0 ? -yyn : 0;
-            /* Stay within bounds of both yycheck and yytname.  */
-            int yychecklim = YYLAST - yyn + 1;
-            int yyxend     = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-            int yyx;
-
-            for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-                if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR &&
-                    !yytable_value_is_error(yytable[yyx + yyn]))
-                {
-                    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-                    {
-                        yycount = 1;
-                        yysize  = yysize0;
-                        break;
-                    }
-                    yyarg[yycount++] = yytname[yyx];
-                    {
-                        YYSIZE_T yysize1 = yysize + yytnamerr(YY_NULLPTR, yytname[yyx]);
-                        if (!(yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-                            return 2;
-                        yysize = yysize1;
-                    }
-                }
-        }
-    }
-
-    switch (yycount)
-    {
-#    define YYCASE_(N, S) \
-        case N:           \
-            yyformat = S; \
-            break
-        YYCASE_(0, YY_("syntax error"));
-        YYCASE_(1, YY_("syntax error, unexpected %s"));
-        YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
-        YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
-        YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
-        YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-#    undef YYCASE_
-    }
-
-    {
-        YYSIZE_T yysize1 = yysize + yystrlen(yyformat);
-        if (!(yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-            return 2;
-        yysize = yysize1;
-    }
-
-    if (*yymsg_alloc < yysize)
-    {
-        *yymsg_alloc = 2 * yysize;
-        if (!(yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
-            *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
-        return 1;
-    }
-
-    /* Avoid sprintf, as that infringes on the user's name space.
-       Don't have undefined behavior even if the translation
-       produced a string with the wrong number of "%s"s.  */
-    {
-        char *yyp = *yymsg;
-        int yyi   = 0;
-        while ((*yyp = *yyformat) != '\0')
-            if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
-            {
-                yyp += yytnamerr(yyp, yyarg[yyi++]);
-                yyformat += 2;
-            }
-            else
-            {
-                yyp++;
-                yyformat++;
-            }
-    }
-    return 0;
-}
-#endif /* YYERROR_VERBOSE */
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol.  |
-`-----------------------------------------------*/
-
-static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep, Context *context)
-{
-    YYUSE(yyvaluep);
-    YYUSE(context);
-    if (!yymsg)
-        yymsg = "Deleting";
-    YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp);
-
-    YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-    YYUSE(yytype);
-    YY_IGNORE_MAYBE_UNINITIALIZED_END
-}
-
-/*----------.
-| yyparse.  |
-`----------*/
-
-int yyparse(Context *context)
-{
-    /* The lookahead symbol.  */
-    int yychar;
-
-    /* The semantic value of the lookahead symbol.  */
-    /* Default value used for initialization, for pacifying older GCCs
-       or non-GCC compilers.  */
-    YY_INITIAL_VALUE(static YYSTYPE yyval_default;)
-    YYSTYPE yylval YY_INITIAL_VALUE(= yyval_default);
-
-    /* Number of syntax errors so far.  */
-    int yynerrs;
-
-    int yystate;
-    /* Number of tokens to shift before error messages enabled.  */
-    int yyerrstatus;
-
-    /* The stacks and their tools:
-       'yyss': related to states.
-       'yyvs': related to semantic values.
-
-       Refer to the stacks through separate pointers, to allow yyoverflow
-       to reallocate them elsewhere.  */
-
-    /* The state stack.  */
-    yytype_int16 yyssa[YYINITDEPTH];
-    yytype_int16 *yyss;
-    yytype_int16 *yyssp;
-
-    /* The semantic value stack.  */
-    YYSTYPE yyvsa[YYINITDEPTH];
-    YYSTYPE *yyvs;
-    YYSTYPE *yyvsp;
-
-    YYSIZE_T yystacksize;
-
-    int yyn;
-    int yyresult;
-    /* Lookahead token as an internal (translated) token number.  */
-    int yytoken = 0;
-    /* The variables used to return semantic value and location from the
-       action routines.  */
-    YYSTYPE yyval;
-
-#if YYERROR_VERBOSE
-    /* Buffer for error messages, and its allocated size.  */
-    char yymsgbuf[128];
-    char *yymsg          = yymsgbuf;
-    YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
-
-    /* The number of symbols on the RHS of the reduced rule.
-       Keep to zero when no symbol should be popped.  */
-    int yylen = 0;
-
-    yyssp = yyss = yyssa;
-    yyvsp = yyvs = yyvsa;
-    yystacksize  = YYINITDEPTH;
-
-    YYDPRINTF((stderr, "Starting parse\n"));
-
-    yystate     = 0;
-    yyerrstatus = 0;
-    yynerrs     = 0;
-    yychar      = YYEMPTY; /* Cause a token to be read.  */
-    goto yysetstate;
-
-    /*------------------------------------------------------------.
-    | yynewstate -- Push a new state, which is found in yystate.  |
-    `------------------------------------------------------------*/
-yynewstate:
-    /* In all cases, when you get here, the value and location stacks
-       have just been pushed.  So pushing a state here evens the stacks.  */
-    yyssp++;
-
-yysetstate:
-    *yyssp = yystate;
-
-    if (yyss + yystacksize - 1 <= yyssp)
-    {
-        /* Get the current used size of the three stacks, in elements.  */
-        YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-        {
-            /* Give user a chance to reallocate the stack.  Use copies of
-               these so that the &'s don't force the real ones into
-               memory.  */
-            YYSTYPE *yyvs1      = yyvs;
-            yytype_int16 *yyss1 = yyss;
-
-            /* Each stack pointer address is followed by the size of the
-               data in use in that stack, in bytes.  This used to be a
-               conditional around just the two extra args, but that might
-               be undefined if yyoverflow is a macro.  */
-            yyoverflow(YY_("memory exhausted"), &yyss1, yysize * sizeof(*yyssp), &yyvs1,
-                       yysize * sizeof(*yyvsp), &yystacksize);
-
-            yyss = yyss1;
-            yyvs = yyvs1;
-        }
-#else /* no yyoverflow */
-#    ifndef YYSTACK_RELOCATE
-        goto yyexhaustedlab;
-#    else
-        /* Extend the stack our own way.  */
-        if (YYMAXDEPTH <= yystacksize)
-            goto yyexhaustedlab;
-        yystacksize *= 2;
-        if (YYMAXDEPTH < yystacksize)
-            yystacksize = YYMAXDEPTH;
-
-        {
-            yytype_int16 *yyss1  = yyss;
-            union yyalloc *yyptr = (union yyalloc *)YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize));
-            if (!yyptr)
-                goto yyexhaustedlab;
-            YYSTACK_RELOCATE(yyss_alloc, yyss);
-            YYSTACK_RELOCATE(yyvs_alloc, yyvs);
-#        undef YYSTACK_RELOCATE
-            if (yyss1 != yyssa)
-                YYSTACK_FREE(yyss1);
-        }
-#    endif
-#endif /* no yyoverflow */
-
-        yyssp = yyss + yysize - 1;
-        yyvsp = yyvs + yysize - 1;
-
-        YYDPRINTF((stderr, "Stack size increased to %lu\n", (unsigned long int)yystacksize));
-
-        if (yyss + yystacksize - 1 <= yyssp)
-            YYABORT;
-    }
-
-    YYDPRINTF((stderr, "Entering state %d\n", yystate));
-
-    if (yystate == YYFINAL)
-        YYACCEPT;
-
-    goto yybackup;
-
-/*-----------.
-| yybackup.  |
-`-----------*/
-yybackup:
-
-    /* Do appropriate processing given the current state.  Read a
-       lookahead token if we need one and don't already have one.  */
-
-    /* First try to decide what to do without reference to lookahead token.  */
-    yyn = yypact[yystate];
-    if (yypact_value_is_default(yyn))
-        goto yydefault;
-
-    /* Not known => get a lookahead token if don't already have one.  */
-
-    /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
-    if (yychar == YYEMPTY)
-    {
-        YYDPRINTF((stderr, "Reading a token: "));
-        yychar = yylex(&yylval, context);
-    }
-
-    if (yychar <= YYEOF)
-    {
-        yychar = yytoken = YYEOF;
-        YYDPRINTF((stderr, "Now at end of input.\n"));
-    }
-    else
-    {
-        yytoken = YYTRANSLATE(yychar);
-        YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc);
-    }
-
-    /* If the proper action on seeing token YYTOKEN is to reduce or to
-       detect an error, take that action.  */
-    yyn += yytoken;
-    if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
-        goto yydefault;
-    yyn = yytable[yyn];
-    if (yyn <= 0)
-    {
-        if (yytable_value_is_error(yyn))
-            goto yyerrlab;
-        yyn = -yyn;
-        goto yyreduce;
-    }
-
-    /* Count tokens shifted since error; after three, turn off error
-       status.  */
-    if (yyerrstatus)
-        yyerrstatus--;
-
-    /* Shift the lookahead token.  */
-    YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc);
-
-    /* Discard the shifted token.  */
-    yychar = YYEMPTY;
-
-    yystate = yyn;
-    YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-    *++yyvsp = yylval;
-    YY_IGNORE_MAYBE_UNINITIALIZED_END
-
-    goto yynewstate;
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state.  |
-`-----------------------------------------------------------*/
-yydefault:
-    yyn = yydefact[yystate];
-    if (yyn == 0)
-        goto yyerrlab;
-    goto yyreduce;
-
-/*-----------------------------.
-| yyreduce -- Do a reduction.  |
-`-----------------------------*/
-yyreduce:
-    /* yyn is the number of a rule to reduce with.  */
-    yylen = yyr2[yyn];
-
-    /* If YYLEN is nonzero, implement the default value of the action:
-       '$$ = $1'.
-
-       Otherwise, the following line sets YYVAL to garbage.
-       This behavior is undocumented and Bison
-       users should not rely upon it.  Assigning to YYVAL
-       unconditionally makes the parser a bit smaller, and it avoids a
-       GCC warning that YYVAL may be used uninitialized.  */
-    yyval = yyvsp[1 - yylen];
-
-    YY_REDUCE_PRINT(yyn);
-    switch (yyn)
-    {
-        case 2:
-
-        {
-            *(context->result) = static_cast<int>((yyvsp[0]));
-            YYACCEPT;
-        }
-
-        break;
-
-        case 4:
-
-        {
-            if (!context->isIgnoringErrors())
-            {
-                // This rule should be applied right after the token is lexed, so we can
-                // refer to context->token in the error message.
-                context->diagnostics->report(context->errorSettings.unexpectedIdentifier,
-                                             context->token->location, context->token->text);
-                *(context->valid) = false;
-            }
-            (yyval) = (yyvsp[0]);
-        }
-
-        break;
-
-        case 5:
-
-        {
-            if ((yyvsp[-1]) != 0)
-            {
-                // Ignore errors in the short-circuited part of the expression.
-                // ESSL3.00 section 3.4:
-                // If an operand is not evaluated, the presence of undefined identifiers
-                // in the operand will not cause an error.
-                // Unevaluated division by zero should not cause an error either.
-                context->startIgnoreErrors();
-            }
-        }
-
-        break;
-
-        case 6:
-
-        {
-            if ((yyvsp[-3]) != 0)
-            {
-                context->endIgnoreErrors();
-                (yyval) = static_cast<YYSTYPE>(1);
-            }
-            else
-            {
-                (yyval) = (yyvsp[-3]) || (yyvsp[0]);
-            }
-        }
-
-        break;
-
-        case 7:
-
-        {
-            if ((yyvsp[-1]) == 0)
-            {
-                // Ignore errors in the short-circuited part of the expression.
-                // ESSL3.00 section 3.4:
-                // If an operand is not evaluated, the presence of undefined identifiers
-                // in the operand will not cause an error.
-                // Unevaluated division by zero should not cause an error either.
-                context->startIgnoreErrors();
-            }
-        }
-
-        break;
-
-        case 8:
-
-        {
-            if ((yyvsp[-3]) == 0)
-            {
-                context->endIgnoreErrors();
-                (yyval) = static_cast<YYSTYPE>(0);
-            }
-            else
-            {
-                (yyval) = (yyvsp[-3]) && (yyvsp[0]);
-            }
-        }
-
-        break;
-
-        case 9:
-
-        {
-            (yyval) = (yyvsp[-2]) | (yyvsp[0]);
-        }
-
-        break;
-
-        case 10:
-
-        {
-            (yyval) = (yyvsp[-2]) ^ (yyvsp[0]);
-        }
-
-        break;
-
-        case 11:
-
-        {
-            (yyval) = (yyvsp[-2]) & (yyvsp[0]);
-        }
-
-        break;
-
-        case 12:
-
-        {
-            (yyval) = (yyvsp[-2]) != (yyvsp[0]);
-        }
-
-        break;
-
-        case 13:
-
-        {
-            (yyval) = (yyvsp[-2]) == (yyvsp[0]);
-        }
-
-        break;
-
-        case 14:
-
-        {
-            (yyval) = (yyvsp[-2]) >= (yyvsp[0]);
-        }
-
-        break;
-
-        case 15:
-
-        {
-            (yyval) = (yyvsp[-2]) <= (yyvsp[0]);
-        }
-
-        break;
-
-        case 16:
-
-        {
-            (yyval) = (yyvsp[-2]) > (yyvsp[0]);
-        }
-
-        break;
-
-        case 17:
-
-        {
-            (yyval) = (yyvsp[-2]) < (yyvsp[0]);
-        }
-
-        break;
-
-        case 18:
-
-        {
-            if ((yyvsp[0]) < 0 || (yyvsp[0]) > 31)
-            {
-                if (!context->isIgnoringErrors())
-                {
-                    std::ostringstream stream;
-                    stream << (yyvsp[-2]) << " >> " << (yyvsp[0]);
-                    std::string text = stream.str();
-                    context->diagnostics->report(angle::pp::Diagnostics::PP_UNDEFINED_SHIFT,
-                                                 context->token->location, text.c_str());
-                    *(context->valid) = false;
-                }
-                (yyval) = static_cast<YYSTYPE>(0);
-            }
-            else if ((yyvsp[-2]) < 0)
-            {
-                // Logical shift right.
-                (yyval) =
-                    static_cast<YYSTYPE>(static_cast<UNSIGNED_TYPE>((yyvsp[-2])) >> (yyvsp[0]));
-            }
-            else
-            {
-                (yyval) = (yyvsp[-2]) >> (yyvsp[0]);
-            }
-        }
-
-        break;
-
-        case 19:
-
-        {
-            if ((yyvsp[0]) < 0 || (yyvsp[0]) > 31)
-            {
-                if (!context->isIgnoringErrors())
-                {
-                    std::ostringstream stream;
-                    stream << (yyvsp[-2]) << " << " << (yyvsp[0]);
-                    std::string text = stream.str();
-                    context->diagnostics->report(angle::pp::Diagnostics::PP_UNDEFINED_SHIFT,
-                                                 context->token->location, text.c_str());
-                    *(context->valid) = false;
-                }
-                (yyval) = static_cast<YYSTYPE>(0);
-            }
-            else
-            {
-                // Logical shift left. Casting to unsigned is needed to ensure there's no signed
-                // integer overflow, which some tools treat as an error.
-                (yyval) =
-                    static_cast<YYSTYPE>(static_cast<UNSIGNED_TYPE>((yyvsp[-2])) << (yyvsp[0]));
-            }
-        }
-
-        break;
-
-        case 20:
-
-        {
-            (yyval) = gl::WrappingDiff<YYSTYPE>((yyvsp[-2]), (yyvsp[0]));
-        }
-
-        break;
-
-        case 21:
-
-        {
-            (yyval) = gl::WrappingSum<YYSTYPE>((yyvsp[-2]), (yyvsp[0]));
-        }
-
-        break;
-
-        case 22:
-
-        {
-            if ((yyvsp[0]) == 0)
-            {
-                if (!context->isIgnoringErrors())
-                {
-                    std::ostringstream stream;
-                    stream << (yyvsp[-2]) << " % " << (yyvsp[0]);
-                    std::string text = stream.str();
-                    context->diagnostics->report(angle::pp::Diagnostics::PP_DIVISION_BY_ZERO,
-                                                 context->token->location, text.c_str());
-                    *(context->valid) = false;
-                }
-                (yyval) = static_cast<YYSTYPE>(0);
-            }
-            else if (((yyvsp[-2]) == std::numeric_limits<YYSTYPE>::min()) && ((yyvsp[0]) == -1))
-            {
-                // Check for the special case where the minimum representable number is
-                // divided by -1. If left alone this has undefined results.
-                (yyval) = 0;
-            }
-            else
-            {
-                (yyval) = (yyvsp[-2]) % (yyvsp[0]);
-            }
-        }
-
-        break;
-
-        case 23:
-
-        {
-            if ((yyvsp[0]) == 0)
-            {
-                if (!context->isIgnoringErrors())
-                {
-                    std::ostringstream stream;
-                    stream << (yyvsp[-2]) << " / " << (yyvsp[0]);
-                    std::string text = stream.str();
-                    context->diagnostics->report(angle::pp::Diagnostics::PP_DIVISION_BY_ZERO,
-                                                 context->token->location, text.c_str());
-                    *(context->valid) = false;
-                }
-                (yyval) = static_cast<YYSTYPE>(0);
-            }
-            else if (((yyvsp[-2]) == std::numeric_limits<YYSTYPE>::min()) && ((yyvsp[0]) == -1))
-            {
-                // Check for the special case where the minimum representable number is
-                // divided by -1. If left alone this leads to integer overflow in C++, which
-                // has undefined results.
-                (yyval) = std::numeric_limits<YYSTYPE>::max();
-            }
-            else
-            {
-                (yyval) = (yyvsp[-2]) / (yyvsp[0]);
-            }
-        }
-
-        break;
-
-        case 24:
-
-        {
-            (yyval) = gl::WrappingMul((yyvsp[-2]), (yyvsp[0]));
-        }
-
-        break;
-
-        case 25:
-
-        {
-            (yyval) = !(yyvsp[0]);
-        }
-
-        break;
-
-        case 26:
-
-        {
-            (yyval) = ~(yyvsp[0]);
-        }
-
-        break;
-
-        case 27:
-
-        {
-            // Check for negation of minimum representable integer to prevent undefined signed int
-            // overflow.
-            if ((yyvsp[0]) == std::numeric_limits<YYSTYPE>::min())
-            {
-                (yyval) = std::numeric_limits<YYSTYPE>::min();
-            }
-            else
-            {
-                (yyval) = -(yyvsp[0]);
-            }
-        }
-
-        break;
-
-        case 28:
-
-        {
-            (yyval) = +(yyvsp[0]);
-        }
-
-        break;
-
-        case 29:
-
-        {
-            (yyval) = (yyvsp[-1]);
-        }
-
-        break;
-
-        default:
-            break;
-    }
-    /* User semantic actions sometimes alter yychar, and that requires
-       that yytoken be updated with the new translation.  We take the
-       approach of translating immediately before every use of yytoken.
-       One alternative is translating here after every semantic action,
-       but that translation would be missed if the semantic action invokes
-       YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
-       if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
-       incorrect destructor might then be invoked immediately.  In the
-       case of YYERROR or YYBACKUP, subsequent parser actions might lead
-       to an incorrect destructor call or verbose syntax error message
-       before the lookahead is translated.  */
-    YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
-    YYPOPSTACK(yylen);
-    yylen = 0;
-    YY_STACK_PRINT(yyss, yyssp);
-
-    *++yyvsp = yyval;
-
-    /* Now 'shift' the result of the reduction.  Determine what state
-       that goes to, based on the state we popped back to and the rule
-       number reduced by.  */
-
-    yyn = yyr1[yyn];
-
-    yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
-    if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-        yystate = yytable[yystate];
-    else
-        yystate = yydefgoto[yyn - YYNTOKENS];
-
-    goto yynewstate;
-
-/*--------------------------------------.
-| yyerrlab -- here on detecting error.  |
-`--------------------------------------*/
-yyerrlab:
-    /* Make sure we have latest lookahead translation.  See comments at
-       user semantic actions for why this is necessary.  */
-    yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE(yychar);
-
-    /* If not already recovering from an error, report this error.  */
-    if (!yyerrstatus)
-    {
-        ++yynerrs;
-#if !YYERROR_VERBOSE
-        yyerror(context, YY_("syntax error"));
-#else
-#    define YYSYNTAX_ERROR yysyntax_error(&yymsg_alloc, &yymsg, yyssp, yytoken)
-        {
-            char const *yymsgp = YY_("syntax error");
-            int yysyntax_error_status;
-            yysyntax_error_status = YYSYNTAX_ERROR;
-            if (yysyntax_error_status == 0)
-                yymsgp = yymsg;
-            else if (yysyntax_error_status == 1)
-            {
-                if (yymsg != yymsgbuf)
-                    YYSTACK_FREE(yymsg);
-                yymsg = (char *)YYSTACK_ALLOC(yymsg_alloc);
-                if (!yymsg)
-                {
-                    yymsg                 = yymsgbuf;
-                    yymsg_alloc           = sizeof yymsgbuf;
-                    yysyntax_error_status = 2;
-                }
-                else
-                {
-                    yysyntax_error_status = YYSYNTAX_ERROR;
-                    yymsgp                = yymsg;
-                }
-            }
-            yyerror(context, yymsgp);
-            if (yysyntax_error_status == 2)
-                goto yyexhaustedlab;
-        }
-#    undef YYSYNTAX_ERROR
-#endif
-    }
-
-    if (yyerrstatus == 3)
-    {
-        /* If just tried and failed to reuse lookahead token after an
-           error, discard it.  */
-
-        if (yychar <= YYEOF)
-        {
-            /* Return failure if at end of input.  */
-            if (yychar == YYEOF)
-                YYABORT;
-        }
-        else
-        {
-            yydestruct("Error: discarding", yytoken, &yylval, context);
-            yychar = YYEMPTY;
-        }
-    }
-
-    /* Else will try to reuse lookahead token after shifting the error
-       token.  */
-    goto yyerrlab1;
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR.  |
-`---------------------------------------------------*/
-yyerrorlab:
-
-    /* Pacify compilers like GCC when the user code never invokes
-       YYERROR and the label yyerrorlab therefore never appears in user
-       code.  */
-    if (/*CONSTCOND*/ 0)
-        goto yyerrorlab;
-
-    /* Do not reclaim the symbols of the rule whose action triggered
-       this YYERROR.  */
-    YYPOPSTACK(yylen);
-    yylen = 0;
-    YY_STACK_PRINT(yyss, yyssp);
-    yystate = *yyssp;
-    goto yyerrlab1;
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR.  |
-`-------------------------------------------------------------*/
-yyerrlab1:
-    yyerrstatus = 3; /* Each real token shifted decrements this.  */
-
-    for (;;)
-    {
-        yyn = yypact[yystate];
-        if (!yypact_value_is_default(yyn))
-        {
-            yyn += YYTERROR;
-            if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-            {
-                yyn = yytable[yyn];
-                if (0 < yyn)
-                    break;
-            }
-        }
-
-        /* Pop the current state because it cannot handle the error token.  */
-        if (yyssp == yyss)
-            YYABORT;
-
-        yydestruct("Error: popping", yystos[yystate], yyvsp, context);
-        YYPOPSTACK(1);
-        yystate = *yyssp;
-        YY_STACK_PRINT(yyss, yyssp);
-    }
-
-    YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-    *++yyvsp = yylval;
-    YY_IGNORE_MAYBE_UNINITIALIZED_END
-
-    /* Shift the error token.  */
-    YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp);
-
-    yystate = yyn;
-    goto yynewstate;
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here.  |
-`-------------------------------------*/
-yyacceptlab:
-    yyresult = 0;
-    goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here.  |
-`-----------------------------------*/
-yyabortlab:
-    yyresult = 1;
-    goto yyreturn;
-
-#if !defined yyoverflow || YYERROR_VERBOSE
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here.  |
-`-------------------------------------------------*/
-yyexhaustedlab:
-    yyerror(context, YY_("memory exhausted"));
-    yyresult = 2;
-    /* Fall through.  */
-#endif
-
-yyreturn:
-    if (yychar != YYEMPTY)
-    {
-        /* Make sure we have latest lookahead translation.  See comments at
-           user semantic actions for why this is necessary.  */
-        yytoken = YYTRANSLATE(yychar);
-        yydestruct("Cleanup: discarding lookahead", yytoken, &yylval, context);
-    }
-    /* Do not reclaim the symbols of the rule whose action triggered
-       this YYABORT or YYACCEPT.  */
-    YYPOPSTACK(yylen);
-    YY_STACK_PRINT(yyss, yyssp);
-    while (yyssp != yyss)
-    {
-        yydestruct("Cleanup: popping", yystos[*yyssp], yyvsp, context);
-        YYPOPSTACK(1);
-    }
-#ifndef yyoverflow
-    if (yyss != yyssa)
-        YYSTACK_FREE(yyss);
-#endif
-#if YYERROR_VERBOSE
-    if (yymsg != yymsgbuf)
-        YYSTACK_FREE(yymsg);
-#endif
-    return yyresult;
-}
-
-int yylex(YYSTYPE *lvalp, Context *context)
-{
-    angle::pp::Token *token = context->token;
-    if (!context->parsePresetToken)
-    {
-        context->lexer->lex(token);
-    }
-    context->parsePresetToken = false;
-
-    int type = 0;
-
-    switch (token->type)
-    {
-        case angle::pp::Token::CONST_INT:
-        {
-            unsigned int val = 0;
-            int testVal      = 0;
-            if (!token->uValue(&val) ||
-                (!token->iValue(&testVal) &&
-                 context->errorSettings.integerLiteralsMustFit32BitSignedRange))
-            {
-                context->diagnostics->report(angle::pp::Diagnostics::PP_INTEGER_OVERFLOW,
-                                             token->location, token->text);
-                *(context->valid) = false;
-            }
-            *lvalp = static_cast<YYSTYPE>(val);
-            type   = TOK_CONST_INT;
-            break;
-        }
-        case angle::pp::Token::IDENTIFIER:
-            *lvalp = static_cast<YYSTYPE>(-1);
-            type   = TOK_IDENTIFIER;
-            break;
-        case angle::pp::Token::OP_OR:
-            type = TOK_OP_OR;
-            break;
-        case angle::pp::Token::OP_AND:
-            type = TOK_OP_AND;
-            break;
-        case angle::pp::Token::OP_NE:
-            type = TOK_OP_NE;
-            break;
-        case angle::pp::Token::OP_EQ:
-            type = TOK_OP_EQ;
-            break;
-        case angle::pp::Token::OP_GE:
-            type = TOK_OP_GE;
-            break;
-        case angle::pp::Token::OP_LE:
-            type = TOK_OP_LE;
-            break;
-        case angle::pp::Token::OP_RIGHT:
-            type = TOK_OP_RIGHT;
-            break;
-        case angle::pp::Token::OP_LEFT:
-            type = TOK_OP_LEFT;
-            break;
-        case '|':
-        case '^':
-        case '&':
-        case '>':
-        case '<':
-        case '-':
-        case '+':
-        case '%':
-        case '/':
-        case '*':
-        case '!':
-        case '~':
-        case '(':
-        case ')':
-            type = token->type;
-            break;
-
-        default:
-            break;
-    }
-
-    return type;
-}
-
-void yyerror(Context *context, const char *reason)
-{
-    context->diagnostics->report(angle::pp::Diagnostics::PP_INVALID_EXPRESSION,
-                                 context->token->location, reason);
-}
-
-namespace angle
-{
-
-namespace pp
-{
-
-ExpressionParser::ExpressionParser(Lexer *lexer, Diagnostics *diagnostics)
-    : mLexer(lexer), mDiagnostics(diagnostics)
-{}
-
-bool ExpressionParser::parse(Token *token,
-                             int *result,
-                             bool parsePresetToken,
-                             const ErrorSettings &errorSettings,
-                             bool *valid)
-{
-    Context context;
-    context.diagnostics      = mDiagnostics;
-    context.lexer            = mLexer;
-    context.token            = token;
-    context.result           = result;
-    context.ignoreErrors     = 0;
-    context.parsePresetToken = parsePresetToken;
-    context.errorSettings    = errorSettings;
-    context.valid            = valid;
-    int ret                  = yyparse(&context);
-    switch (ret)
-    {
-        case 0:
-        case 1:
-            break;
-
-        case 2:
-            mDiagnostics->report(Diagnostics::PP_OUT_OF_MEMORY, token->location, "");
-            break;
-
-        default:
-            assert(false);
-            mDiagnostics->report(Diagnostics::PP_INTERNAL_ERROR, token->location, "");
-            break;
-    }
-
-    return ret == 0;
-}
-
-}  // namespace pp
-
-}  // namespace angle
diff --git a/src/third_party/angle/src/compiler/preprocessor/ExpressionParser.y b/src/third_party/angle/src/compiler/preprocessor/ExpressionParser.y
deleted file mode 100644
index 16544d4..0000000
--- a/src/third_party/angle/src/compiler/preprocessor/ExpressionParser.y
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
-//
-// Copyright 2012 The ANGLE Project 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 contains the Yacc grammar for GLSL ES preprocessor expression.
-
-IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh,
-WHICH GENERATES THE GLSL ES preprocessor expression parser.
-*/
-
-%{
-//
-// Copyright 2012 The ANGLE Project 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 by generate_parser.sh. DO NOT EDIT!
-
-#if defined(__GNUC__)
-// Triggered by the auto-generated pplval variable.
-#if !defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
-#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-#else
-#pragma GCC diagnostic ignored "-Wuninitialized"
-#endif
-#elif defined(_MSC_VER)
-#pragma warning(disable: 4065 4244 4701 4702)
-#endif
-#if defined(__clang__)
-#pragma clang diagnostic ignored "-Wunreachable-code"
-#endif
-
-#include "ExpressionParser.h"
-
-#if defined(_MSC_VER)
-#include <malloc.h>
-#else
-#include <stdlib.h>
-#endif
-
-#include <cassert>
-#include <sstream>
-#include <stdint.h>
-
-#include "DiagnosticsBase.h"
-#include "Lexer.h"
-#include "Token.h"
-#include "common/mathutil.h"
-
-typedef int32_t YYSTYPE;
-typedef uint32_t UNSIGNED_TYPE;
-
-#define YYENABLE_NLS 0
-#define YYLTYPE_IS_TRIVIAL 1
-#define YYSTYPE_IS_TRIVIAL 1
-#define YYSTYPE_IS_DECLARED 1
-
-namespace {
-struct Context
-{
-    angle::pp::Diagnostics *diagnostics;
-    angle::pp::Lexer *lexer;
-    angle::pp::Token *token;
-    int* result;
-    bool parsePresetToken;
-
-    angle::pp::ExpressionParser::ErrorSettings errorSettings;
-    bool *valid;
-
-    void startIgnoreErrors() { ++ignoreErrors; }
-    void endIgnoreErrors() { --ignoreErrors; }
-
-    bool isIgnoringErrors() { return ignoreErrors > 0; }
-
-    int ignoreErrors;
-};
-}  // namespace
-%}
-
-%pure-parser
-%name-prefix "pp"
-%parse-param {Context *context}
-%lex-param {Context *context}
-
-%{
-static int yylex(YYSTYPE* lvalp, Context* context);
-static void yyerror(Context* context, const char* reason);
-%}
-
-%token TOK_CONST_INT
-%token TOK_IDENTIFIER
-%left TOK_OP_OR
-%left TOK_OP_AND
-%left '|'
-%left '^'
-%left '&'
-%left TOK_OP_EQ TOK_OP_NE
-%left '<' '>' TOK_OP_LE TOK_OP_GE
-%left TOK_OP_LEFT TOK_OP_RIGHT
-%left '+' '-'
-%left '*' '/' '%'
-%right TOK_UNARY
-
-%%
-
-input
-    : expression {
-        *(context->result) = static_cast<int>($1);
-        YYACCEPT;
-    }
-;
-
-expression
-    : TOK_CONST_INT
-    | TOK_IDENTIFIER {
-        if (!context->isIgnoringErrors())
-        {
-            // This rule should be applied right after the token is lexed, so we can
-            // refer to context->token in the error message.
-            context->diagnostics->report(context->errorSettings.unexpectedIdentifier,
-                                         context->token->location, context->token->text);
-            *(context->valid) = false;
-        }
-        $$ = $1;
-    }
-    | expression TOK_OP_OR {
-        if ($1 != 0)
-        {
-            // Ignore errors in the short-circuited part of the expression.
-            // ESSL3.00 section 3.4:
-            // If an operand is not evaluated, the presence of undefined identifiers
-            // in the operand will not cause an error.
-            // Unevaluated division by zero should not cause an error either.
-            context->startIgnoreErrors();
-        }
-    } expression {
-        if ($1 != 0)
-        {
-            context->endIgnoreErrors();
-            $$ = static_cast<YYSTYPE>(1);
-        }
-        else
-        {
-            $$ = $1 || $4;
-        }
-    }
-    | expression TOK_OP_AND {
-        if ($1 == 0)
-        {
-            // Ignore errors in the short-circuited part of the expression.
-            // ESSL3.00 section 3.4:
-            // If an operand is not evaluated, the presence of undefined identifiers
-            // in the operand will not cause an error.
-            // Unevaluated division by zero should not cause an error either.
-            context->startIgnoreErrors();
-        }
-    } expression {
-        if ($1 == 0)
-        {
-            context->endIgnoreErrors();
-            $$ = static_cast<YYSTYPE>(0);
-        }
-        else
-        {
-            $$ = $1 && $4;
-        }
-    }
-    | expression '|' expression {
-        $$ = $1 | $3;
-    }
-    | expression '^' expression {
-        $$ = $1 ^ $3;
-    }
-    | expression '&' expression {
-        $$ = $1 & $3;
-    }
-    | expression TOK_OP_NE expression {
-        $$ = $1 != $3;
-    }
-    | expression TOK_OP_EQ expression {
-        $$ = $1 == $3;
-    }
-    | expression TOK_OP_GE expression {
-        $$ = $1 >= $3;
-    }
-    | expression TOK_OP_LE expression {
-        $$ = $1 <= $3;
-    }
-    | expression '>' expression {
-        $$ = $1 > $3;
-    }
-    | expression '<' expression {
-        $$ = $1 < $3;
-    }
-    | expression TOK_OP_RIGHT expression {
-        if ($3 < 0 || $3 > 31)
-        {
-            if (!context->isIgnoringErrors())
-            {
-                std::ostringstream stream;
-                stream << $1 << " >> " << $3;
-                std::string text = stream.str();
-                context->diagnostics->report(angle::pp::Diagnostics::PP_UNDEFINED_SHIFT,
-                                             context->token->location,
-                                             text.c_str());
-                *(context->valid) = false;
-            }
-            $$ = static_cast<YYSTYPE>(0);
-        }
-        else if ($1 < 0)
-        {
-            // Logical shift right.
-            $$ = static_cast<YYSTYPE>(static_cast<UNSIGNED_TYPE>($1) >> $3);
-        }
-        else
-        {
-            $$ = $1 >> $3;
-        }
-    }
-    | expression TOK_OP_LEFT expression {
-        if ($3 < 0 || $3 > 31)
-        {
-            if (!context->isIgnoringErrors())
-            {
-                std::ostringstream stream;
-                stream << $1 << " << " << $3;
-                std::string text = stream.str();
-                context->diagnostics->report(angle::pp::Diagnostics::PP_UNDEFINED_SHIFT,
-                                             context->token->location,
-                                             text.c_str());
-                *(context->valid) = false;
-            }
-            $$ = static_cast<YYSTYPE>(0);
-        }
-        else
-        {
-            // Logical shift left. Casting to unsigned is needed to ensure there's no signed integer
-            // overflow, which some tools treat as an error.
-            $$ = static_cast<YYSTYPE>(static_cast<UNSIGNED_TYPE>($1) << $3);
-        }
-    }
-    | expression '-' expression {
-        $$ = gl::WrappingDiff<YYSTYPE>($1, $3);
-    }
-    | expression '+' expression {
-        $$ = gl::WrappingSum<YYSTYPE>($1, $3);
-    }
-    | expression '%' expression {
-        if ($3 == 0)
-        {
-            if (!context->isIgnoringErrors())
-            {
-                std::ostringstream stream;
-                stream << $1 << " % " << $3;
-                std::string text = stream.str();
-                context->diagnostics->report(angle::pp::Diagnostics::PP_DIVISION_BY_ZERO,
-                                             context->token->location,
-                                             text.c_str());
-                *(context->valid) = false;
-            }
-            $$ = static_cast<YYSTYPE>(0);
-        }
-        else if (($1 == std::numeric_limits<YYSTYPE>::min()) && ($3 == -1))
-        {
-            // Check for the special case where the minimum representable number is
-            // divided by -1. If left alone this has undefined results.
-            $$ = 0;
-        }
-        else
-        {
-            $$ = $1 % $3;
-        }
-    }
-    | expression '/' expression {
-        if ($3 == 0)
-        {
-            if (!context->isIgnoringErrors())
-            {
-                std::ostringstream stream;
-                stream << $1 << " / " << $3;
-                std::string text = stream.str();
-                context->diagnostics->report(angle::pp::Diagnostics::PP_DIVISION_BY_ZERO,
-                                            context->token->location,
-                                            text.c_str());
-                *(context->valid) = false;
-            }
-            $$ = static_cast<YYSTYPE>(0);
-        }
-        else if (($1 == std::numeric_limits<YYSTYPE>::min()) && ($3 == -1))
-        {
-            // Check for the special case where the minimum representable number is
-            // divided by -1. If left alone this leads to integer overflow in C++, which
-            // has undefined results.
-            $$ = std::numeric_limits<YYSTYPE>::max();
-        }
-        else
-        {
-            $$ = $1 / $3;
-        }
-    }
-    | expression '*' expression {
-        $$ = gl::WrappingMul($1, $3);
-    }
-    | '!' expression %prec TOK_UNARY {
-        $$ = ! $2;
-    }
-    | '~' expression %prec TOK_UNARY {
-        $$ = ~ $2;
-    }
-    | '-' expression %prec TOK_UNARY {
-        // Check for negation of minimum representable integer to prevent undefined signed int
-        // overflow.
-        if ($2 == std::numeric_limits<YYSTYPE>::min())
-        {
-            $$ = std::numeric_limits<YYSTYPE>::min();
-        }
-        else
-        {
-            $$ = -$2;
-        }
-    }
-    | '+' expression %prec TOK_UNARY {
-        $$ = + $2;
-    }
-    | '(' expression ')' {
-        $$ = $2;
-    }
-;
-
-%%
-
-int yylex(YYSTYPE *lvalp, Context *context)
-{
-    angle::pp::Token *token = context->token;
-    if (!context->parsePresetToken)
-    {
-        context->lexer->lex(token);
-    }
-    context->parsePresetToken = false;
-
-    int type = 0;
-
-    switch (token->type)
-    {
-      case angle::pp::Token::CONST_INT: {
-        unsigned int val = 0;
-        int testVal = 0;
-        if (!token->uValue(&val) || (!token->iValue(&testVal) &&
-                                     context->errorSettings.integerLiteralsMustFit32BitSignedRange))
-        {
-            context->diagnostics->report(angle::pp::Diagnostics::PP_INTEGER_OVERFLOW,
-                                         token->location, token->text);
-            *(context->valid) = false;
-        }
-        *lvalp = static_cast<YYSTYPE>(val);
-        type = TOK_CONST_INT;
-        break;
-      }
-      case angle::pp::Token::IDENTIFIER:
-        *lvalp = static_cast<YYSTYPE>(-1);
-        type = TOK_IDENTIFIER;
-        break;
-      case angle::pp::Token::OP_OR:
-        type = TOK_OP_OR;
-        break;
-      case angle::pp::Token::OP_AND:
-        type = TOK_OP_AND;
-        break;
-      case angle::pp::Token::OP_NE:
-        type = TOK_OP_NE;
-        break;
-      case angle::pp::Token::OP_EQ:
-        type = TOK_OP_EQ;
-        break;
-      case angle::pp::Token::OP_GE:
-        type = TOK_OP_GE;
-        break;
-      case angle::pp::Token::OP_LE:
-        type = TOK_OP_LE;
-        break;
-      case angle::pp::Token::OP_RIGHT:
-        type = TOK_OP_RIGHT;
-        break;
-      case angle::pp::Token::OP_LEFT:
-        type = TOK_OP_LEFT;
-        break;
-      case '|':
-      case '^':
-      case '&':
-      case '>':
-      case '<':
-      case '-':
-      case '+':
-      case '%':
-      case '/':
-      case '*':
-      case '!':
-      case '~':
-      case '(':
-      case ')':
-        type = token->type;
-        break;
-
-      default:
-        break;
-    }
-
-    return type;
-}
-
-void yyerror(Context *context, const char *reason)
-{
-    context->diagnostics->report(angle::pp::Diagnostics::PP_INVALID_EXPRESSION,
-                                 context->token->location,
-                                 reason);
-}
-
-namespace angle {
-
-namespace pp {
-
-ExpressionParser::ExpressionParser(Lexer *lexer, Diagnostics *diagnostics)
-    : mLexer(lexer),
-      mDiagnostics(diagnostics)
-{
-}
-
-bool ExpressionParser::parse(Token *token,
-                             int *result,
-                             bool parsePresetToken,
-                             const ErrorSettings &errorSettings,
-                             bool *valid)
-{
-    Context context;
-    context.diagnostics = mDiagnostics;
-    context.lexer = mLexer;
-    context.token = token;
-    context.result = result;
-    context.ignoreErrors = 0;
-    context.parsePresetToken = parsePresetToken;
-    context.errorSettings    = errorSettings;
-    context.valid            = valid;
-    int ret = yyparse(&context);
-    switch (ret)
-    {
-      case 0:
-      case 1:
-        break;
-
-      case 2:
-        mDiagnostics->report(Diagnostics::PP_OUT_OF_MEMORY, token->location, "");
-        break;
-
-      default:
-        assert(false);
-        mDiagnostics->report(Diagnostics::PP_INTERNAL_ERROR, token->location, "");
-        break;
-    }
-
-    return ret == 0;
-}
-
-}  // namespace pp
-
-}  // namespace angle
diff --git a/src/third_party/angle/src/compiler/preprocessor/Tokenizer.cpp b/src/third_party/angle/src/compiler/preprocessor/Tokenizer.cpp
deleted file mode 100644
index ce98877..0000000
--- a/src/third_party/angle/src/compiler/preprocessor/Tokenizer.cpp
+++ /dev/null
@@ -1,2619 +0,0 @@
-#line 16 "./Tokenizer.l"
-//
-// Copyright 2011 The ANGLE Project 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 by generate_parser.sh. DO NOT EDIT!
-
-#define YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 4
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#    define FLEX_BETA
-#endif
-
-#ifdef yy_create_buffer
-#    define pp_create_buffer_ALREADY_DEFINED
-#else
-#    define yy_create_buffer pp_create_buffer
-#endif
-
-#ifdef yy_delete_buffer
-#    define pp_delete_buffer_ALREADY_DEFINED
-#else
-#    define yy_delete_buffer pp_delete_buffer
-#endif
-
-#ifdef yy_scan_buffer
-#    define pp_scan_buffer_ALREADY_DEFINED
-#else
-#    define yy_scan_buffer pp_scan_buffer
-#endif
-
-#ifdef yy_scan_string
-#    define pp_scan_string_ALREADY_DEFINED
-#else
-#    define yy_scan_string pp_scan_string
-#endif
-
-#ifdef yy_scan_bytes
-#    define pp_scan_bytes_ALREADY_DEFINED
-#else
-#    define yy_scan_bytes pp_scan_bytes
-#endif
-
-#ifdef yy_init_buffer
-#    define pp_init_buffer_ALREADY_DEFINED
-#else
-#    define yy_init_buffer pp_init_buffer
-#endif
-
-#ifdef yy_flush_buffer
-#    define pp_flush_buffer_ALREADY_DEFINED
-#else
-#    define yy_flush_buffer pp_flush_buffer
-#endif
-
-#ifdef yy_load_buffer_state
-#    define pp_load_buffer_state_ALREADY_DEFINED
-#else
-#    define yy_load_buffer_state pp_load_buffer_state
-#endif
-
-#ifdef yy_switch_to_buffer
-#    define pp_switch_to_buffer_ALREADY_DEFINED
-#else
-#    define yy_switch_to_buffer pp_switch_to_buffer
-#endif
-
-#ifdef yypush_buffer_state
-#    define pppush_buffer_state_ALREADY_DEFINED
-#else
-#    define yypush_buffer_state pppush_buffer_state
-#endif
-
-#ifdef yypop_buffer_state
-#    define pppop_buffer_state_ALREADY_DEFINED
-#else
-#    define yypop_buffer_state pppop_buffer_state
-#endif
-
-#ifdef yyensure_buffer_stack
-#    define ppensure_buffer_stack_ALREADY_DEFINED
-#else
-#    define yyensure_buffer_stack ppensure_buffer_stack
-#endif
-
-#ifdef yylex
-#    define pplex_ALREADY_DEFINED
-#else
-#    define yylex pplex
-#endif
-
-#ifdef yyrestart
-#    define pprestart_ALREADY_DEFINED
-#else
-#    define yyrestart pprestart
-#endif
-
-#ifdef yylex_init
-#    define pplex_init_ALREADY_DEFINED
-#else
-#    define yylex_init pplex_init
-#endif
-
-#ifdef yylex_init_extra
-#    define pplex_init_extra_ALREADY_DEFINED
-#else
-#    define yylex_init_extra pplex_init_extra
-#endif
-
-#ifdef yylex_destroy
-#    define pplex_destroy_ALREADY_DEFINED
-#else
-#    define yylex_destroy pplex_destroy
-#endif
-
-#ifdef yyget_debug
-#    define ppget_debug_ALREADY_DEFINED
-#else
-#    define yyget_debug ppget_debug
-#endif
-
-#ifdef yyset_debug
-#    define ppset_debug_ALREADY_DEFINED
-#else
-#    define yyset_debug ppset_debug
-#endif
-
-#ifdef yyget_extra
-#    define ppget_extra_ALREADY_DEFINED
-#else
-#    define yyget_extra ppget_extra
-#endif
-
-#ifdef yyset_extra
-#    define ppset_extra_ALREADY_DEFINED
-#else
-#    define yyset_extra ppset_extra
-#endif
-
-#ifdef yyget_in
-#    define ppget_in_ALREADY_DEFINED
-#else
-#    define yyget_in ppget_in
-#endif
-
-#ifdef yyset_in
-#    define ppset_in_ALREADY_DEFINED
-#else
-#    define yyset_in ppset_in
-#endif
-
-#ifdef yyget_out
-#    define ppget_out_ALREADY_DEFINED
-#else
-#    define yyget_out ppget_out
-#endif
-
-#ifdef yyset_out
-#    define ppset_out_ALREADY_DEFINED
-#else
-#    define yyset_out ppset_out
-#endif
-
-#ifdef yyget_leng
-#    define ppget_leng_ALREADY_DEFINED
-#else
-#    define yyget_leng ppget_leng
-#endif
-
-#ifdef yyget_text
-#    define ppget_text_ALREADY_DEFINED
-#else
-#    define yyget_text ppget_text
-#endif
-
-#ifdef yyget_lineno
-#    define ppget_lineno_ALREADY_DEFINED
-#else
-#    define yyget_lineno ppget_lineno
-#endif
-
-#ifdef yyset_lineno
-#    define ppset_lineno_ALREADY_DEFINED
-#else
-#    define yyset_lineno ppset_lineno
-#endif
-
-#ifdef yyget_column
-#    define ppget_column_ALREADY_DEFINED
-#else
-#    define yyget_column ppget_column
-#endif
-
-#ifdef yyset_column
-#    define ppset_column_ALREADY_DEFINED
-#else
-#    define yyset_column ppset_column
-#endif
-
-#ifdef yywrap
-#    define ppwrap_ALREADY_DEFINED
-#else
-#    define yywrap ppwrap
-#endif
-
-#ifdef yyget_lval
-#    define ppget_lval_ALREADY_DEFINED
-#else
-#    define yyget_lval ppget_lval
-#endif
-
-#ifdef yyset_lval
-#    define ppset_lval_ALREADY_DEFINED
-#else
-#    define yyset_lval ppset_lval
-#endif
-
-#ifdef yyget_lloc
-#    define ppget_lloc_ALREADY_DEFINED
-#else
-#    define yyget_lloc ppget_lloc
-#endif
-
-#ifdef yyset_lloc
-#    define ppset_lloc_ALREADY_DEFINED
-#else
-#    define yyset_lloc ppset_lloc
-#endif
-
-#ifdef yyalloc
-#    define ppalloc_ALREADY_DEFINED
-#else
-#    define yyalloc ppalloc
-#endif
-
-#ifdef yyrealloc
-#    define pprealloc_ALREADY_DEFINED
-#else
-#    define yyrealloc pprealloc
-#endif
-
-#ifdef yyfree
-#    define ppfree_ALREADY_DEFINED
-#else
-#    define yyfree ppfree
-#endif
-
-/* First, we deal with  platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#    define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#    if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
- */
-#        ifndef __STDC_LIMIT_MACROS
-#            define __STDC_LIMIT_MACROS 1
-#        endif
-
-#        include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-#    else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-
-/* Limits of integral types. */
-#        ifndef INT8_MIN
-#            define INT8_MIN (-128)
-#        endif
-#        ifndef INT16_MIN
-#            define INT16_MIN (-32767 - 1)
-#        endif
-#        ifndef INT32_MIN
-#            define INT32_MIN (-2147483647 - 1)
-#        endif
-#        ifndef INT8_MAX
-#            define INT8_MAX (127)
-#        endif
-#        ifndef INT16_MAX
-#            define INT16_MAX (32767)
-#        endif
-#        ifndef INT32_MAX
-#            define INT32_MAX (2147483647)
-#        endif
-#        ifndef UINT8_MAX
-#            define UINT8_MAX (255U)
-#        endif
-#        ifndef UINT16_MAX
-#            define UINT16_MAX (65535U)
-#        endif
-#        ifndef UINT32_MAX
-#            define UINT32_MAX (4294967295U)
-#        endif
-
-#        ifndef SIZE_MAX
-#            define SIZE_MAX (~(size_t)0)
-#        endif
-
-#    endif /* ! C99 */
-
-#endif /* ! FLEXINT_H */
-
-/* begin standard C++ headers. */
-
-/* TODO: this is always defined, so inline it */
-#define yyconst const
-
-#if defined(__GNUC__) && __GNUC__ >= 3
-#    define yynoreturn __attribute__((__noreturn__))
-#else
-#    define yynoreturn
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an
- *   integer in range [0..255] for use as an array index.
- */
-#define YY_SC_TO_UI(c) ((YY_CHAR)(c))
-
-/* An opaque pointer. */
-#ifndef YY_TYPEDEF_YY_SCANNER_T
-#    define YY_TYPEDEF_YY_SCANNER_T
-typedef void *yyscan_t;
-#endif
-
-/* For convenience, these vars (plus the bison vars far below)
-   are macros in the reentrant scanner. */
-#define yyin yyg->yyin_r
-#define yyout yyg->yyout_r
-#define yyextra yyg->yyextra_r
-#define yyleng yyg->yyleng_r
-#define yytext yyg->yytext_r
-#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
-#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
-#define yy_flex_debug yyg->yy_flex_debug_r
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yyg->yy_start = 1 + 2 *
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yyg->yy_start - 1) / 2)
-#define YYSTATE YY_START
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart(yyin, yyscanner)
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#    ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k.
- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
- * Ditto for the __ia64__ case accordingly.
- */
-#        define YY_BUF_SIZE 32768
-#    else
-#        define YY_BUF_SIZE 16384
-#    endif /* __ia64__ */
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#    define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#    define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-#define YY_LESS_LINENO(n)
-#define YY_LINENO_REWIND_TO(ptr)
-
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n)                                                         \
-    do                                                                    \
-    {                                                                     \
-        /* Undo effects of setting up yytext. */                          \
-        int yyless_macro_arg = (n);                                       \
-        YY_LESS_LINENO(yyless_macro_arg);                                 \
-        *yy_cp = yyg->yy_hold_char;                                       \
-        YY_RESTORE_YY_MORE_OFFSET                                         \
-        yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-        YY_DO_BEFORE_ACTION; /* set up yytext again */                    \
-    } while (0)
-#define unput(c) yyunput(c, yyg->yytext_ptr, yyscanner)
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#    define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
-{
-    FILE *yy_input_file;
-
-    char *yy_ch_buf;  /* input buffer */
-    char *yy_buf_pos; /* current position in input buffer */
-
-    /* Size of input buffer in bytes, not including room for EOB
-     * characters.
-     */
-    int yy_buf_size;
-
-    /* Number of characters read into yy_ch_buf, not including EOB
-     * characters.
-     */
-    int yy_n_chars;
-
-    /* Whether we "own" the buffer - i.e., we know we created it,
-     * and can realloc() it to grow it, and should free() it to
-     * delete it.
-     */
-    int yy_is_our_buffer;
-
-    /* Whether this is an "interactive" input source; if so, and
-     * if we're using stdio for input, then we want to use getc()
-     * instead of fread(), to make sure we stop fetching input after
-     * each newline.
-     */
-    int yy_is_interactive;
-
-    /* Whether we're considered to be at the beginning of a line.
-     * If so, '^' rules will be active on the next match, otherwise
-     * not.
-     */
-    int yy_at_bol;
-
-    int yy_bs_lineno; /**< The line count. */
-    int yy_bs_column; /**< The column count. */
-
-    /* Whether to try to fill the input buffer when we reach the
-     * end of it.
-     */
-    int yy_fill_buffer;
-
-    int yy_buffer_status;
-
-#    define YY_BUFFER_NEW 0
-#    define YY_BUFFER_NORMAL 1
-    /* When an EOF's been seen but there's still some text to process
-     * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-     * shouldn't try reading from the input source any more.  We might
-     * still have a bunch of tokens to match, though, because of
-     * possible backing-up.
-     *
-     * When we actually see the EOF, we change the status to "new"
-     * (via yyrestart()), so that the user can continue scanning by
-     * just pointing yyin at a new input file.
-     */
-#    define YY_BUFFER_EOF_PENDING 2
-};
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER \
-    (yyg->yy_buffer_stack ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] : NULL)
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-
-void yyrestart(FILE *input_file, yyscan_t yyscanner);
-void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner);
-YY_BUFFER_STATE yy_create_buffer(FILE *file, int size, yyscan_t yyscanner);
-void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner);
-void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner);
-void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner);
-void yypop_buffer_state(yyscan_t yyscanner);
-
-static void yyensure_buffer_stack(yyscan_t yyscanner);
-static void yy_load_buffer_state(yyscan_t yyscanner);
-static void yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner);
-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER, yyscanner)
-
-YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner);
-YY_BUFFER_STATE yy_scan_string(const char *yy_str, yyscan_t yyscanner);
-YY_BUFFER_STATE yy_scan_bytes(const char *bytes, int len, yyscan_t yyscanner);
-
-void *yyalloc(yy_size_t, yyscan_t yyscanner);
-void *yyrealloc(void *, yy_size_t, yyscan_t yyscanner);
-void yyfree(void *, yyscan_t yyscanner);
-
-#define yy_new_buffer yy_create_buffer
-#define yy_set_interactive(is_interactive)                                             \
-    {                                                                                  \
-        if (!YY_CURRENT_BUFFER)                                                        \
-        {                                                                              \
-            yyensure_buffer_stack(yyscanner);                                          \
-            YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); \
-        }                                                                              \
-        YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive;                  \
-    }
-#define yy_set_bol(at_bol)                                                             \
-    {                                                                                  \
-        if (!YY_CURRENT_BUFFER)                                                        \
-        {                                                                              \
-            yyensure_buffer_stack(yyscanner);                                          \
-            YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); \
-        }                                                                              \
-        YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol;                                  \
-    }
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-/* Begin user sect3 */
-
-#define ppwrap(yyscanner) (/*CONSTCOND*/ 1)
-#define YY_SKIP_YYWRAP
-typedef flex_uint8_t YY_CHAR;
-
-typedef int yy_state_type;
-
-#define yytext_ptr yytext_r
-
-static yy_state_type yy_get_previous_state(yyscan_t yyscanner);
-static yy_state_type yy_try_NUL_trans(yy_state_type current_state, yyscan_t yyscanner);
-static int yy_get_next_buffer(yyscan_t yyscanner);
-static void yynoreturn yy_fatal_error(const char *msg, yyscan_t yyscanner);
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION                   \
-    yyg->yytext_ptr   = yy_bp;                \
-    yyleng            = (int)(yy_cp - yy_bp); \
-    yyg->yy_hold_char = *yy_cp;               \
-    *yy_cp            = '\0';                 \
-    yyg->yy_c_buf_p   = yy_cp;
-#define YY_NUM_RULES 37
-#define YY_END_OF_BUFFER 38
-/* This struct is not used in this scanner,
-   but its presence is necessary. */
-struct yy_trans_info
-{
-    flex_int32_t yy_verify;
-    flex_int32_t yy_nxt;
-};
-static const flex_int16_t yy_accept[95] = {
-    0,  0,  0,  0,  0,  38, 36, 34, 35, 35, 33, 7,  33, 33, 33, 33, 33, 33, 33, 33, 9, 9,  33, 33,
-    33, 8,  33, 33, 3,  5,  5,  4,  34, 35, 19, 27, 20, 30, 25, 12, 23, 13, 24, 10, 2, 1,  26, 10,
-    9,  11, 11, 11, 9,  11, 9,  9,  14, 16, 18, 17, 15, 8,  31, 21, 32, 22, 3,  5,  6, 11, 10, 11,
-    10, 1,  10, 11, 10, 0,  10, 9,  9,  9,  28, 29, 0,  10, 10, 10, 10, 9,  10, 10, 9, 10, 0
-
-};
-
-static const YY_CHAR yy_ec[256] = {
-    0,  1,  1,  1,  1,  1,  1,  1,  1,  2,  3,  2,  2,  4,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  5,  1,  6,  1,  7,  8,  1,  9,  9,
-    10, 11, 9,  12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 9,  9,  18, 19, 20,
-    9,  1,  21, 21, 21, 21, 22, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-    24, 25, 24, 24, 26, 24, 24, 9,  1,  9,  27, 24, 1,  21, 21, 21, 21,
-
-    22, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 24, 24, 26, 24,
-    24, 9,  28, 9,  9,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1};
-
-static const YY_CHAR yy_meta[29] = {0, 1, 1, 2, 2, 1, 1, 1, 1, 1, 3, 1, 1, 4, 1,
-                                    5, 5, 5, 1, 1, 1, 5, 5, 5, 5, 5, 5, 1, 1};
-
-static const flex_int16_t yy_base[100] = {
-    0,   0,   0,   26,  28,  133, 195, 130, 195, 128, 105, 195, 104, 25,  195, 100, 23,
-    27,  32,  31,  38,  50,  38,  93,  49,  0,   16,  51,  0,   195, 105, 87,  93,  195,
-    195, 195, 195, 195, 195, 195, 195, 195, 195, 67,  195, 0,   195, 81,  55,  84,  98,
-    110, 53,  61,  0,   52,  39,  195, 195, 195, 33,  0,   195, 195, 195, 195, 0,   195,
-    195, 113, 0,   126, 0,   0,   0,   133, 0,   56,  128, 0,   133, 0,   195, 195, 101,
-    141, 143, 145, 0,   15,  154, 195, 0,   195, 195, 177, 32,  182, 187, 189
-
-};
-
-static const flex_int16_t yy_def[100] = {
-    0,  94, 1,  95, 95, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    20, 94, 94, 94, 96, 94, 94, 97, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 98, 94, 94, 20, 20, 49, 50, 50, 99, 21, 50, 94, 94, 94, 94, 94, 96, 94,
-    94, 94, 94, 97, 94, 94, 43, 43, 69, 69, 98, 47, 50, 50, 94, 51, 50, 99, 50, 94, 94,
-    94, 71, 75, 94, 50, 50, 94, 94, 50, 94, 0,  94, 94, 94, 94, 94
-
-};
-
-static const flex_int16_t yy_nxt[224] = {
-    0,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 25,
-    25, 25, 25, 25, 26, 27, 29, 30, 29, 30, 36, 39, 62, 31, 61, 31, 41, 92, 44, 40, 63, 37, 45,
-    42, 43, 43, 43, 46, 47, 83, 48, 48, 49, 56, 57, 82, 50, 51, 50, 50, 52, 53, 54, 54, 54, 59,
-    60, 64, 87, 87, 87, 50, 55, 50, 81, 79, 65, 69, 50, 70, 70, 70, 50, 50, 50, 69, 71, 72, 69,
-    69, 69, 50, 32, 74, 74, 74, 49, 49,
-
-    68, 50, 75, 76, 50, 50, 50, 67, 50, 50, 50, 58, 50, 50, 50, 90, 90, 90, 38, 50, 77, 77, 35,
-    34, 78, 78, 78, 69, 69, 69, 33, 32, 94, 94, 69, 69, 84, 84, 94, 94, 85, 85, 85, 84, 84, 50,
-    94, 86, 86, 86, 88, 94, 94, 94, 94, 94, 50, 89, 50, 87, 87, 87, 94, 72, 94, 76, 94, 91, 90,
-    90, 90, 94, 94, 94, 94, 94, 93, 28, 28, 28, 28, 28, 66, 94, 94, 66, 66, 73, 94, 73, 73, 73,
-    80, 80, 5,  94, 94, 94, 94, 94,
-
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};
-
-static const flex_int16_t yy_chk[224] = {
-    0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  3,  3,  4,  4,  13, 16, 26, 3,  96, 4,  17, 89, 19, 16, 26, 13, 19,
-    17, 18, 18, 18, 19, 20, 60, 20, 20, 20, 22, 22, 56, 20, 20, 20, 20, 20, 20, 21, 21, 21, 24,
-    24, 27, 77, 77, 77, 53, 21, 21, 55, 52, 27, 43, 48, 43, 43, 43, 53, 53, 53, 43, 43, 43, 43,
-    43, 43, 47, 32, 47, 47, 47, 49, 49,
-
-    31, 47, 47, 47, 47, 47, 47, 30, 49, 49, 50, 23, 50, 50, 50, 84, 84, 84, 15, 50, 51, 51, 12,
-    10, 51, 51, 51, 69, 69, 69, 9,  7,  5,  0,  69, 69, 71, 71, 78, 78, 71, 71, 71, 75, 75, 80,
-    0,  75, 75, 75, 78, 85, 85, 86, 86, 0,  80, 80, 80, 87, 87, 87, 0,  85, 0,  86, 0,  87, 90,
-    90, 90, 0,  0,  0,  0,  0,  90, 95, 95, 95, 95, 95, 97, 0,  0,  97, 97, 98, 0,  98, 98, 98,
-    99, 99, 94, 94, 94, 94, 94, 94,
-
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-/*
-//
-// Copyright 2002 The ANGLE Project 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 contains the Lex specification for GLSL ES preprocessor.
-Based on Microsoft Visual Studio 2010 Preprocessor Grammar:
-http://msdn.microsoft.com/en-us/library/2scxys89.aspx
-
-IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
-*/
-
-#if defined(_MSC_VER)
-#    pragma warning(disable : 4005)
-#endif
-
-#include "compiler/preprocessor/Tokenizer.h"
-
-#include "compiler/preprocessor/DiagnosticsBase.h"
-#include "compiler/preprocessor/Token.h"
-
-#if defined(__GNUC__)
-// Triggered by the auto-generated yy_fatal_error function.
-#    pragma GCC diagnostic ignored "-Wmissing-noreturn"
-#elif defined(_MSC_VER)
-#    pragma warning(disable : 4244)
-#endif
-#if defined(__clang__)
-// Flex uses `/*FALLTHROUGH*/` instead of dedicated statements.
-#    pragma clang diagnostic ignored "-Wimplicit-fallthrough"
-#    if defined(__APPLE__)
-// Older clang versions don't have -Wextra-semi-stmt, and detecting Apple clang versions is
-// difficult because they use different yet overlapping version numbers vs. regular clang.
-#        pragma clang diagnostic ignored "-Wunknown-warning-option"
-#    endif
-// Flex isn't semi-colon clean.
-#    pragma clang diagnostic ignored "-Wextra-semi-stmt"
-#    pragma clang diagnostic ignored "-Wunreachable-code"
-#endif
-
-// Workaround for flex using the register keyword, deprecated in C++11.
-#ifdef __cplusplus
-#    if __cplusplus > 199711L
-#        define register
-#    endif
-#endif
-
-typedef std::string YYSTYPE;
-typedef angle::pp::SourceLocation YYLTYPE;
-
-// Use the unused yycolumn variable to track file (string) number.
-#define yyfileno yycolumn
-
-#define YY_USER_INIT                   \
-    do                                 \
-    {                                  \
-        yyfileno              = 0;     \
-        yylineno              = 1;     \
-        yyextra->leadingSpace = false; \
-        yyextra->lineStart    = true;  \
-    } while (0);
-
-#define YY_NO_INPUT
-#define YY_USER_ACTION                                              \
-    do                                                              \
-    {                                                               \
-        angle::pp::Input *input             = &yyextra->input;      \
-        angle::pp::Input::Location *scanLoc = &yyextra->scanLoc;    \
-        while ((scanLoc->sIndex < input->count()) &&                \
-               (scanLoc->cIndex >= input->length(scanLoc->sIndex))) \
-        {                                                           \
-            scanLoc->cIndex -= input->length(scanLoc->sIndex++);    \
-            ++yyfileno;                                             \
-            yylineno = 1;                                           \
-        }                                                           \
-        yylloc->file = yyfileno;                                    \
-        yylloc->line = yylineno;                                    \
-        scanLoc->cIndex += yyleng;                                  \
-    } while (0);
-
-#define YY_INPUT(buf, result, maxSize) result = yyextra->input.read(buf, maxSize, &yylineno);
-
-#define INITIAL 0
-#define COMMENT 1
-
-#define YY_EXTRA_TYPE angle::pp::Tokenizer::Context *
-
-/* Holds the entire state of the reentrant scanner. */
-struct yyguts_t
-{
-
-    /* User-defined. Not touched by flex. */
-    YY_EXTRA_TYPE yyextra_r;
-
-    /* The rest are the same as the globals declared in the non-reentrant scanner. */
-    FILE *yyin_r, *yyout_r;
-    size_t yy_buffer_stack_top;       /**< index of top of stack. */
-    size_t yy_buffer_stack_max;       /**< capacity of stack. */
-    YY_BUFFER_STATE *yy_buffer_stack; /**< Stack as an array. */
-    char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
-    char *yy_c_buf_p;
-    int yy_init;
-    int yy_start;
-    int yy_did_buffer_switch_on_eof;
-    int yy_start_stack_ptr;
-    int yy_start_stack_depth;
-    int *yy_start_stack;
-    yy_state_type yy_last_accepting_state;
-    char *yy_last_accepting_cpos;
-
-    int yylineno_r;
-    int yy_flex_debug_r;
-
-    char *yytext_r;
-    int yy_more_flag;
-    int yy_more_len;
-
-    YYSTYPE *yylval_r;
-
-    YYLTYPE *yylloc_r;
-
-}; /* end struct yyguts_t */
-
-static int yy_init_globals(yyscan_t yyscanner);
-
-/* This must go here because YYSTYPE and YYLTYPE are included
- * from bison output in section 1.*/
-#define yylval yyg->yylval_r
-
-#define yylloc yyg->yylloc_r
-
-int yylex_init(yyscan_t *scanner);
-
-int yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner);
-
-/* Accessor methods to globals.
-   These are made visible to non-reentrant scanners for convenience. */
-
-int yylex_destroy(yyscan_t yyscanner);
-
-int yyget_debug(yyscan_t yyscanner);
-
-void yyset_debug(int debug_flag, yyscan_t yyscanner);
-
-YY_EXTRA_TYPE yyget_extra(yyscan_t yyscanner);
-
-void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner);
-
-FILE *yyget_in(yyscan_t yyscanner);
-
-void yyset_in(FILE *_in_str, yyscan_t yyscanner);
-
-FILE *yyget_out(yyscan_t yyscanner);
-
-void yyset_out(FILE *_out_str, yyscan_t yyscanner);
-
-int yyget_leng(yyscan_t yyscanner);
-
-char *yyget_text(yyscan_t yyscanner);
-
-int yyget_lineno(yyscan_t yyscanner);
-
-void yyset_lineno(int _line_number, yyscan_t yyscanner);
-
-int yyget_column(yyscan_t yyscanner);
-
-void yyset_column(int _column_no, yyscan_t yyscanner);
-
-YYSTYPE *yyget_lval(yyscan_t yyscanner);
-
-void yyset_lval(YYSTYPE *yylval_param, yyscan_t yyscanner);
-
-YYLTYPE *yyget_lloc(yyscan_t yyscanner);
-
-void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner);
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#    ifdef __cplusplus
-extern "C" int yywrap(yyscan_t yyscanner);
-#    else
-extern int yywrap(yyscan_t yyscanner);
-#    endif
-#endif
-
-#ifndef YY_NO_UNPUT
-
-#endif
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy(char *, const char *, int, yyscan_t yyscanner);
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen(const char *, yyscan_t yyscanner);
-#endif
-
-#ifndef YY_NO_INPUT
-#    ifdef __cplusplus
-static int yyinput(yyscan_t yyscanner);
-#    else
-static int input(yyscan_t yyscanner);
-#    endif
-
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#    ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k */
-#        define YY_READ_BUF_SIZE 16384
-#    else
-#        define YY_READ_BUF_SIZE 8192
-#    endif /* __ia64__ */
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#    define ECHO                                          \
-        do                                                \
-        {                                                 \
-            if (fwrite(yytext, (size_t)yyleng, 1, yyout)) \
-            {                                             \
-            }                                             \
-        } while (0)
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#    define YY_INPUT(buf, result, max_size)                                                       \
-        if (YY_CURRENT_BUFFER_LVALUE->yy_is_interactive)                                          \
-        {                                                                                         \
-            int c = '*';                                                                          \
-            int n;                                                                                \
-            for (n = 0; n < max_size && (c = getc(yyin)) != EOF && c != '\n'; ++n)                \
-                buf[n] = (char)c;                                                                 \
-            if (c == '\n')                                                                        \
-                buf[n++] = (char)c;                                                               \
-            if (c == EOF && ferror(yyin))                                                         \
-                YY_FATAL_ERROR("input in flex scanner failed");                                   \
-            result = n;                                                                           \
-        }                                                                                         \
-        else                                                                                      \
-        {                                                                                         \
-            errno = 0;                                                                            \
-            while ((result = (int)fread(buf, 1, (yy_size_t)max_size, yyin)) == 0 && ferror(yyin)) \
-            {                                                                                     \
-                if (errno != EINTR)                                                               \
-                {                                                                                 \
-                    YY_FATAL_ERROR("input in flex scanner failed");                               \
-                    break;                                                                        \
-                }                                                                                 \
-                errno = 0;                                                                        \
-                clearerr(yyin);                                                                   \
-            }                                                                                     \
-        }
-
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#    define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#    define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#    define YY_FATAL_ERROR(msg) yy_fatal_error(msg, yyscanner)
-#endif
-
-/* end tables serialization structures and prototypes */
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#    define YY_DECL_IS_OURS 1
-
-extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner);
-
-#    define YY_DECL int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
-#endif /* !YY_DECL */
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#    define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#    define YY_BREAK /*LINTED*/ break;
-#endif
-
-#define YY_RULE_SETUP YY_USER_ACTION
-
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
-    yy_state_type yy_current_state;
-    char *yy_cp, *yy_bp;
-    int yy_act;
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    yylval = yylval_param;
-
-    yylloc = yylloc_param;
-
-    if (!yyg->yy_init)
-    {
-        yyg->yy_init = 1;
-
-#ifdef YY_USER_INIT
-        YY_USER_INIT;
-#endif
-
-        if (!yyg->yy_start)
-            yyg->yy_start = 1; /* first start state */
-
-        if (!yyin)
-            yyin = stdin;
-
-        if (!yyout)
-            yyout = stdout;
-
-        if (!YY_CURRENT_BUFFER)
-        {
-            yyensure_buffer_stack(yyscanner);
-            YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner);
-        }
-
-        yy_load_buffer_state(yyscanner);
-    }
-
-    {
-
-        /* Line comment */
-
-        while (/*CONSTCOND*/ 1) /* loops until end-of-file is reached */
-        {
-            yy_cp = yyg->yy_c_buf_p;
-
-            /* Support of yytext. */
-            *yy_cp = yyg->yy_hold_char;
-
-            /* yy_bp points to the position in yy_ch_buf of the start of
-             * the current run.
-             */
-            yy_bp = yy_cp;
-
-            yy_current_state = yyg->yy_start;
-        yy_match:
-            do
-            {
-                YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-                if (yy_accept[yy_current_state])
-                {
-                    yyg->yy_last_accepting_state = yy_current_state;
-                    yyg->yy_last_accepting_cpos  = yy_cp;
-                }
-                while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
-                {
-                    yy_current_state = (int)yy_def[yy_current_state];
-                    if (yy_current_state >= 95)
-                        yy_c = yy_meta[yy_c];
-                }
-                yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
-                ++yy_cp;
-            } while (yy_current_state != 94);
-            yy_cp            = yyg->yy_last_accepting_cpos;
-            yy_current_state = yyg->yy_last_accepting_state;
-
-        yy_find_action:
-            yy_act = yy_accept[yy_current_state];
-
-            YY_DO_BEFORE_ACTION;
-
-        do_action: /* This label is used only to access EOF actions. */
-
-            switch (yy_act)
-            {           /* beginning of action switch */
-                case 0: /* must back up */
-                    /* undo the effects of YY_DO_BEFORE_ACTION */
-                    *yy_cp           = yyg->yy_hold_char;
-                    yy_cp            = yyg->yy_last_accepting_cpos;
-                    yy_current_state = yyg->yy_last_accepting_state;
-                    goto yy_find_action;
-
-                case 1:
-                    YY_RULE_SETUP
-
-                    YY_BREAK
-                /* Block comment */
-                /* Line breaks are just counted - not returned. */
-                /* The comment is replaced by a single space. */
-                case 2:
-                    YY_RULE_SETUP { BEGIN(COMMENT); }
-                    YY_BREAK
-                case 3:
-                    YY_RULE_SETUP
-
-                    YY_BREAK
-                case 4:
-                    YY_RULE_SETUP
-
-                    YY_BREAK
-                case 5:
-                    /* rule 5 can match eol */
-                    YY_RULE_SETUP
-                    {
-                        if (yylineno == INT_MAX)
-                        {
-                            *yylval = "Integer overflow on line number";
-                            return angle::pp::Token::GOT_ERROR;
-                        }
-                        ++yylineno;
-                    }
-                    YY_BREAK
-                case 6:
-                    YY_RULE_SETUP
-                    {
-                        yyextra->leadingSpace = true;
-                        BEGIN(INITIAL);
-                    }
-                    YY_BREAK
-                case 7:
-                    YY_RULE_SETUP
-                    {
-                        // # is only valid at start of line for preprocessor directives.
-                        yylval->assign(1, yytext[0]);
-                        return yyextra->lineStart ? angle::pp::Token::PP_HASH
-                                                  : angle::pp::Token::PP_OTHER;
-                    }
-                    YY_BREAK
-                case 8:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::IDENTIFIER;
-                    }
-                    YY_BREAK
-                case 9:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::CONST_INT;
-                    }
-                    YY_BREAK
-                case 10:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::CONST_FLOAT;
-                    }
-                    YY_BREAK
-                /* Anything that starts with a {DIGIT} or .{DIGIT} must be a number. */
-                /* Rule to catch all invalid integers and floats. */
-                case 11:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::PP_NUMBER;
-                    }
-                    YY_BREAK
-                case 12:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_INC;
-                    }
-                    YY_BREAK
-                case 13:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_DEC;
-                    }
-                    YY_BREAK
-                case 14:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_LEFT;
-                    }
-                    YY_BREAK
-                case 15:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_RIGHT;
-                    }
-                    YY_BREAK
-                case 16:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_LE;
-                    }
-                    YY_BREAK
-                case 17:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_GE;
-                    }
-                    YY_BREAK
-                case 18:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_EQ;
-                    }
-                    YY_BREAK
-                case 19:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_NE;
-                    }
-                    YY_BREAK
-                case 20:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_AND;
-                    }
-                    YY_BREAK
-                case 21:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_XOR;
-                    }
-                    YY_BREAK
-                case 22:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_OR;
-                    }
-                    YY_BREAK
-                case 23:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_ADD_ASSIGN;
-                    }
-                    YY_BREAK
-                case 24:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_SUB_ASSIGN;
-                    }
-                    YY_BREAK
-                case 25:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_MUL_ASSIGN;
-                    }
-                    YY_BREAK
-                case 26:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_DIV_ASSIGN;
-                    }
-                    YY_BREAK
-                case 27:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_MOD_ASSIGN;
-                    }
-                    YY_BREAK
-                case 28:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_LEFT_ASSIGN;
-                    }
-                    YY_BREAK
-                case 29:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_RIGHT_ASSIGN;
-                    }
-                    YY_BREAK
-                case 30:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_AND_ASSIGN;
-                    }
-                    YY_BREAK
-                case 31:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_XOR_ASSIGN;
-                    }
-                    YY_BREAK
-                case 32:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_OR_ASSIGN;
-                    }
-                    YY_BREAK
-                case 33:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(1, yytext[0]);
-                        return yytext[0];
-                    }
-                    YY_BREAK
-                case 34:
-                    YY_RULE_SETUP { yyextra->leadingSpace = true; }
-                    YY_BREAK
-                case 35:
-                    /* rule 35 can match eol */
-                    YY_RULE_SETUP
-                    {
-                        if (yylineno == INT_MAX)
-                        {
-                            *yylval = "Integer overflow on line number";
-                            return angle::pp::Token::GOT_ERROR;
-                        }
-                        ++yylineno;
-                        yylval->assign(1, '\n');
-                        return '\n';
-                    }
-                    YY_BREAK
-                case 36:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(1, yytext[0]);
-                        return angle::pp::Token::PP_OTHER;
-                    }
-                    YY_BREAK
-                case YY_STATE_EOF(INITIAL):
-                case YY_STATE_EOF(COMMENT):
-                {
-                    // YY_USER_ACTION is not invoked for handling EOF.
-                    // Set the location for EOF token manually.
-                    angle::pp::Input *input             = &yyextra->input;
-                    angle::pp::Input::Location *scanLoc = &yyextra->scanLoc;
-                    yy_size_t sIndexMax                 = input->count() ? input->count() - 1 : 0;
-                    if (scanLoc->sIndex != sIndexMax)
-                    {
-                        // We can only reach here if there are empty strings at the
-                        // end of the input.
-                        scanLoc->sIndex = sIndexMax;
-                        scanLoc->cIndex = 0;
-                        // FIXME: this is not 64-bit clean.
-                        yyfileno = static_cast<int>(sIndexMax);
-                        yylineno = 1;
-                    }
-                    yylloc->file = yyfileno;
-                    yylloc->line = yylineno;
-                    yylval->clear();
-
-                    // Line number overflows fake EOFs to exit early, check for this case.
-                    if (yylineno == INT_MAX)
-                    {
-                        yyextra->diagnostics->report(angle::pp::Diagnostics::PP_TOKENIZER_ERROR,
-                                                     angle::pp::SourceLocation(yyfileno, yylineno),
-                                                     "Integer overflow on line number");
-                    }
-                    else if (YY_START == COMMENT)
-                    {
-                        yyextra->diagnostics->report(angle::pp::Diagnostics::PP_EOF_IN_COMMENT,
-                                                     angle::pp::SourceLocation(yyfileno, yylineno),
-                                                     "EOF while in a comment");
-                    }
-                    yyterminate();
-                }
-                    YY_BREAK
-                case 37:
-                    YY_RULE_SETUP
-                    ECHO;
-                    YY_BREAK
-
-                case YY_END_OF_BUFFER:
-                {
-                    /* Amount of text matched not including the EOB char. */
-                    int yy_amount_of_matched_text = (int)(yy_cp - yyg->yytext_ptr) - 1;
-
-                    /* Undo the effects of YY_DO_BEFORE_ACTION. */
-                    *yy_cp = yyg->yy_hold_char;
-                    YY_RESTORE_YY_MORE_OFFSET
-
-                    if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW)
-                    {
-                        /* We're scanning a new file or input source.  It's
-                         * possible that this happened because the user
-                         * just pointed yyin at a new source and called
-                         * yylex().  If so, then we have to assure
-                         * consistency between YY_CURRENT_BUFFER and our
-                         * globals.  Here is the right place to do so, because
-                         * this is the first action (other than possibly a
-                         * back-up) that will match for the new input source.
-                         */
-                        yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-                        YY_CURRENT_BUFFER_LVALUE->yy_input_file    = yyin;
-                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-                    }
-
-                    /* Note that here we test for yy_c_buf_p "<=" to the position
-                     * of the first EOB in the buffer, since yy_c_buf_p will
-                     * already have been incremented past the NUL character
-                     * (since all states make transitions on EOB to the
-                     * end-of-buffer state).  Contrast this with the test
-                     * in input().
-                     */
-                    if (yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars])
-                    { /* This was really a NUL. */
-                        yy_state_type yy_next_state;
-
-                        yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
-
-                        yy_current_state = yy_get_previous_state(yyscanner);
-
-                        /* Okay, we're now positioned to make the NUL
-                         * transition.  We couldn't have
-                         * yy_get_previous_state() go ahead and do it
-                         * for us because it doesn't know how to deal
-                         * with the possibility of jamming (and we don't
-                         * want to build jamming into it because then it
-                         * will run more slowly).
-                         */
-
-                        yy_next_state = yy_try_NUL_trans(yy_current_state, yyscanner);
-
-                        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-
-                        if (yy_next_state)
-                        {
-                            /* Consume the NUL. */
-                            yy_cp            = ++yyg->yy_c_buf_p;
-                            yy_current_state = yy_next_state;
-                            goto yy_match;
-                        }
-
-                        else
-                        {
-                            yy_cp            = yyg->yy_last_accepting_cpos;
-                            yy_current_state = yyg->yy_last_accepting_state;
-                            goto yy_find_action;
-                        }
-                    }
-
-                    else
-                        switch (yy_get_next_buffer(yyscanner))
-                        {
-                            case EOB_ACT_END_OF_FILE:
-                            {
-                                yyg->yy_did_buffer_switch_on_eof = 0;
-
-                                if (yywrap(yyscanner))
-                                {
-                                    /* Note: because we've taken care in
-                                     * yy_get_next_buffer() to have set up
-                                     * yytext, we can now set up
-                                     * yy_c_buf_p so that if some total
-                                     * hoser (like flex itself) wants to
-                                     * call the scanner after we return the
-                                     * YY_NULL, it'll still work - another
-                                     * YY_NULL will get returned.
-                                     */
-                                    yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
-
-                                    yy_act = YY_STATE_EOF(YY_START);
-                                    goto do_action;
-                                }
-
-                                else
-                                {
-                                    if (!yyg->yy_did_buffer_switch_on_eof)
-                                        YY_NEW_FILE;
-                                }
-                                break;
-                            }
-
-                            case EOB_ACT_CONTINUE_SCAN:
-                                yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
-
-                                yy_current_state = yy_get_previous_state(yyscanner);
-
-                                yy_cp = yyg->yy_c_buf_p;
-                                yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-                                goto yy_match;
-
-                            case EOB_ACT_LAST_MATCH:
-                                yyg->yy_c_buf_p =
-                                    &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
-
-                                yy_current_state = yy_get_previous_state(yyscanner);
-
-                                yy_cp = yyg->yy_c_buf_p;
-                                yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-                                goto yy_find_action;
-                        }
-                    break;
-                }
-
-                default:
-                    YY_FATAL_ERROR("fatal flex scanner internal error--no action found");
-            } /* end of action switch */
-        }     /* end of scanning one token */
-    }         /* end of user's declarations */
-} /* end of yylex */
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *	EOB_ACT_LAST_MATCH -
- *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *	EOB_ACT_END_OF_FILE - end of file
- */
-static int yy_get_next_buffer(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    char *dest           = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-    char *source         = yyg->yytext_ptr;
-    int number_to_move, i;
-    int ret_val;
-
-    if (yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1])
-        YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed");
-
-    if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0)
-    { /* Don't try to fill the buffer, so this is an EOF. */
-        if (yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1)
-        {
-            /* We matched a single character, the EOB, so
-             * treat this as a final EOF.
-             */
-            return EOB_ACT_END_OF_FILE;
-        }
-
-        else
-        {
-            /* We matched some text prior to the EOB, first
-             * process it.
-             */
-            return EOB_ACT_LAST_MATCH;
-        }
-    }
-
-    /* Try to read more data. */
-
-    /* First move last chars to start of buffer. */
-    number_to_move = (int)(yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
-
-    for (i = 0; i < number_to_move; ++i)
-        *(dest++) = *(source++);
-
-    if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING)
-        /* don't do the read, it's not guaranteed to return an EOF,
-         * just force an EOF
-         */
-        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
-
-    else
-    {
-        int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-        while (num_to_read <= 0)
-        { /* Not enough room in the buffer - grow it. */
-
-            /* just a shorter name for the current buffer */
-            YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
-
-            int yy_c_buf_p_offset = (int)(yyg->yy_c_buf_p - b->yy_ch_buf);
-
-            if (b->yy_is_our_buffer)
-            {
-                int new_size = b->yy_buf_size * 2;
-
-                if (new_size <= 0)
-                    b->yy_buf_size += b->yy_buf_size / 8;
-                else
-                    b->yy_buf_size *= 2;
-
-                b->yy_ch_buf = (char *)
-                    /* Include room in for 2 EOB chars. */
-                    yyrealloc((void *)b->yy_ch_buf, (yy_size_t)(b->yy_buf_size + 2), yyscanner);
-            }
-            else
-                /* Can't grow it, we don't own it. */
-                b->yy_ch_buf = NULL;
-
-            if (!b->yy_ch_buf)
-                YY_FATAL_ERROR("fatal error - scanner input buffer overflow");
-
-            yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-            num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-        }
-
-        if (num_to_read > YY_READ_BUF_SIZE)
-            num_to_read = YY_READ_BUF_SIZE;
-
-        /* Read in more data. */
-        yy_size_t ret = 0;
-        YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), ret, num_to_read);
-        yyg->yy_n_chars = static_cast<int>(ret);
-
-        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-    }
-
-    if (yyg->yy_n_chars == 0)
-    {
-        if (number_to_move == YY_MORE_ADJ)
-        {
-            ret_val = EOB_ACT_END_OF_FILE;
-            yyrestart(yyin, yyscanner);
-        }
-
-        else
-        {
-            ret_val                                    = EOB_ACT_LAST_MATCH;
-            YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING;
-        }
-    }
-
-    else
-        ret_val = EOB_ACT_CONTINUE_SCAN;
-
-    if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size)
-    {
-        /* Extend the array by 50%, plus the number we really need. */
-        int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
-        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *)yyrealloc(
-            (void *)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t)new_size, yyscanner);
-        if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
-            YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()");
-        /* "- 2" to take care of EOB's */
-        YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int)(new_size - 2);
-    }
-
-    yyg->yy_n_chars += number_to_move;
-    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]     = YY_END_OF_BUFFER_CHAR;
-    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
-    yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
-    return ret_val;
-}
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-static yy_state_type yy_get_previous_state(yyscan_t yyscanner)
-{
-    yy_state_type yy_current_state;
-    char *yy_cp;
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    yy_current_state = yyg->yy_start;
-
-    for (yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp)
-    {
-        YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-        if (yy_accept[yy_current_state])
-        {
-            yyg->yy_last_accepting_state = yy_current_state;
-            yyg->yy_last_accepting_cpos  = yy_cp;
-        }
-        while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
-        {
-            yy_current_state = (int)yy_def[yy_current_state];
-            if (yy_current_state >= 95)
-                yy_c = yy_meta[yy_c];
-        }
-        yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
-    }
-
-    return yy_current_state;
-}
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *	next_state = yy_try_NUL_trans( current_state );
- */
-static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state, yyscan_t yyscanner)
-{
-    int yy_is_jam;
-    struct yyguts_t *yyg =
-        (struct yyguts_t *)yyscanner; /* This var may be unused depending upon options. */
-    char *yy_cp = yyg->yy_c_buf_p;
-
-    YY_CHAR yy_c = 1;
-    if (yy_accept[yy_current_state])
-    {
-        yyg->yy_last_accepting_state = yy_current_state;
-        yyg->yy_last_accepting_cpos  = yy_cp;
-    }
-    while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
-    {
-        yy_current_state = (int)yy_def[yy_current_state];
-        if (yy_current_state >= 95)
-            yy_c = yy_meta[yy_c];
-    }
-    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
-    yy_is_jam        = (yy_current_state == 94);
-
-    (void)yyg;
-    return yy_is_jam ? 0 : yy_current_state;
-}
-
-#ifndef YY_NO_UNPUT
-
-#endif
-
-#ifndef YY_NO_INPUT
-#    ifdef __cplusplus
-static int yyinput(yyscan_t yyscanner)
-#    else
-static int input(yyscan_t yyscanner)
-#    endif
-
-{
-    int c;
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    *yyg->yy_c_buf_p = yyg->yy_hold_char;
-
-    if (*yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR)
-    {
-        /* yy_c_buf_p now points to the character we want to return.
-         * If this occurs *before* the EOB characters, then it's a
-         * valid NUL; if not, then we've hit the end of the buffer.
-         */
-        if (yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars])
-            /* This was really a NUL. */
-            *yyg->yy_c_buf_p = '\0';
-
-        else
-        { /* need more input */
-            int offset = (int)(yyg->yy_c_buf_p - yyg->yytext_ptr);
-            ++yyg->yy_c_buf_p;
-
-            switch (yy_get_next_buffer(yyscanner))
-            {
-                case EOB_ACT_LAST_MATCH:
-                    /* This happens because yy_g_n_b()
-                     * sees that we've accumulated a
-                     * token and flags that we need to
-                     * try matching the token before
-                     * proceeding.  But for input(),
-                     * there's no matching to consider.
-                     * So convert the EOB_ACT_LAST_MATCH
-                     * to EOB_ACT_END_OF_FILE.
-                     */
-
-                    /* Reset buffer status. */
-                    yyrestart(yyin, yyscanner);
-
-                    /*FALLTHROUGH*/
-
-                case EOB_ACT_END_OF_FILE:
-                {
-                    if (yywrap(yyscanner))
-                        return 0;
-
-                    if (!yyg->yy_did_buffer_switch_on_eof)
-                        YY_NEW_FILE;
-#    ifdef __cplusplus
-                    return yyinput(yyscanner);
-#    else
-                    return input(yyscanner);
-#    endif
-                }
-
-                case EOB_ACT_CONTINUE_SCAN:
-                    yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
-                    break;
-            }
-        }
-    }
-
-    c                 = *(unsigned char *)yyg->yy_c_buf_p; /* cast for 8-bit char's */
-    *yyg->yy_c_buf_p  = '\0';                              /* preserve yytext */
-    yyg->yy_hold_char = *++yyg->yy_c_buf_p;
-
-    return c;
-}
-#endif /* ifndef YY_NO_INPUT */
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- * @param yyscanner The scanner object.
- * @note This function does not reset the start condition to @c INITIAL .
- */
-void yyrestart(FILE *input_file, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    if (!YY_CURRENT_BUFFER)
-    {
-        yyensure_buffer_stack(yyscanner);
-        YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner);
-    }
-
-    yy_init_buffer(YY_CURRENT_BUFFER, input_file, yyscanner);
-    yy_load_buffer_state(yyscanner);
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- * @param yyscanner The scanner object.
- */
-void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    /* TODO. We should be able to replace this entire function body
-     * with
-     *		yypop_buffer_state();
-     *		yypush_buffer_state(new_buffer);
-     */
-    yyensure_buffer_stack(yyscanner);
-    if (YY_CURRENT_BUFFER == new_buffer)
-        return;
-
-    if (YY_CURRENT_BUFFER)
-    {
-        /* Flush out information for old buffer. */
-        *yyg->yy_c_buf_p                     = yyg->yy_hold_char;
-        YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
-        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-    }
-
-    YY_CURRENT_BUFFER_LVALUE = new_buffer;
-    yy_load_buffer_state(yyscanner);
-
-    /* We don't actually know whether we did this switch during
-     * EOF (yywrap()) processing, but the only time this flag
-     * is looked at is after yywrap() is called, so it's safe
-     * to go ahead and always set it.
-     */
-    yyg->yy_did_buffer_switch_on_eof = 1;
-}
-
-static void yy_load_buffer_state(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yyg->yy_n_chars      = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-    yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-    yyin                              = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-    yyg->yy_hold_char                 = *yyg->yy_c_buf_p;
-}
-
-/** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * @param yyscanner The scanner object.
- * @return the allocated buffer state.
- */
-YY_BUFFER_STATE yy_create_buffer(FILE *file, int size, yyscan_t yyscanner)
-{
-    YY_BUFFER_STATE b;
-
-    b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state), yyscanner);
-    if (!b)
-        YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
-
-    b->yy_buf_size = size;
-
-    /* yy_ch_buf has to be 2 characters longer than the size given because
-     * we need to put in 2 end-of-buffer characters.
-     */
-    b->yy_ch_buf = (char *)yyalloc((yy_size_t)(b->yy_buf_size + 2), yyscanner);
-    if (!b->yy_ch_buf)
-        YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
-
-    b->yy_is_our_buffer = 1;
-
-    yy_init_buffer(b, file, yyscanner);
-
-    return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with yy_create_buffer()
- * @param yyscanner The scanner object.
- */
-void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    if (!b)
-        return;
-
-    if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */
-        YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE)0;
-
-    if (b->yy_is_our_buffer)
-        yyfree((void *)b->yy_ch_buf, yyscanner);
-
-    yyfree((void *)b, yyscanner);
-}
-
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a yyrestart() or at EOF.
- */
-static void yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
-
-{
-    int oerrno           = errno;
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    yy_flush_buffer(b, yyscanner);
-
-    b->yy_input_file  = file;
-    b->yy_fill_buffer = 1;
-
-    /* If b is the current buffer, then yy_init_buffer was _probably_
-     * called from yyrestart() or through yy_get_next_buffer.
-     * In that case, we don't want to reset the lineno or column.
-     */
-    if (b != YY_CURRENT_BUFFER)
-    {
-        b->yy_bs_lineno = 1;
-        b->yy_bs_column = 0;
-    }
-
-    b->yy_is_interactive = 0;
-
-    errno = oerrno;
-}
-
-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * @param yyscanner The scanner object.
- */
-void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    if (!b)
-        return;
-
-    b->yy_n_chars = 0;
-
-    /* We always need two end-of-buffer characters.  The first causes
-     * a transition to the end-of-buffer state.  The second causes
-     * a jam in that state.
-     */
-    b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-    b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-    b->yy_buf_pos = &b->yy_ch_buf[0];
-
-    b->yy_at_bol        = 1;
-    b->yy_buffer_status = YY_BUFFER_NEW;
-
-    if (b == YY_CURRENT_BUFFER)
-        yy_load_buffer_state(yyscanner);
-}
-
-/** Pushes the new state onto the stack. The new state becomes
- *  the current state. This function will allocate the stack
- *  if necessary.
- *  @param new_buffer The new state.
- *  @param yyscanner The scanner object.
- */
-void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    if (new_buffer == NULL)
-        return;
-
-    yyensure_buffer_stack(yyscanner);
-
-    /* This block is copied from yy_switch_to_buffer. */
-    if (YY_CURRENT_BUFFER)
-    {
-        /* Flush out information for old buffer. */
-        *yyg->yy_c_buf_p                     = yyg->yy_hold_char;
-        YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
-        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-    }
-
-    /* Only push if top exists. Otherwise, replace top. */
-    if (YY_CURRENT_BUFFER)
-        yyg->yy_buffer_stack_top++;
-    YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-    /* copied from yy_switch_to_buffer. */
-    yy_load_buffer_state(yyscanner);
-    yyg->yy_did_buffer_switch_on_eof = 1;
-}
-
-/** Removes and deletes the top of the stack, if present.
- *  The next element becomes the new top.
- *  @param yyscanner The scanner object.
- */
-void yypop_buffer_state(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    if (!YY_CURRENT_BUFFER)
-        return;
-
-    yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
-    YY_CURRENT_BUFFER_LVALUE = NULL;
-    if (yyg->yy_buffer_stack_top > 0)
-        --yyg->yy_buffer_stack_top;
-
-    if (YY_CURRENT_BUFFER)
-    {
-        yy_load_buffer_state(yyscanner);
-        yyg->yy_did_buffer_switch_on_eof = 1;
-    }
-}
-
-/* Allocates the stack if it does not exist.
- *  Guarantees space for at least one push.
- */
-static void yyensure_buffer_stack(yyscan_t yyscanner)
-{
-    yy_size_t num_to_alloc;
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    if (!yyg->yy_buffer_stack)
-    {
-
-        /* First allocation is just for 2 elements, since we don't know if this
-         * scanner will even need a stack. We use 2 instead of 1 to avoid an
-         * immediate realloc on the next call.
-         */
-        num_to_alloc         = 1; /* After all that talk, this was set to 1 anyways... */
-        yyg->yy_buffer_stack = (struct yy_buffer_state **)yyalloc(
-            num_to_alloc * sizeof(struct yy_buffer_state *), yyscanner);
-        if (!yyg->yy_buffer_stack)
-            YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
-
-        memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state *));
-
-        yyg->yy_buffer_stack_max = num_to_alloc;
-        yyg->yy_buffer_stack_top = 0;
-        return;
-    }
-
-    if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1)
-    {
-
-        /* Increase the buffer to prepare for a possible push. */
-        yy_size_t grow_size = 8 /* arbitrary grow size */;
-
-        num_to_alloc         = yyg->yy_buffer_stack_max + grow_size;
-        yyg->yy_buffer_stack = (struct yy_buffer_state **)yyrealloc(
-            yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state *), yyscanner);
-        if (!yyg->yy_buffer_stack)
-            YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
-
-        /* zero only the new slots.*/
-        memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0,
-               grow_size * sizeof(struct yy_buffer_state *));
-        yyg->yy_buffer_stack_max = num_to_alloc;
-    }
-}
-
-/** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner)
-{
-    YY_BUFFER_STATE b;
-
-    if (size < 2 || base[size - 2] != YY_END_OF_BUFFER_CHAR ||
-        base[size - 1] != YY_END_OF_BUFFER_CHAR)
-        /* They forgot to leave room for the EOB's. */
-        return NULL;
-
-    b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state), yyscanner);
-    if (!b)
-        YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()");
-
-    b->yy_buf_size = (int)(size - 2); /* "- 2" to take care of EOB's */
-    b->yy_buf_pos = b->yy_ch_buf = base;
-    b->yy_is_our_buffer          = 0;
-    b->yy_input_file             = NULL;
-    b->yy_n_chars                = b->yy_buf_size;
-    b->yy_is_interactive         = 0;
-    b->yy_at_bol                 = 1;
-    b->yy_fill_buffer            = 0;
-    b->yy_buffer_status          = YY_BUFFER_NEW;
-
-    yy_switch_to_buffer(b, yyscanner);
-
-    return b;
-}
-
-/** Setup the input buffer state to scan a string. The next call to yylex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- *       yy_scan_bytes() instead.
- */
-YY_BUFFER_STATE yy_scan_string(const char *yystr, yyscan_t yyscanner)
-{
-
-    return yy_scan_bytes(yystr, (int)strlen(yystr), yyscanner);
-}
-
-/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
- * scan from a @e copy of @a bytes.
- * @param yybytes the byte buffer to scan
- * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_bytes(const char *yybytes, int _yybytes_len, yyscan_t yyscanner)
-{
-    YY_BUFFER_STATE b;
-    char *buf;
-    yy_size_t n;
-    int i;
-
-    /* Get memory for full buffer, including space for trailing EOB's. */
-    n   = (yy_size_t)(_yybytes_len + 2);
-    buf = (char *)yyalloc(n, yyscanner);
-    if (!buf)
-        YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()");
-
-    for (i = 0; i < _yybytes_len; ++i)
-        buf[i] = yybytes[i];
-
-    buf[_yybytes_len] = buf[_yybytes_len + 1] = YY_END_OF_BUFFER_CHAR;
-
-    b = yy_scan_buffer(buf, n, yyscanner);
-    if (!b)
-        YY_FATAL_ERROR("bad buffer in yy_scan_bytes()");
-
-    /* It's okay to grow etc. this buffer, and we should throw it
-     * away when we're done.
-     */
-    b->yy_is_our_buffer = 1;
-
-    return b;
-}
-
-#ifndef YY_EXIT_FAILURE
-#    define YY_EXIT_FAILURE 2
-#endif
-
-static void yynoreturn yy_fatal_error(const char *msg, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    (void)yyg;
-    fprintf(stderr, "%s\n", msg);
-    exit(YY_EXIT_FAILURE);
-}
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n)                                      \
-    do                                                 \
-    {                                                  \
-        /* Undo effects of setting up yytext. */       \
-        int yyless_macro_arg = (n);                    \
-        YY_LESS_LINENO(yyless_macro_arg);              \
-        yytext[yyleng]    = yyg->yy_hold_char;         \
-        yyg->yy_c_buf_p   = yytext + yyless_macro_arg; \
-        yyg->yy_hold_char = *yyg->yy_c_buf_p;          \
-        *yyg->yy_c_buf_p  = '\0';                      \
-        yyleng            = yyless_macro_arg;          \
-    } while (0)
-
-/* Accessor  methods (get/set functions) to struct members. */
-
-/** Get the user-defined data for this scanner.
- * @param yyscanner The scanner object.
- */
-YY_EXTRA_TYPE yyget_extra(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yyextra;
-}
-
-/** Get the current line number.
- * @param yyscanner The scanner object.
- */
-int yyget_lineno(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    if (!YY_CURRENT_BUFFER)
-        return 0;
-
-    return yylineno;
-}
-
-/** Get the current column number.
- * @param yyscanner The scanner object.
- */
-int yyget_column(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    if (!YY_CURRENT_BUFFER)
-        return 0;
-
-    return yycolumn;
-}
-
-/** Get the input stream.
- * @param yyscanner The scanner object.
- */
-FILE *yyget_in(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yyin;
-}
-
-/** Get the output stream.
- * @param yyscanner The scanner object.
- */
-FILE *yyget_out(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yyout;
-}
-
-/** Get the length of the current token.
- * @param yyscanner The scanner object.
- */
-int yyget_leng(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yyleng;
-}
-
-/** Get the current token.
- * @param yyscanner The scanner object.
- */
-
-char *yyget_text(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yytext;
-}
-
-/** Set the user-defined data. This data is never touched by the scanner.
- * @param user_defined The data to be associated with this scanner.
- * @param yyscanner The scanner object.
- */
-void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yyextra              = user_defined;
-}
-
-/** Set the current line number.
- * @param _line_number line number
- * @param yyscanner The scanner object.
- */
-void yyset_lineno(int _line_number, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    /* lineno is only valid if an input buffer exists. */
-    if (!YY_CURRENT_BUFFER)
-        YY_FATAL_ERROR("yyset_lineno called with no buffer");
-
-    yylineno = _line_number;
-}
-
-/** Set the current column.
- * @param _column_no column number
- * @param yyscanner The scanner object.
- */
-void yyset_column(int _column_no, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    /* column is only valid if an input buffer exists. */
-    if (!YY_CURRENT_BUFFER)
-        YY_FATAL_ERROR("yyset_column called with no buffer");
-
-    yycolumn = _column_no;
-}
-
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param _in_str A readable stream.
- * @param yyscanner The scanner object.
- * @see yy_switch_to_buffer
- */
-void yyset_in(FILE *_in_str, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yyin                 = _in_str;
-}
-
-void yyset_out(FILE *_out_str, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yyout                = _out_str;
-}
-
-int yyget_debug(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yy_flex_debug;
-}
-
-void yyset_debug(int _bdebug, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yy_flex_debug        = _bdebug;
-}
-
-/* Accessor methods for yylval and yylloc */
-
-YYSTYPE *yyget_lval(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yylval;
-}
-
-void yyset_lval(YYSTYPE *yylval_param, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yylval               = yylval_param;
-}
-
-YYLTYPE *yyget_lloc(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yylloc;
-}
-
-void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yylloc               = yylloc_param;
-}
-
-/* User-visible API */
-
-/* yylex_init is special because it creates the scanner itself, so it is
- * the ONLY reentrant function that doesn't take the scanner as the last argument.
- * That's why we explicitly handle the declaration, instead of using our macros.
- */
-int yylex_init(yyscan_t *ptr_yy_globals)
-{
-    if (ptr_yy_globals == NULL)
-    {
-        errno = EINVAL;
-        return 1;
-    }
-
-    *ptr_yy_globals = (yyscan_t)yyalloc(sizeof(struct yyguts_t), NULL);
-
-    if (*ptr_yy_globals == NULL)
-    {
-        errno = ENOMEM;
-        return 1;
-    }
-
-    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
-    memset(*ptr_yy_globals, 0x00, sizeof(struct yyguts_t));
-
-    return yy_init_globals(*ptr_yy_globals);
-}
-
-/* yylex_init_extra has the same functionality as yylex_init, but follows the
- * convention of taking the scanner as the last argument. Note however, that
- * this is a *pointer* to a scanner, as it will be allocated by this call (and
- * is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to yyalloc in
- * the yyextra field.
- */
-int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined, yyscan_t *ptr_yy_globals)
-{
-    struct yyguts_t dummy_yyguts;
-
-    yyset_extra(yy_user_defined, &dummy_yyguts);
-
-    if (ptr_yy_globals == NULL)
-    {
-        errno = EINVAL;
-        return 1;
-    }
-
-    *ptr_yy_globals = (yyscan_t)yyalloc(sizeof(struct yyguts_t), &dummy_yyguts);
-
-    if (*ptr_yy_globals == NULL)
-    {
-        errno = ENOMEM;
-        return 1;
-    }
-
-    /* By setting to 0xAA, we expose bugs in
-    yy_init_globals. Leave at 0x00 for releases. */
-    memset(*ptr_yy_globals, 0x00, sizeof(struct yyguts_t));
-
-    yyset_extra(yy_user_defined, *ptr_yy_globals);
-
-    return yy_init_globals(*ptr_yy_globals);
-}
-
-static int yy_init_globals(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    /* Initialization is the same as for the non-reentrant scanner.
-     * This function is called from yylex_destroy(), so don't allocate here.
-     */
-
-    yyg->yy_buffer_stack     = NULL;
-    yyg->yy_buffer_stack_top = 0;