Import Cobalt 25.master.0.1032706
diff --git a/.github/actions/build/action.yaml b/.github/actions/build/action.yaml
index f641013..28616c4 100644
--- a/.github/actions/build/action.yaml
+++ b/.github/actions/build/action.yaml
@@ -25,7 +25,7 @@
           fi
         else
           BUILD_PLATFORM=${COBALT_BOOTLOADER}
-          BUILD_TARGET='loader_app_install elf_loader_sandbox_install crashpad_handler_install'
+          BUILD_TARGET='loader_app_install elf_loader_sandbox_install native_target/crashpad_handler'
         fi
         # GitHub Runners have home set to /github/home.
         if [ -d /root/starboard-toolchains ]; then
diff --git a/.github/actions/on_host_test/action.yaml b/.github/actions/on_host_test/action.yaml
index 7df5e2f..7d9efa0 100644
--- a/.github/actions/on_host_test/action.yaml
+++ b/.github/actions/on_host_test/action.yaml
@@ -60,12 +60,14 @@
       run: |
         echo "PYTHONPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
         echo "TEST_RESULTS_DIR=${GITHUB_WORKSPACE}/unit-test-results" >> $GITHUB_ENV
+        echo "XML_FILES_DIR=${GITHUB_WORKSPACE}/unit-test-results/${{ matrix.platform }}/${{ matrix.shard }}" >> $GITHUB_ENV
         echo "COVERAGE_DIR=${GITHUB_WORKSPACE}/coverage" >> $GITHUB_ENV
-        echo "TEST_REPORT_FILE=${GITHUB_WORKSPACE}/${{matrix.platform}}-${{matrix.shard}}" >> $GITHUB_ENV
     - name: Run Tests
+      id: run-tests
       shell: bash
       run: |
         set -x
+
         # Starboard toolchains are downloaded to a different dir on github. Create a symlink to reassure our tooling that everything is fine.
         if [ -d /root/starboard-toolchains ]; then
           ln -s /root/starboard-toolchains /github/home/starboard-toolchains
@@ -85,28 +87,31 @@
         elif [[ "${{matrix.shard}}" == 'evergreen-as-blackbox' ]]; then
           xvfb-run -a --server-args="-screen 0 1920x1080x24i +render +extension GLX -noreset" python3 $GITHUB_WORKSPACE/cobalt/black_box_tests/black_box_tests.py --platform ${{matrix.target_platform}} --config ${{matrix.config}} ${loader_args} --test_set evergreen
         elif [[ "${{matrix.shard}}" == 'coverage' ]]; then
-          xvfb-run -a --server-args="-screen 0 1920x1080x24i +render +extension GLX -noreset" python3 ${GITHUB_WORKSPACE}/starboard/tools/testing/test_runner.py --platform ${{matrix.target_platform}} --config ${{matrix.config}} -r ${loader_args} --xml_output_dir=${TEST_RESULTS_DIR} --coverage_dir=${COVERAGE_DIR} --coverage_report
+          xvfb-run -a --server-args="-screen 0 1920x1080x24i +render +extension GLX -noreset" python3 ${GITHUB_WORKSPACE}/starboard/tools/testing/test_runner.py --platform ${{matrix.target_platform}} --config ${{matrix.config}} -r ${loader_args} --xml_output_dir=${XML_FILES_DIR} --coverage_dir=${COVERAGE_DIR} --coverage_report
         else
+          # Set 'test_type' output to unit_tests for the upload steps below.
+          echo "test_type=unit_tests" >> $GITHUB_OUTPUT
           if [[ "${{inputs.os}}" == 'windows' ]]; then
-            python3 ${GITHUB_WORKSPACE}/starboard/tools/testing/test_runner.py --platform ${{matrix.target_platform}} --config ${{matrix.config}} -s ${{matrix.shard}} -r
+            python3 ${GITHUB_WORKSPACE}/starboard/tools/testing/test_runner.py --platform ${{matrix.target_platform}} --config ${{matrix.config}} -s ${{matrix.shard}} -r --xml_output_dir=${XML_FILES_DIR}
           else
-            xvfb-run -a --server-args="-screen 0 1920x1080x24i +render +extension GLX -noreset" python3 ${GITHUB_WORKSPACE}/starboard/tools/testing/test_runner.py --platform ${{matrix.target_platform}} --config ${{matrix.config}} -s ${{matrix.shard}} -r ${loader_args} --xml_output_dir=${TEST_RESULTS_DIR}
+            xvfb-run -a --server-args="-screen 0 1920x1080x24i +render +extension GLX -noreset" python3 ${GITHUB_WORKSPACE}/starboard/tools/testing/test_runner.py --platform ${{matrix.target_platform}} --config ${{matrix.config}} -s ${{matrix.shard}} -r ${loader_args} --xml_output_dir=${XML_FILES_DIR}
           fi
         fi
-    - name: Process unit test results
-      if: failure()
+    - name: Populate TAGS for unit test report
+      if: (success() || failure()) && steps.run-tests.outputs.test_type == 'unit_tests'
       shell: bash
       run: |
-        set -x
-        echo "Saving unit test report to ${TEST_REPORT_FILE}"
-        python3 ${GITHUB_WORKSPACE}/starboard/tools/testing/test_report_parser.py ${TEST_RESULTS_DIR} > ${TEST_REPORT_FILE}
-    - name: Upload unit test report
+        # Set tags for test differentiation.
+        tags="platform:${{ matrix.platform }}"
+        tags="${tags},os:${{ inputs.os }}"
+        echo $tags > ${TEST_RESULTS_DIR}/${{ matrix.platform }}/TAGS
+    - name: Archive unit test results
       uses: actions/upload-artifact@v3
-      if: failure()
+      if: (success() || failure()) && steps.run-tests.outputs.test_type == 'unit_tests'
       with:
-        name: unit-test-reports
-        path: ${{env.TEST_REPORT_FILE}}
-    - name: Upload coverage html report
+        name: unit-test-results
+        path: ${{env.TEST_RESULTS_DIR}}/
+    - name: Archive coverage html report
       if: success() && matrix.shard == 'coverage'
       uses: actions/upload-artifact@v3
       with:
diff --git a/.github/codecov.yml b/.github/codecov.yml
new file mode 100644
index 0000000..236a6f1
--- /dev/null
+++ b/.github/codecov.yml
@@ -0,0 +1,5 @@
+coverage:
+  status:
+    project:
+      default:
+        threshold: 1%
diff --git a/.github/config/win32.json b/.github/config/win32.json
index c65092c..9de9f00 100644
--- a/.github/config/win32.json
+++ b/.github/config/win32.json
@@ -11,7 +11,7 @@
       "name":"win32",
       "platform":"win32",
       "target_platform":"win-win32",
-      "extra_gn_arguments":"is_clang=false visual_studio_path=\\\"C:/BuildTools/VC/Tools/MSVC/14.15.26726\\\" msvc_path=\\\"C:/BuildTools/VC/Tools/MSVC/14.15.26726\\\""
+      "extra_gn_arguments":"is_clang=false"
     }
   ]
 }
diff --git a/.github/workflows/auto_assign.yaml b/.github/workflows/auto_assign.yaml
new file mode 100644
index 0000000..3a47169
--- /dev/null
+++ b/.github/workflows/auto_assign.yaml
@@ -0,0 +1,35 @@
+name: PR Reviewer Auto Assignment
+
+on:
+  pull_request_target:
+    types:
+      - opened
+      - reopened
+
+concurrency:
+  group: '${{ github.workflow }}-${{ github.event_name }} @ ${{ github.event.pull_request.number || github.sha }}'
+  cancel-in-progress: true
+
+jobs:
+  assign-reviewer:
+    runs-on: ubuntu-latest
+    permissions:
+      pull-requests: write
+    steps:
+    - name: Check if PR author is outside collaborator and assign reviewer
+      env:
+        PR_AUTHOR_LOGIN: ${{ github.event.pull_request.user.login }}
+        REPO_NAME: ${{ github.event.repository.full_name }}
+        PR_NUMBER: ${{ github.event.number }}
+      run: |
+        PERMISSION_LEVEL=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+          "https://api.github.com/repos/$REPO_NAME/collaborators/$PR_AUTHOR_LOGIN/permission" | jq -r .role_name)
+
+        if [ "$PERMISSION_LEVEL" == "none" ] || [ "$PERMISSION_LEVEL" == "read" ]; then
+          echo "PR author is an outside collaborator. Adding label..."
+
+          curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
+            -H "Accept: application/vnd.github.v3+json" \
+            -d '["outside collaborator"]' \
+            "https://api.github.com/repos/$REPO_NAME/issues/$PR_NUMBER/labels"
+        fi
diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml
new file mode 100644
index 0000000..834696d
--- /dev/null
+++ b/.github/workflows/coverage.yaml
@@ -0,0 +1,30 @@
+name: coverage
+
+on:
+  pull_request:
+    types:
+      - opened
+      - edited
+      - reopened
+      - synchronize
+  push:
+    branches:
+      - main
+      - feature/*
+
+jobs:
+  linux-coverage:
+    # TODO(b/286302961): Move back and re-enable this check once sharding is supported.
+    # Run on main branch for pushes, PRs and manual invocations.
+    # if: |
+    #  ${{ github.ref == 'refs/heads/main' &&
+    #      (github.event_name == 'push' ||
+    #      github.event_name == 'pull_request' ||
+    #      (github.event_name == 'workflow_dispatch' && inputs.nightly == 'false')) }}
+    uses: ./.github/workflows/main.yaml
+    permissions:
+      packages: write
+      pull-requests: write
+    with:
+      platform: linux-coverage
+      nightly: ${{ github.event.inputs.nightly }}
diff --git a/.github/workflows/label-cherry-pick.yaml b/.github/workflows/label-cherry-pick.yaml
index 6ac390a..1a80289 100644
--- a/.github/workflows/label-cherry-pick.yaml
+++ b/.github/workflows/label-cherry-pick.yaml
@@ -96,4 +96,6 @@
           reviewers: ${{ github.event.pull_request.user.login }}
           title: "Cherry pick PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}"
           body: |
-            "Refer to the original PR: https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}"
+            Refer to the original PR: https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}
+
+            ${{ github.event.pull_request.body }}
diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml
index 6a138cb..5baaaba 100644
--- a/.github/workflows/lint.yaml
+++ b/.github/workflows/lint.yaml
@@ -61,10 +61,7 @@
         # v2
         uses: gsactions/commit-message-checker@16fa2d5de096ae0d35626443bcd24f1e756cafee
         with:
-          excludeTitle: true
-          excludeDescription: true
-          checkAllCommitMessages: true
           accessToken: ${{ secrets.GITHUB_TOKEN }}
-          pattern: '^b\/\d+$'
+          pattern: 'b\/\d+'
           flags: 'gm'
-          error: 'Commit message should include at least one bug ID on a separate line (e.g. b/12345).'
+          error: 'PR title or description should include at least one bug ID.'
diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml
index e15041d..bff0dff 100644
--- a/.github/workflows/linux.yaml
+++ b/.github/workflows/linux.yaml
@@ -56,17 +56,3 @@
       platform: linux-modular
       nightly: ${{ github.event.inputs.nightly }}
       modular: true
-  linux-coverage:
-    # Run on main branch for pushes, PRs and manual invocations.
-    if: |
-     ${{ github.ref == 'refs/heads/main' &&
-         (github.event_name == 'push' ||
-         github.event_name == 'pull_request' ||
-         (github.event_name == 'workflow_dispatch' && inputs.nightly == 'false')) }}
-    uses: ./.github/workflows/main.yaml
-    permissions:
-      packages: write
-      pull-requests: write
-    with:
-      platform: linux-coverage
-      nightly: ${{ github.event.inputs.nightly }}
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index b501c1d..e0cd9b5 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -320,23 +320,3 @@
         uses: ./.github/actions/on_host_test
         with:
           os: linux
-
-  # Gets unit test report from on host tests and prints it.
-  on-host-unit-test-report:
-    needs: [on-host-test]
-    permissions: {}
-    if: failure()
-    runs-on: ubuntu-latest
-    steps:
-      - name: Collect Unit Test Reports
-        uses: actions/download-artifact@v3
-        with:
-          name: unit-test-reports
-          path: unit-test-reports
-      - name: Print Unit Test Reports
-        run: |
-          for filename in ${GITHUB_WORKSPACE}/unit-test-reports/*; do
-            basename $filename
-            cat $filename
-            echo
-          done
diff --git a/.github/workflows/main_win.yaml b/.github/workflows/main_win.yaml
index 3285f1a..ea1a301 100644
--- a/.github/workflows/main_win.yaml
+++ b/.github/workflows/main_win.yaml
@@ -130,7 +130,7 @@
   build:
     needs: [initialize]
     permissions: {}
-    runs-on: [self-hosted, X64, Windows]
+    runs-on: [self-hosted, win32]
     name: ${{matrix.name}}_${{matrix.config}}
     strategy:
       fail-fast: false
@@ -164,7 +164,7 @@
     needs: [initialize, build]
     permissions: {}
     if: needs.initialize.outputs.on_host_test == 'true'
-    runs-on: [self-hosted, Windows, X64]
+    runs-on: [self-hosted, win32]
     name: ${{matrix.name}}_${{matrix.shard}}_test
     strategy:
       fail-fast: false
diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml
index 787f056..1b282e4 100644
--- a/.github/workflows/pytest.yaml
+++ b/.github/workflows/pytest.yaml
@@ -18,7 +18,7 @@
     strategy:
       matrix:
         os: [ubuntu-latest, windows-latest]
-        python-version: ['3.7', '3.11']
+        python-version: ['3.8', '3.11']
       fail-fast: false
     runs-on: ${{ matrix.os }}
     steps:
diff --git a/.github/workflows/unit_test_report.yaml b/.github/workflows/unit_test_report.yaml
new file mode 100644
index 0000000..8f43f24
--- /dev/null
+++ b/.github/workflows/unit_test_report.yaml
@@ -0,0 +1,107 @@
+name: Upload Unit Test Results
+
+on:
+  workflow_run:
+    workflows:
+      - evergreen
+      - linux
+      - win32
+    types:
+      - completed
+
+jobs:
+  unit-test-report:
+    permissions: {}
+      # TODO(b/293508740): Report failed workflow runs back to triggering PR.
+      # pull-requests: write
+    if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure' }}
+    runs-on: ubuntu-latest
+    name: Upload Unit Test Reports
+    steps:
+      - name: Download '${{ github.event.workflow_run.name }}' Unit Test Results
+        # The `download-artifact` action can only access artifacts that were uploaded in the same workflow.
+        # Since it was not this workflow that uploaded the artifacts we must use rest api to download them.
+        # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
+        uses: actions/github-script@v6
+        with:
+          script: |
+            const name = context.payload.workflow_run.name;
+            const url = context.payload.workflow_run.html_url;
+
+            console.log(`Downloading artifacts from ${url}`)
+            context.payload.workflow_run.pull_requests.forEach(pr => {
+              console.log(`Pull request: ${context.payload.repository.html_url}/pull/${pr.number}`);
+            });
+
+            let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              run_id: context.payload.workflow_run.id
+            });
+
+            let matchArtifacts = allArtifacts.data.artifacts.filter((artifact) => {
+              return artifact.name == "unit-test-results"
+            });
+
+            if (matchArtifacts.length == 1) {
+              let download = await github.rest.actions.downloadArtifact({
+                owner: context.repo.owner,
+                repo: context.repo.repo,
+                artifact_id: matchArtifacts[0].id,
+                archive_format: 'zip'
+              });
+              let fs = require('fs');
+              const path = `${process.env.GITHUB_WORKSPACE}/unit-test-results.zip`;
+              fs.writeFileSync(path, Buffer.from(download.data));
+            } else {
+              core.setFailed(`Expected one artifact with name 'unit-test-results'. Found ${matchArtifacts.length}.`);
+            }
+      - name: Extract Archived Unit Test Results
+        run: unzip unit-test-results.zip -d unit-test-results
+      - name: Get Datadog CLI
+        shell: bash
+        env:
+          DD_VERSION: 'v2.18.0'
+          DD_SHA256SUM: 'adbe9b3a41faaf0b1d9702ba256cf8fa9e474c0cc8216f25e5b489c53d6f0a70  datadog-ci'
+        run: |
+          set -e
+          download_url="https://github.com/DataDog/datadog-ci/releases/download/${DD_VERSION}/datadog-ci_linux-x64"
+          curl -L --fail $download_url --output datadog-ci
+          echo ${DD_SHA256SUM} | sha256sum --check
+          chmod +x datadog-ci
+      - name: Upload to Datadog
+        # Unit test results are archived on the following format:
+        # ├── <platform>
+        # │   ├── <shards>
+        # │   │   └── <test result xmls>
+        # │   └── TAGS
+        # ├── <platform>
+        # │   ├── <shards>
+        # │   │   └── <test result xmls>
+        # │   └── TAGS
+        # etc.
+        shell: bash
+        env:
+          DATADOG_API_KEY: ${{ secrets.DD_API_KEY }}
+          DATADOG_SITE: us5.datadoghq.com
+          DD_ENV: ci
+          DD_SERVICE: ${{ github.event.repository.name }}
+          # Need to populate git info via env vars as we don't have the repo to look at.
+          DD_GIT_REPOSITORY_URL: ${{ github.event.repository.git_url }}
+          DD_GIT_COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
+          DD_GIT_BRANCH: ${{ github.event.workflow_run.head_branch }}
+          DD_GIT_COMMIT_MESSAGE: ${{ github.event.workflow_run.head_commit.message }}
+          DD_GIT_COMMIT_AUTHOR_NAME: ${{ github.event.workflow_run.head_commit.author.name }}
+          DD_GIT_COMMIT_AUTHOR_EMAIL: ${{ github.event.workflow_run.head_commit.author.email }}
+          DD_GIT_COMMIT_AUTHOR_DATE: ${{ github.event.workflow_run.head_commit.timestamp }}
+          DD_GIT_COMMIT_COMMITTER_NAME: ${{ github.event.workflow_run.head_commit.committer.name }}
+          DD_GIT_COMMIT_COMMITTER_EMAIL: ${{ github.event.workflow_run.head_commit.committer.email }}
+          DD_GIT_COMMIT_COMMITTER_DATE:  ${{ github.event.workflow_run.head_commit.timestamp }}
+        run: |
+          # Loop over each platform, extract the tags and upload xml results.
+          for dir in unit-test-results/*/; do
+            echo "Uploading $dir test report"
+            export DD_TAGS=`cat ${dir}TAGS`
+            ./datadog-ci junit upload \
+                      $dir/**/*.xml
+          done
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index c4bd214..ea415f3 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -11,14 +11,17 @@
             base|
             build|
             buildtools|
+            cobalt/updater/win|
             components/crash/core/common|
-            components/metrics|
             components/metrics_services_manager|
+            components/metrics|
+            components/prefs|
             components/ukm|
             components/variations|
             components/version_info|
             crypto|
             extensions/buildflags|
+            glimp/include|
             net|
             internal/starboard/shared/playstation/glimp/shaders|
             testing|
@@ -29,6 +32,10 @@
         |
         components/update_client/((?!cobalt).)*$
         |
+        .*\.pb\.cc$ |
+        .*\.pb\.h$ |
+        .*\.patch$ |
+        .*Proto.java$|
         .*\.sig$
     )
 
@@ -50,15 +57,21 @@
                # The --ignore-words-list argument has a bug where it needs to
                # be lowercase, see
                # https://github.com/codespell-project/codespell/issues/1390
-               --ignore-words-list, atleast]
+               --ignore-words-list, "atleast,varius,ridiculus,statics",
+               ]
         exclude: |
             (?x)^(
                 (internal/)?starboard/[^/]+/i18n/|
                 cobalt/content/licenses/|
+                cobalt/content/ssl/|
                 cobalt/fetch/embedded_scripts|
+                cobalt/streams/embedded_scripts|
                 cobalt/loader/cors_preflight.cc|
                 internal/cobalt/browser/splash_screen/youtube_splash_screen.html|
-                internal/starboard/shared/playstation/storage_internal.cc
+                internal/starboard/shared/playstation/storage_internal.cc|
+                starboard/loader_app/app_key_test.cc|
+                starboard/shared/starboard/player/testdata|
+                starboard/shared/win32/media_transform.cc
             )
 
 -   repo: local
@@ -120,13 +133,25 @@
         stages: [push]
         exclude: |
             (?x)^(
+                .pylintrc$|
                 .pre-commit-config.yaml$|
-                cobalt/media/|
+                cobalt/base/unicode/|
+                cobalt/demos/content/|
                 cobalt/layout_tests/testdata/|
+                cobalt/math/|
+                cobalt/media/|
+                cobalt/streams/|
+                cobalt/updater/|
+                cobalt/webdriver/screencast/|
+                cobalt/websocket/|
+                components/crx_file/|
+                content/|
+                glimp/|
                 nb/|
                 starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaDrmBridge.java$|
                 starboard/shared/starboard/player/filter/decoded_audio_queue.cc$|
                 starboard/shared/starboard/player/filter/decoded_audio_queue.h$|
+                starboard/shared/starboard/player/testdata/licences/|
                 starboard/shared/starboard/player/filter/wsola_internal.cc$
             )
         exclude_types: [markdown]
@@ -166,20 +191,6 @@
         stages: [push]
         always_run: true
         pass_filenames: false
-    -   id: osslint
-        name: osslint
-        entry: python precommit_hooks/osslint_wrapper.py
-        language: python
-        types: [text]
-        stages: [manual]
-    -   id: internal-file-check
-        name: Internal File Check
-        entry: python precommit_hooks/internal_file_check_wrapper.py
-        language: python
-        types: [text]
-        # TODO: Remove docker-compose-windows.yml after internal check evaluates
-        # properly on it.
-        exclude: '(^docker-compose-windows(-internal)?.yml|EXCLUDE\.FILES(\.RECURSIVE)?|codereview\.settings)$'
     -   id: gn-format
         name: GN format
         entry: gn format
diff --git a/.pylintrc b/.pylintrc
index 6892a44..3707dea 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -216,7 +216,7 @@
 class-rgx=^_?[A-Z][a-zA-Z0-9]*$
 
 # Regular expression matching correct module names
-module-rgx=^(_?[a-z][a-z0-9_]*|__init__)$
+module-rgx=^(_?[a-z][a-z0-9_]*|__init__|2)$
 
 # Regular expression matching correct method names
 method-rgx=(?x)^(?:(?P<exempt>_[a-z0-9_]+__|runTest|setUp|tearDown|setUpTestCase|tearDownTestCase|setupSelf|tearDownClass|setUpClass|(test|assert)_*[A-Z0-9][a-zA-Z0-9_]*|next)|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9_]*)|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$
@@ -426,6 +426,6 @@
 
 # Exceptions that will emit a warning when being caught. Defaults to
 # "Exception"
-overgeneral-exceptions=StandardError,
-                       Exception,
-                       BaseException
+overgeneral-exceptions=builtins.StandardError,
+                       builtins.Exception,
+                       builtins.BaseException
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 9b82749..3853124 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -50,13 +50,17 @@
 
 #### General guidelines and philosophy for contribution
 
+*   Ensure your change references the bug you are addressing. Follow the
+    instructions
+    [here](https://cobalt.dev/communication.html#filing-bugs-and-feature-requests)
+    to view and create bugs.
 *   Include unit tests when you contribute new features, as they help to:
     1.   Prove that your code works correctly
     1.   Guard against future breaking changes to lower the maintenance cost.
 *   Bug fixes also generally require unit tests, because the presence of bugs
     usually indicates insufficient test coverage.
 *   When you contribute a new feature to Cobalt, the maintenance burden is
-    (by default) transferred to the Cobalbt team. This means that the benefit
+    (by default) transferred to the Cobalt team. This means that the benefit
     of the contribution must be compared against the cost of maintaining the
     feature.
 *   As every PR requires several CPU/GPU hours of CI testing, we discourage
diff --git a/README.md b/README.md
index 0a349a3..32d3816 100644
--- a/README.md
+++ b/README.md
@@ -43,14 +43,13 @@
 
   * **Limited Memory.** All except the very latest, expensive CE devices have a
     very small amount of memory available for applications. This usually is
-    somewhere in the ballpark of 200MB-500MB, including graphics and media
+    somewhere in the ballpark of 500MB, including graphics and media
     memory, as opposed to multiple gigabytes of CPU memory (and more gigabytes
     of GPU memory) in modern desktop and laptop computers, and mobile devices.
   * **Slow CPUs.** Most CE devices have much slower CPUs than what is available
     on even a budget desktop computer. Minor performance concerns can be greatly
-    exaggerated, which seriously affects priorities.
-  * **Fewer cores.** CE System-on-a-Chip (SoC) processors often do not have as
-    many processor cores as we are used to in modern computers.
+    exaggerated, which seriously affects priorities. Cobalt currently expects a
+    4-core 32-bit ARMv7 CPU as a baseline.
   * **Minimal GPU.** Not all CE devices have a monster GPU to throw shaders at
     to offload CPU work. As CE devices now have a standard GPU (though not
     nearly as powerful as even a laptop), OpenGL ES 2.0 is now required
@@ -62,10 +61,9 @@
     no ability to JIT.
   * **Heterogeneous Development Environments.** This is slowly evening out, but
     all CE devices run on custom hardware, often with proprietary methods of
-    building, packaging, deploying, and running programs. Almost all CE devices
-    have ARM processors instead of the more familiar x86. Sometimes the
-    toolchain doesn't support contemporary C++11/14 features. Sometimes the OS
-    isn't POSIX, or it tries to be, but it is only partially implemented.
+    building, packaging, deploying, and running programs. Sometimes the
+    toolchain doesn't support latest C++ language features. Sometimes the OS
+    does not support POSIX, or it is only partially implemented.
     Sometimes the program entry point is in another language or architecture
     that requires a "trampoline" over to native binary code.
   * **No navigation.** The point of a Single-Page Application is that you don't
@@ -73,10 +71,6 @@
     provides poor user feedback, not to mention a jarring transition. Instead,
     one loads data from an XMLHttpRequest (XHR), and then updates one's DOM to
     reflect the new data. AJAX! Web 2.0!!
-  * **No scrolling.** Well, full-screen, 10-foot UI SPA apps might scroll, but
-    not like traditional web pages, with scroll bars and a mouse
-    wheel. Scrolling is generally built into the app very carefully, with
-    support for a Directional Pad and a focus cursor.
 
 
 ## Architecture
@@ -92,19 +86,21 @@
 
   * **Web Implementation** - This is where the W3C standards are implemented,
     ultimately producing an annotated DOM tree that can be passed into the
-    Layout Engine to produce a Render Tree.
+    Layout Engine to produce a Render Tree. Cobalt uses a forked copy of
+    [Chrome Blink's Web IDL compiler](https://www.chromium.org/blink/webidl/) to
+    turn JavaScript IDLs to generated C++ bindings code.
   * **JavaScript Engine** - We have, perhaps surprisingly, *not* written our own
-    JavaScript Engine from scratch. Because of the JITing constraint, we have to
-    be flexible with which engine(s) we work with. We have a bindings layer that
-    interfaces with the JS Engine so that application script can interface with
-    natively-backed objects (like DOM elements).
+    JavaScript Engine from scratch. Cobalt is running on [Chromiums V8](https://v8.dev)
+    JavaScript engine. V8 supports all of our target platforms, including very
+    restricted ones where write-and-execute memory pages (needed for JIT) are
+    not available.
   * **Layout Engine** - The Layout Engine takes an annotated DOM Document
     produced by the Web Implementation and JavaScript Engine working together,
     and calculates a tree of rendering commands to send to the renderer (i.e. a
     Render Tree). It caches intermediate layout artifacts so that subsequent
     incremental layouts can be sped up.
   * **Renderer/Skia** - The Renderer walks a Render Tree produced by the Layout
-    Engine, rasterizes it using the third-party graphics library Skia, and swaps
+    Engine, rasterizes it using the [Chromium graphics library Skia](https://skia.org/), and swaps
     it to the front buffer. This is accomplished using Hardware Skia on OpenGL
     ES 2.0. Note that the renderer runs in a different thread from the Layout
     Engine, and can interpolate animations that do not require re-layout. This
@@ -122,7 +118,7 @@
     software. Mostly format decoders and parsers (e.g. libpng, libxml2,
     zlib). We fork these from Chromium, as we want them to be the most
     battle-tested versions of these libraries.
-  * **Starboard/Glimp/ANGLE** - **Starboard** is the Cobalt porting
+  * **Starboard** - **Starboard** is the Cobalt porting
     interface. One major difference between Cobalt and Chromium is that we have
     created a hard straight-C porting layer, and ported ALL of the compiled
     code, including Base and all third-party libraries, to use it instead of
@@ -130,10 +126,12 @@
     modern systems (see Android, Windows, MacOS X, and iOS). Additionally,
     Starboard includes APIs that haven't been effectively standardized across
     platforms, such as display Window creation, Input events, and Media
-    playback. **Glimp** is an OpenGL ES 2.0 implementation framework, built by
-    the Cobalt team directly on Starboard, designed to adapt proprietary 3D APIs
-    to GLES2. **ANGLE** Is a third-party library that adapts DirectX to GLES2,
-    similar to Glimp, but only for DirectX.
+    playback. A good overview of which OS interfaces are abstracted by Starboard
+    can be found in the [reference documentation.](https://cobalt.dev/reference/starboard/modules/configuration.html)
+  * **ANGLE and Glimp** [**ANGLE** is a Chromium library](https://angleproject.org/)
+    that adapts OpenGL ES 2.0 graphics to various other platform-native graphics APIs.
+    Cobalt uses it on Windows platforms to run on DirectX. Glimp is a similar
+    custom adapter layer that translatest from GL ES2.0 to PlayStation native graphics.
 
 ## The Cobalt Subset
 
diff --git a/base/BUILD.gn b/base/BUILD.gn
index b7cfe95..509aa37 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1560,7 +1560,7 @@
     ]
     public_configs = [ ":base_public_defines" ]
     deps += [
-      "//nb",
+      "//starboard/common",
       "//starboard",
       "//starboard/client_porting/eztime",
     ]
@@ -1582,7 +1582,7 @@
     # TODO(b/206642994): see if we can remove this condition. It's added for now
     # because linking atomic leads to linker errors for evergreen on arm-hardfp,
     # and it's apparently not really needed (i.e., we can build without it).
-    if (!is_starboard || !sb_is_evergreen) {
+    if (!is_starboard || !sb_is_modular) {
       libs += [ "atomic" ]
     }
   }
diff --git a/base/android/jni_generator/AndroidManifest.xml b/base/android/jni_generator/AndroidManifest.xml
index ec28ff5..1555a81 100644
--- a/base/android/jni_generator/AndroidManifest.xml
+++ b/base/android/jni_generator/AndroidManifest.xml
@@ -7,7 +7,7 @@
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.jni.generator">
 
-    <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="24" />
+    <uses-sdk android:minSdkVersion="24" android:targetSdkVersion="33" />
     <application></application>
 
 </manifest>
diff --git a/base/codereview.settings b/base/codereview.settings
deleted file mode 100644
index a4b341a..0000000
--- a/base/codereview.settings
+++ /dev/null
@@ -1,4 +0,0 @@
-# This file is used by gcl to get repository specific information.
-GERRIT_HOST: lbshell-internal-review.googlesource.com
-GERRIT_AUTODETECT_BRANCH: true
-CODE_REVIEW_SERVER: lbshell-internal-review.googlesource.com
diff --git a/base/files/file_starboard.cc b/base/files/file_starboard.cc
index 6c1e8ee..40e63d2 100644
--- a/base/files/file_starboard.cc
+++ b/base/files/file_starboard.cc
@@ -14,16 +14,28 @@
 
 // Adapted from platform_file_posix.cc
 
-#include "base/files/file.h"
+#include "base/files/file_starboard.h"
 
+#include "base/files/file.h"
 #include "base/files/file_path.h"
 #include "base/logging.h"
 #include "base/threading/thread_restrictions.h"
+#include "starboard/common/metrics/stats_tracker.h"
 #include "starboard/common/log.h"
 #include "starboard/file.h"
 
 namespace base {
 
+void RecordFileWriteStat(int write_file_result) {
+  auto& stats_tracker = starboard::StatsTrackerContainer::GetInstance()->stats_tracker();
+  if (write_file_result <= 0) {
+    stats_tracker.FileWriteFail();
+  } else {
+    stats_tracker.FileWriteSuccess();
+    stats_tracker.FileWriteBytesWritten(/*bytes_written=*/write_file_result);
+  }
+}
+
 // Make sure our Whence mappings match the system headers.
 static_assert(
     File::FROM_BEGIN == static_cast<int>(kSbFileFromBegin) &&
@@ -181,8 +193,9 @@
     return -1;
 
   SCOPED_FILE_TRACE_WITH_SIZE("WriteAtCurrentPos", size);
-
-  return SbFileWriteAll(file_.get(), data, size);
+  int write_result = SbFileWriteAll(file_.get(), data, size);
+  RecordFileWriteStat(write_result);
+  return write_result;
 }
 
 int File::WriteAtCurrentPosNoBestEffort(const char* data, int size) {
@@ -192,7 +205,9 @@
     return -1;
 
   SCOPED_FILE_TRACE_WITH_SIZE("WriteAtCurrentPosNoBestEffort", size);
-  return SbFileWrite(file_.get(), data, size);
+  int write_result = SbFileWrite(file_.get(), data, size);
+  RecordFileWriteStat(write_result);
+  return write_result;
 }
 
 int64_t File::GetLength() {
diff --git a/cobalt/h5vcc/h5vcc_account_info.idl b/base/files/file_starboard.h
similarity index 67%
copy from cobalt/h5vcc/h5vcc_account_info.idl
copy to base/files/file_starboard.h
index 1fc2417..81f8874 100644
--- a/cobalt/h5vcc/h5vcc_account_info.idl
+++ b/base/files/file_starboard.h
@@ -1,4 +1,4 @@
-// Copyright 2015 The Cobalt Authors. All Rights Reserved.
+// Copyright 2023 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.
@@ -12,8 +12,13 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-interface H5vccAccountInfo {
-  readonly attribute DOMString avatarUrl;
-  readonly attribute DOMString username;
-  readonly attribute DOMString userId;
-};
+#ifndef BASE_FILES_FILE_STARBOARD_H_
+#define BASE_FILES_FILE_STARBOARD_H_
+
+namespace base {
+
+void RecordFileWriteStat(int write_file_result);
+
+}  // namespace base
+
+#endif  // BASE_FILES_FILE_STARBOARD_H_
diff --git a/base/files/file_util.cc b/base/files/file_util.cc
index 8654654..befe725 100644
--- a/base/files/file_util.cc
+++ b/base/files/file_util.cc
@@ -23,7 +23,6 @@
 #include "build/build_config.h"
 
 #if defined(STARBOARD)
-#include "starboard/common/file.h"
 #include "starboard/memory.h"
 #include "starboard/types.h"
 #endif
@@ -62,18 +61,16 @@
   // doing anything smart with text formatting.
 #ifdef STARBOARD
   // std::ifstream doesn't work on all our platforms.
-  starboard::ScopedFile file1(filename1.value().c_str(),
-                              kSbFileOpenOnly | kSbFileRead);
-  starboard::ScopedFile file2(filename2.value().c_str(),
-                              kSbFileOpenOnly | kSbFileRead);
-  auto file1_length = file1.GetSize();
-  if (file1_length != file2.GetSize()) {
+  base::File file1(filename1, base::File::FLAG_OPEN | base::File::FLAG_READ);
+  base::File file2(filename2, base::File::FLAG_OPEN | base::File::FLAG_READ);
+  auto file1_length = file1.GetLength();
+  if (file1_length != file2.GetLength()) {
     return false;
   }
   std::unique_ptr<char[]> file1_content(new char[file1_length]());
   std::unique_ptr<char[]> file2_content(new char[file1_length]());
-  if (file1.ReadAll(file1_content.get(), file1_length) != file1_length ||
-      file2.ReadAll(file2_content.get(), file1_length) != file1_length) {
+  if (file1.ReadAtCurrentPos(file1_content.get(), file1_length) != file1_length ||
+      file2.ReadAtCurrentPos(file2_content.get(), file1_length) != file1_length) {
     return false;
   }
 
diff --git a/base/logging.cc b/base/logging.cc
index a9d61c6..809e141 100644
--- a/base/logging.cc
+++ b/base/logging.cc
@@ -7,9 +7,11 @@
 #include <limits.h>
 
 #include "base/macros.h"
+#include "base/trace_event/trace_event.h"
 #include "build/build_config.h"
 
 #if defined(STARBOARD)
+#include "base/files/file_starboard.h"
 #include "starboard/client_porting/eztime/eztime.h"
 #include "starboard/common/log.h"
 #include "starboard/common/mutex.h"
@@ -555,7 +557,7 @@
   g_min_log_level = std::min(LOG_FATAL, level);
 }
 
-#if defined(OFFICIAL_BUILD) && !SB_IS(EVERGREEN)
+#if defined(OFFICIAL_BUILD) && !SB_IS(MODULAR)
 int GetMinLogLevel() {
   return LOG_NUM_SEVERITIES;
 }
@@ -579,7 +581,7 @@
 
 void SetLogPrefix(const char* prefix) {}
 
-#else  // defined(OFFICIAL_BUILD) && !SB_IS(EVERGREEN)
+#else  // defined(OFFICIAL_BUILD) && !SB_IS(MODULAR)
 
 int GetMinLogLevel() {
   return g_min_log_level;
@@ -623,7 +625,7 @@
          base::ContainsOnlyChars(prefix, "abcdefghijklmnopqrstuvwxyz"));
   g_log_prefix = prefix;
 }
-#endif  // defined(OFFICIAL_BUILD) && !SB_IS(EVERGREEN)
+#endif  // defined(OFFICIAL_BUILD) && !SB_IS(MODULAR)
 
 void SetShowErrorDialogs(bool enable_dialogs) {
   show_error_dialogs = enable_dialogs;
@@ -723,6 +725,8 @@
 #endif
   stream_ << std::endl;
   std::string str_newline(stream_.str());
+  TRACE_EVENT_INSTANT1("log", "LogMessage", TRACE_EVENT_SCOPE_THREAD, "message",
+                       str_newline);
 
   // Give any log message handler first dibs on the message.
   if (log_message_handler &&
@@ -939,6 +943,7 @@
       while (written < str_newline.length()) {
         int result = SbFileWrite(g_log_file, &(str_newline.c_str()[written]),
                                  str_newline.length() - written);
+        base::RecordFileWriteStat(result);
         if (result < 0) {
           break;
         }
diff --git a/base/logging.h b/base/logging.h
index e2e94b5..33cd785 100644
--- a/base/logging.h
+++ b/base/logging.h
@@ -412,12 +412,12 @@
 // LOG_IS_ON(DFATAL) always holds in debug mode. In particular, CHECK()s will
 // always fire if they fail.
 
-#if defined(OFFICIAL_BUILD) && !SB_IS(EVERGREEN)
+#if defined(OFFICIAL_BUILD) && !SB_IS(MODULAR)
 #define LOG_IS_ON(severity) false
-#else  // defined(OFFICIAL_BUILD) && !SB_IS(EVERGREEN)
+#else  // defined(OFFICIAL_BUILD) && !SB_IS(MODULAR)
 #define LOG_IS_ON(severity) \
   (::logging::ShouldCreateLogMessage(::logging::LOG_##severity))
-#endif  // defined(OFFICIAL_BUILD) && !SB_IS(EVERGREEN)
+#endif  // defined(OFFICIAL_BUILD) && !SB_IS(MODULAR)
 
 // We can't do any caching tricks with VLOG_IS_ON() like the
 // google-glog version since it requires GCC extensions.  This means
@@ -445,9 +445,9 @@
 #define LOG_IF(severity, condition) \
   LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity) && (condition))
 
-#if defined(OFFICIAL_BUILD) && !SB_IS(EVERGREEN)
+#if defined(OFFICIAL_BUILD) && !SB_IS(MODULAR)
 #define LOG_ONCE(severity) EAT_STREAM_PARAMETERS
-#else  // defined(OFFICIAL_BUILD) && !SB_IS(EVERGREEN)
+#else  // defined(OFFICIAL_BUILD) && !SB_IS(MODULAR)
 #define LOG_ONCE_MSG "[once] "
 
 constexpr uint32_t kFnvOffsetBasis32 = 0x811c9dc5U;
@@ -481,7 +481,7 @@
           ((::logging::LogOnceHelper<::logging::hash_32_fnv1a_const(__FILE__), \
                                     __LINE__>::logged_ = true) == true)))      \
       << LOG_ONCE_MSG
-#endif  // defined(OFFICIAL_BUILD) && !SB_IS(EVERGREEN)
+#endif  // defined(OFFICIAL_BUILD) && !SB_IS(MODULAR)
 
 // The VLOG macros log with negative verbosities.
 #define VLOG_STREAM(verbose_level) \
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index bd9808a..163c712 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -24,7 +24,6 @@
 #include "base/threading/thread_id_name_manager.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/trace_event/trace_event.h"
-#include "nb/memory_scope.h"
 
 namespace base {
 
@@ -405,7 +404,6 @@
 }
 
 void MessageLoop::SetThreadTaskRunnerHandle() {
-  TRACK_MEMORY_SCOPE("MessageLoop");
   DCHECK_CALLED_ON_VALID_THREAD(bound_thread_checker_);
   // Clear the previous thread task runner first, because only one can exist at
   // a time.
@@ -531,7 +529,6 @@
 }
 
 bool MessageLoop::DoDelayedWork(TimeTicks* next_delayed_work_time) {
-  TRACK_MEMORY_SCOPE("MessageLoop");
   if (!task_execution_allowed_ ||
       !pending_task_queue_.delayed_tasks().HasTasks()) {
     *next_delayed_work_time = TimeTicks();
diff --git a/base/message_loop/message_pump_io_starboard.cc b/base/message_loop/message_pump_io_starboard.cc
index 767dd1b..0194e54 100644
--- a/base/message_loop/message_pump_io_starboard.cc
+++ b/base/message_loop/message_pump_io_starboard.cc
@@ -20,7 +20,6 @@
 #include "base/observer_list.h"
 #include "base/posix/eintr_wrapper.h"
 #include "base/time/time.h"
-#include "nb/memory_scope.h"
 #include "starboard/common/socket.h"
 #include "starboard/socket_waiter.h"
 
@@ -171,7 +170,6 @@
 
 // Reentrant!
 void MessagePumpIOStarboard::Run(Delegate* delegate) {
-  TRACK_MEMORY_SCOPE("MessageLoop");
   AutoReset<bool> auto_reset_in_run(&in_run_, true);
 
   for (;;) {
diff --git a/base/message_loop/message_pump_ui_starboard.cc b/base/message_loop/message_pump_ui_starboard.cc
index 9a30ca3..ca6ce46 100644
--- a/base/message_loop/message_pump_ui_starboard.cc
+++ b/base/message_loop/message_pump_ui_starboard.cc
@@ -17,7 +17,6 @@
 #include "base/logging.h"
 #include "base/run_loop.h"
 #include "base/time/time.h"
-#include "nb/memory_scope.h"
 #include "starboard/event.h"
 #include "starboard/system.h"
 
@@ -106,7 +105,6 @@
 
 void MessagePumpUIStarboard::ScheduleDelayedWork(
     const base::TimeTicks& delayed_work_time) {
-  TRACK_MEMORY_SCOPE("MessageLoop");
   base::TimeDelta delay;
   if (!delayed_work_time.is_null()) {
     delay = delayed_work_time - base::TimeTicks::Now();
@@ -121,7 +119,6 @@
     // Make sure any outstanding delayed event is canceled.
     CancelDelayedLocked();
 
-    TRACK_MEMORY_SCOPE("MessageLoop");
     outstanding_delayed_events_.insert(
         SbEventSchedule(&CallMessagePumpDelayed, this, delay.ToSbTime()));
   }
@@ -154,7 +151,6 @@
 }
 
 void MessagePumpUIStarboard::CancelDelayedLocked() {
-  TRACK_MEMORY_SCOPE("MessageLoop");
   outstanding_events_lock_.AssertAcquired();
   for (SbEventIdSet::iterator it = outstanding_delayed_events_.begin();
        it != outstanding_delayed_events_.end(); ++it) {
diff --git a/base/metrics/persistent_histogram_storage.cc b/base/metrics/persistent_histogram_storage.cc
index 3801baf..0fb9628 100644
--- a/base/metrics/persistent_histogram_storage.cc
+++ b/base/metrics/persistent_histogram_storage.cc
@@ -14,10 +14,6 @@
 #include "base/time/time.h"
 #include "build/build_config.h"
 
-#if defined(STARBOARD)
-#include "starboard/common/file.h"
-#endif
-
 namespace {
 
 constexpr size_t kAllocSize = 1 << 20;  // 1 MiB
@@ -99,14 +95,7 @@
   StringPiece contents(static_cast<const char*>(allocator->data()),
                        allocator->used());
 #if defined(STARBOARD)
-  // All path should be UTF8 above Starboard.
-  SbFileError error;
-  bool out_created;
-  starboard::ScopedFile sb_file(file_path.AsUTF8Unsafe().c_str(),
-                                kSbFileCreateAlways | kSbFileWrite,
-                                &out_created, &error);
-
-  int bytes_written = sb_file.WriteAll(contents.data(), contents.size());
+  int bytes_written = base::WriteFile(file_path, contents.data(), contents.size());
   if (bytes_written == contents.size()) {
 #else
   if (!ImportantFileWriter::WriteFileAtomically(file_path, contents)) {
diff --git a/base/run_loop.cc b/base/run_loop.cc
index 29deb1d..d4d87d7 100644
--- a/base/run_loop.cc
+++ b/base/run_loop.cc
@@ -12,7 +12,6 @@
 #include "base/threading/thread_local.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "build/build_config.h"
-#include "nb/memory_scope.h"
 
 namespace base {
 
@@ -256,7 +255,6 @@
 #endif  // DCHECK_IS_ON()
 
 bool RunLoop::BeforeRun() {
-  TRACK_MEMORY_SCOPE("MessageLoop");
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
 
 #if DCHECK_IS_ON()
diff --git a/base/single_thread_task_runner.cc b/base/single_thread_task_runner.cc
index 3c1d832..49c9f0b 100644
--- a/base/single_thread_task_runner.cc
+++ b/base/single_thread_task_runner.cc
@@ -22,6 +22,12 @@
 #if defined(STARBOARD)
 namespace {
 
+#if defined(COBALT_BUILD_TYPE_DEBUG)
+const int kTimeWaitInterval = 10000;
+#else
+const int kTimeWaitInterval = 2000;
+#endif
+
 // Runs the given task, and then signals the given WaitableEvent.
 void RunAndSignal(const base::Closure& task, base::WaitableEvent* event) {
   TRACE_EVENT0("task", "RunAndSignal");
@@ -49,7 +55,8 @@
   if (task_may_run) {
     // Wait for the task to complete before proceeding.
     do {
-      if (task_finished.TimedWait(base::TimeDelta::FromMilliseconds(1000))) {
+      if (task_finished.TimedWait(
+              base::TimeDelta::FromMilliseconds(kTimeWaitInterval))) {
         break;
       }
 #if !defined(COBALT_BUILD_TYPE_GOLD)
diff --git a/base/sys_info_starboard.cc b/base/sys_info_starboard.cc
index b5aae9c..138a14c 100644
--- a/base/sys_info_starboard.cc
+++ b/base/sys_info_starboard.cc
@@ -15,9 +15,11 @@
 #include "base/sys_info.h"
 
 #include "base/logging.h"
+#include "starboard/common/system_property.h"
 #include "starboard/system.h"
 
 namespace base {
+ using starboard::kSystemPropertyMaxLength;
 
 // static
 int SysInfo::NumberOfProcessors() {
@@ -56,4 +58,17 @@
   return AmountOfPhysicalMemoryImpl();
 }
 
+// static
+std::string SysInfo::OperatingSystemName() {
+  char value[kSystemPropertyMaxLength];
+  SbSystemGetProperty(kSbSystemPropertyPlatformName, value,
+                      kSystemPropertyMaxLength);
+  return value;
+}
+
+// static
+std::string SysInfo::OperatingSystemVersion() {
+  return SysInfo::OperatingSystemName();
+}
+
 }  // namespace base
diff --git a/build/android/gradle/android.jinja b/build/android/gradle/android.jinja
index 40d4506..7d566dd 100644
--- a/build/android/gradle/android.jinja
+++ b/build/android/gradle/android.jinja
@@ -51,7 +51,7 @@
 
     defaultConfig {
         vectorDrawables.useSupportLibrary = true
-        minSdkVersion 21
+        minSdkVersion 24
         targetSdkVersion {{ target_sdk_version }}
     }
 
diff --git a/build/config/android/config.gni b/build/config/android/config.gni
index 652ea74..8ffe591 100644
--- a/build/config/android/config.gni
+++ b/build/config/android/config.gni
@@ -48,7 +48,7 @@
 
     # The default to use for android:minSdkVersion for targets that do
     # not explicitly set it.
-    default_min_sdk_version = 21
+    default_min_sdk_version = 24
 
     # [WIP] Allows devs to achieve much faster edit-build-install cycles.
     # Currently only works for ChromeModern apks due to incremental install.
@@ -62,8 +62,8 @@
     android32_ndk_api_level = default_min_sdk_version
 
     # Android API level for 64 bits platforms
-    if (default_min_sdk_version < 21) {
-      android64_ndk_api_level = 21
+    if (default_min_sdk_version < 24) {
+      android64_ndk_api_level = 24
     } else {
       android64_ndk_api_level = default_min_sdk_version
     }
@@ -81,8 +81,8 @@
 
   if (!defined(default_android_ndk_root)) {
     default_android_ndk_root = "//third_party/android_ndk"
-    default_android_ndk_version = "r22"
-    default_android_ndk_major_version = 22
+    default_android_ndk_version = "r25"
+    default_android_ndk_major_version = 25
   } else {
     assert(defined(default_android_ndk_version))
     assert(defined(default_android_ndk_major_version))
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
index 8f7c597..3996b5a 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -590,21 +590,3 @@
 config("nominmax") {
   defines = [ "NOMINMAX" ]
 }
-
-# Visual Studio 2022 Upgrade --------------------------------------------------
-
-# TODO(b/210151198) Visual Studio 2022 upgrade compatibility changes.
-# To be deleted after the upgrade completes and 2022 is the default.
-
-if (is_starboard) {
-  config("visual_studio_version_compat") {
-    if (use_visual_studio_2022) {
-      cflags = [
-        "/wd4800",
-        "/wd4834",
-        "/wd4858",
-        "/wd5208"
-      ]
-    }
-  }
-}
diff --git a/build/config/win/visual_studio_version.gni b/build/config/win/visual_studio_version.gni
index 11f5f02..63b9a97 100644
--- a/build/config/win/visual_studio_version.gni
+++ b/build/config/win/visual_studio_version.gni
@@ -4,7 +4,7 @@
 
 if (is_starboard) {
   declare_args() {
-    visual_studio_version = "14.15.26726"
+    visual_studio_version = "14.34.31933"
 
     # Full path to the Windows SDK, not including a backslash at the end.
     # This value is the default location, override if you have a different
@@ -15,20 +15,6 @@
     if (current_os == "winuwp") {
       wdk_version = "10.0.22000.0"
     } else {
-      wdk_version = "10.0.17763.0"
-    }
-  }
-
-  # TODO(b/210151198) Visual Studio 2022 upgrade compatibility changes.
-  # This argument should be removed, and replace the defaults for the arguments
-  # that are being overriden correspondingly.
-  declare_args() {
-    use_visual_studio_2022 = getenv("VISUAL_STUDIO_VERSION") == "2022"
-  }
-
-  if (use_visual_studio_2022) {
-    visual_studio_version = "14.34.31933"
-    if (current_os != "winuwp") {
       wdk_version = "10.0.18362.0"
     }
   }
@@ -36,14 +22,9 @@
   if (is_docker_build) {
     _default_visual_studio_path = "C:/BuildTools"
   } else {
-    if (use_visual_studio_2022) {
-      _vis_std_year = "2022"
-    } else {
-      _vis_std_year = "2017"
-    }
-    _default_visual_studio_path = getenv("VS2022INSTALLDIR")
+    _default_visual_studio_path = getenv("VSINSTALLDIR")
     if (_default_visual_studio_path == "") {
-      _default_visual_studio_path = "C:/Program Files (x86)/Microsoft Visual Studio/$_vis_std_year/Professional"
+      _default_visual_studio_path = "C:/Program Files (x86)/Microsoft Visual Studio/2022/Professional"
     }
   }
 
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni
index df72296..2a2cc3c 100644
--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -117,7 +117,7 @@
 template("gcc_toolchain") {
   toolchain(target_name) {
     is_starboard_toolchain = target_name == "starboard"
-    if (!build_with_separate_cobalt_toolchain) {
+    if (!sb_is_modular || sb_is_evergreen) {
       not_needed(["is_starboard_toolchain"])
     }
     assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value")
@@ -391,7 +391,7 @@
       # TODO(b/206642994): see if we can remove this condition. It's needed for
       # now to add cflags for evergreen platforms but we haven't yet decided
       # whether cflags should be added here for all platforms.
-      if (is_starboard && sb_is_evergreen && !is_starboard_toolchain) {
+      if (!is_starboard_toolchain && is_starboard && sb_is_modular) {
         command = "$asm -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_dirs}} {{cflags}} {{asmflags}}${extra_asmflags} -c {{source}} -o {{output}}"
       } else {
         command = "$asm -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_dirs}} {{asmflags}}${extra_asmflags} -c {{source}} -o {{output}}"
@@ -457,14 +457,7 @@
       # .TOC file, overwrite it, otherwise, don't change it.
       tocfile = sofile + ".TOC"
 
-      # TODO(b/206642994): see if we can remove this condition. It's needed for
-      # now because we use the ld.lld linker for evergreen platforms and need to
-      # pass options as `option` instead of `-Wl,option`.
-      if (is_starboard && sb_is_evergreen && !is_starboard_toolchain) {
-        link_command = "$ld -shared -soname=\"$soname\" {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" @\"$rspfile\""
-      } else {
-        link_command = "$ld -shared -Wl,-soname=\"$soname\" {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" @\"$rspfile\""
-      }
+      link_command = "$ld -shared -Wl,-soname=\"$soname\" {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" @\"$rspfile\""
 
       # Generate a map file to be used for binary size analysis.
       # Map file adds ~10% to the link time on a z620.
@@ -491,11 +484,6 @@
 
       if (target_cpu == "mipsel" && is_component_build && is_android) {
         rspfile_content = "-Wl,--start-group -Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive {{libs}} -Wl,--end-group$tail_lib_dependencies"
-        # TODO(b/206642994): see if we can remove this condition. It's needed for
-        # now because we use the ld.lld linker for evergreen platforms and need
-        # to pass options as `option` instead of `-Wl,option`.
-      } else if (is_starboard && sb_is_evergreen && !is_starboard_toolchain) {
-        rspfile_content = "--whole-archive {{inputs}} {{solibs}} --no-whole-archive {{libs}}$tail_lib_dependencies"
       } else {
         rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive {{libs}}$tail_lib_dependencies"
       }
diff --git a/cobalt/BUILD.gn b/cobalt/BUILD.gn
index 867f45e..92fe9dc 100644
--- a/cobalt/BUILD.gn
+++ b/cobalt/BUILD.gn
@@ -66,24 +66,20 @@
     "//third_party/brotli:dec_no_dictionary_data",
   ]
 
-  if (sb_is_evergreen) {
-    deps += [
-      "//base/util/values:values_util",
-      "//cobalt/updater",
-      "//cobalt/updater:crash_sandbox",
-      "//cobalt/updater:noop_sandbox",
-      "//cobalt/updater:one_app_only_sandbox",
-      "//components/client_update_protocol",
-      "//components/crx_file",
-      "//components/prefs",
-      "//components/update_client",
-      "//third_party/llvm-project/compiler-rt:compiler_rt",
-      "//third_party/llvm-project/libcxx:cxx",
-      "//third_party/llvm-project/libcxxabi:cxxabi",
-      "//third_party/musl:c",
-    ]
-    if (!build_with_separate_cobalt_toolchain) {
-      deps += [ "//third_party/llvm-project/libunwind:unwind_evergreen" ]
+  if (sb_is_modular) {
+    deps += [ "//base/util/values:values_util" ]
+    if (sb_is_evergreen) {
+      deps += [
+        # TODO(b/294247612): Remove unnecessary dependencies.
+        "//cobalt/updater",
+        "//cobalt/updater:crash_sandbox",
+        "//cobalt/updater:noop_sandbox",
+        "//cobalt/updater:one_app_only_sandbox",
+        "//components/client_update_protocol",
+        "//components/crx_file",
+        "//components/prefs",
+        "//components/update_client",
+      ]
     }
   }
 }
diff --git a/cobalt/account/user_authorizer.h b/cobalt/account/user_authorizer.h
index 784984a..a0eb78c 100644
--- a/cobalt/account/user_authorizer.h
+++ b/cobalt/account/user_authorizer.h
@@ -20,7 +20,6 @@
 
 #include "base/optional.h"
 #include "base/time/time.h"
-#include "starboard/user.h"
 
 namespace cobalt {
 namespace account {
@@ -35,7 +34,7 @@
 
 // Platform-specific mechanism to authorize a user to access protected resources
 // in a web app running in Cobalt. Manages getting, refreshing, and discarding
-// an access token associated with a platform user identified by a |SbUser|.
+// an access token associated with a platform user.
 class UserAuthorizer {
  public:
   UserAuthorizer() {}
@@ -51,7 +50,7 @@
   // including an invalid |user|, or user cancellation of the authorization
   // process.
   // On success, a std::unique_ptr holding a valid AccessToken is returned.
-  virtual std::unique_ptr<AccessToken> AuthorizeUser(SbUser user) = 0;
+  virtual std::unique_ptr<AccessToken> AuthorizeUser() = 0;
 
   // Remove authorization for |user| to use application resources (i.e.
   // sign-out).  This call will block until the linking process is complete,
@@ -62,7 +61,7 @@
   // succeeded.
   // Returns false if the process failed for any reason including an invalid
   // |user|, or user cancellation.
-  virtual bool DeauthorizeUser(SbUser user) = 0;
+  virtual bool DeauthorizeUser() = 0;
 
   // Requests a new access token to extend authorization for |user| to continue
   // using application resources.
@@ -71,7 +70,7 @@
   // including an invalid |user|, or |user| not already being authorized (in
   // which case AuthorizeUser should be called).
   // On success, a std::unique_ptr holding a valid AccessToken is returned.
-  virtual std::unique_ptr<AccessToken> RefreshAuthorization(SbUser user) = 0;
+  virtual std::unique_ptr<AccessToken> RefreshAuthorization() = 0;
 
   // Signals that the account manager is shutting down, and unblocks any pending
   // request. Calling other methods after |Shutdown| may have no effect.
diff --git a/cobalt/audio/async_audio_decoder.cc b/cobalt/audio/async_audio_decoder.cc
index c7885a1..df527e3 100644
--- a/cobalt/audio/async_audio_decoder.cc
+++ b/cobalt/audio/async_audio_decoder.cc
@@ -12,10 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/audio/async_audio_decoder.h"
 
+#include <memory>
+
 #include "base/bind.h"
 #include "base/logging.h"
 #include "cobalt/audio/audio_file_reader.h"
diff --git a/cobalt/audio/audio_device.cc b/cobalt/audio/audio_device.cc
index 7aae3b4..c2806c0 100644
--- a/cobalt/audio/audio_device.cc
+++ b/cobalt/audio/audio_device.cc
@@ -12,17 +12,15 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "cobalt/audio/audio_device.h"
+
 #include <algorithm>
 #include <memory>
 
-#include "cobalt/audio/audio_device.h"
-
-#include "starboard/configuration.h"
-
 #include "base/trace_event/trace_event.h"
 #include "cobalt/audio/audio_helpers.h"
-
 #include "starboard/audio_sink.h"
+#include "starboard/configuration.h"
 
 namespace cobalt {
 namespace audio {
diff --git a/cobalt/audio/audio_file_reader.cc b/cobalt/audio/audio_file_reader.cc
index 3dad138..9b590d7 100644
--- a/cobalt/audio/audio_file_reader.cc
+++ b/cobalt/audio/audio_file_reader.cc
@@ -12,10 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/audio/audio_file_reader.h"
 
+#include <memory>
+
 #include "cobalt/audio/audio_file_reader_wav.h"
 
 namespace cobalt {
diff --git a/cobalt/audio/audio_file_reader_wav.cc b/cobalt/audio/audio_file_reader_wav.cc
index c81ef88..ea8aa97 100644
--- a/cobalt/audio/audio_file_reader_wav.cc
+++ b/cobalt/audio/audio_file_reader_wav.cc
@@ -12,12 +12,12 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "cobalt/audio/audio_file_reader_wav.h"
+
 #include <memory>
 #include <sstream>
 #include <string>
 
-#include "cobalt/audio/audio_file_reader_wav.h"
-
 #include "base/basictypes.h"
 #include "base/logging.h"
 #include "cobalt/media/base/endian_util.h"
diff --git a/cobalt/audio/audio_node_input.cc b/cobalt/audio/audio_node_input.cc
index 977d67e..41d186b 100644
--- a/cobalt/audio/audio_node_input.cc
+++ b/cobalt/audio/audio_node_input.cc
@@ -12,10 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/audio/audio_node_input.h"
 
+#include <memory>
+
 #include "base/logging.h"
 #include "cobalt/audio/audio_context.h"
 #include "cobalt/audio/audio_node.h"
@@ -101,16 +101,36 @@
     // output.R = R + 0.7071 * (input.C + input.SR)
     const float kFivePointOneToStereoMatrixSpeaker[] = {
         // 1.0 * L + 0.0 * R + 0.7071 * C + 0.0 * LFE + 0.7071 * SL + 0.0 * SR
-        1.0f, 0.0f, 0.7071f, 0.0f, 0.7071f, 0.0f,
+        1.0f,
+        0.0f,
+        0.7071f,
+        0.0f,
+        0.7071f,
+        0.0f,
         // 0.0 * L + 1.0 * R + 0.7071 * C + 0.0 * LFE + 0.0 * SL + 0.7071 * SR
-        0.0f, 1.0f, 0.7071f, 0.0f, 0.0f, 0.7071f,
+        0.0f,
+        1.0f,
+        0.7071f,
+        0.0f,
+        0.0f,
+        0.7071f,
     };
 
     const float kFivePointOneToStereoMatrixDiscrete[] = {
         // 1.0 * L + 0.0 * R + 0.0 * C + 0.0 * LFE + 0.0 * SL + 0.0 * SR
-        1.f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
+        1.f,
+        0.0f,
+        0.0f,
+        0.0f,
+        0.0f,
+        0.0f,
         // 0.0 * L + 1.0 * R + 0.0 * C + 0.0 * LFE + 0.0 * SL + 0.0 * SR
-        0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
+        0.0f,
+        1.0f,
+        0.0f,
+        0.0f,
+        0.0f,
+        0.0f,
     };
 
     MixAudioBufferBasedOnInterpretation(
@@ -137,12 +157,18 @@
     // output = 0.25 * (input.L + input.R + input.SL + input.SR);
     const float kQuadToMonoSpeaker[] = {
         // 0.25 * L + 0.25 * R + 0.25 * SL + 0.25 * SR
-        0.25f, 0.25f, 0.25f, 0.25f,
+        0.25f,
+        0.25f,
+        0.25f,
+        0.25f,
     };
 
     const float kQuadToMonoDiscrete[] = {
         // 1.0 * L + 0.0 * R + 0.0 * SL + 0.0 * SR
-        1.0f, 0.0f, 0.0f, 0.0f,
+        1.0f,
+        0.0f,
+        0.0f,
+        0.0f,
     };
 
     MixAudioBufferBasedOnInterpretation(kQuadToMonoSpeaker, kQuadToMonoDiscrete,
diff --git a/cobalt/audio/audio_node_output.cc b/cobalt/audio/audio_node_output.cc
index ed6c507..4b6c0c2 100644
--- a/cobalt/audio/audio_node_output.cc
+++ b/cobalt/audio/audio_node_output.cc
@@ -12,10 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/audio/audio_node_output.h"
 
+#include <memory>
+
 #include "base/logging.h"
 #include "cobalt/audio/audio_context.h"
 #include "cobalt/audio/audio_node.h"
diff --git a/cobalt/base/BUILD.gn b/cobalt/base/BUILD.gn
index e335403..5552a2e 100644
--- a/cobalt/base/BUILD.gn
+++ b/cobalt/base/BUILD.gn
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 config("base_config") {
-  defines = [ "COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS" ]
+  defines = []
 
   if (is_debug || is_devel) {
     defines += [
@@ -70,6 +70,7 @@
     "ref_counted_lock.h",
     "source_location.cc",
     "source_location.h",
+    "starboard_stats_tracker.h",
     "startup_timer.cc",
     "startup_timer.h",
     "statistics.h",
diff --git a/cobalt/base/c_val.h b/cobalt/base/c_val.h
index cc285c9..fde535a 100644
--- a/cobalt/base/c_val.h
+++ b/cobalt/base/c_val.h
@@ -235,17 +235,16 @@
   oss << std::fixed << std::setprecision(1) << std::setfill('0');
   if (value_in_us > kHour) {
     oss << value_in_us / kHour << ":" << std::setw(2)
-        << (value_in_us % kHour) / kMinute << ":"
-        << std::setw(2) << (value_in_us % kMinute) / kSecond << "h";
+        << (value_in_us % kHour) / kMinute << ":" << std::setw(2)
+        << (value_in_us % kMinute) / kSecond << "h";
   } else if (value_in_us > kMinute) {
     oss << value_in_us / kMinute << ":" << std::setw(2)
         << (value_in_us % kMinute) / kSecond << "m";
   } else if (value_in_us > kSecond) {
-    oss << std::setw(1)
-        << static_cast<double>(value_in_us) / kSecond << "s";
+    oss << std::setw(1) << static_cast<double>(value_in_us) / kSecond << "s";
   } else if (value_in_us > kMillisecond) {
-    oss << std::setw(1)
-        << static_cast<double>(value_in_us) / kMillisecond << "ms";
+    oss << std::setw(1) << static_cast<double>(value_in_us) / kMillisecond
+        << "ms";
   } else {
     oss << value_in_us << "us";
   }
@@ -646,10 +645,8 @@
  public:
   CValStub(const std::string& name, const T& initial_value,
            const std::string& description)
-      : value_(initial_value) {
-  }
-  CValStub(const std::string& name, const std::string& description) {
-  }
+      : value_(initial_value) {}
+  CValStub(const std::string& name, const std::string& description) {}
 
   operator T() const { return value_; }
 
diff --git a/cobalt/base/c_val_collection_entry_stats.h b/cobalt/base/c_val_collection_entry_stats.h
index 83b038a..69dec89 100644
--- a/cobalt/base/c_val_collection_entry_stats.h
+++ b/cobalt/base/c_val_collection_entry_stats.h
@@ -319,12 +319,10 @@
   typedef CValCollectionEntryStatsFlushResults<EntryType> FlushResults;
   typedef typename FlushResults::OnFlushCallback OnFlushCallback;
 
-  explicit CValCollectionEntryStatsStub(const std::string& name) {
-  }
+  explicit CValCollectionEntryStatsStub(const std::string& name) {}
   CValCollectionEntryStatsStub(
       const std::string& name, size_t max_size, bool enable_entry_list_c_val,
-      const OnFlushCallback& on_flush = OnFlushCallback()) {
-  }
+      const OnFlushCallback& on_flush = OnFlushCallback()) {}
 
   void AddEntry(const EntryType& value) {}
   void Flush() {}
diff --git a/cobalt/base/c_val_collection_entry_stats_test.cc b/cobalt/base/c_val_collection_entry_stats_test.cc
index f49ed30..153aa96 100644
--- a/cobalt/base/c_val_collection_entry_stats_test.cc
+++ b/cobalt/base/c_val_collection_entry_stats_test.cc
@@ -12,16 +12,17 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "cobalt/base/c_val_collection_entry_stats.h"
+
 #include <string>
 
-#include "cobalt/base/c_val_collection_entry_stats.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using ::testing::_;
 using ::testing::InSequence;
 using ::testing::Return;
 using ::testing::SaveArg;
-using ::testing::_;
 
 namespace base {
 
diff --git a/cobalt/base/c_val_collection_timer_stats_test.cc b/cobalt/base/c_val_collection_timer_stats_test.cc
index b99c2de..273bb4b 100644
--- a/cobalt/base/c_val_collection_timer_stats_test.cc
+++ b/cobalt/base/c_val_collection_timer_stats_test.cc
@@ -12,17 +12,18 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "cobalt/base/c_val_collection_timer_stats.h"
+
 #include <string>
 
 #include "base/time/time.h"
-#include "cobalt/base/c_val_collection_timer_stats.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using ::testing::_;
 using ::testing::InSequence;
 using ::testing::Return;
 using ::testing::SaveArg;
-using ::testing::_;
 
 namespace base {
 
diff --git a/cobalt/base/c_val_test.cc b/cobalt/base/c_val_test.cc
index 56477c0..7f34992 100644
--- a/cobalt/base/c_val_test.cc
+++ b/cobalt/base/c_val_test.cc
@@ -12,20 +12,21 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "cobalt/base/c_val.h"
+
 #include <limits>
 #include <utility>
 
 #include "base/synchronization/waitable_event.h"
 #include "base/threading/simple_thread.h"
 #include "base/time/time.h"
-#include "cobalt/base/c_val.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using ::testing::_;
 using ::testing::InSequence;
 using ::testing::Return;
 using ::testing::SaveArg;
-using ::testing::_;
 
 namespace base {
 
@@ -662,7 +663,7 @@
 
 // Tests that we can create and destroy cvals no problem while simultaneously
 // reading from them.  The test creates two threads, a reader thread and a
-// creater/destroyer (and writer) thread.  These both attempt to access the same
+// creator/destroyer (and writer) thread.  These both attempt to access the same
 // cval as fast as possible.
 TEST(CValTest, RemoveAndRead) {
   const char* kTestCValName = "TestCVal";
diff --git a/cobalt/base/c_val_time_interval_entry_stats.h b/cobalt/base/c_val_time_interval_entry_stats.h
index 81dd774..075d9ef 100644
--- a/cobalt/base/c_val_time_interval_entry_stats.h
+++ b/cobalt/base/c_val_time_interval_entry_stats.h
@@ -186,8 +186,7 @@
 class CValTimeIntervalEntryStatsStub {
  public:
   CValTimeIntervalEntryStatsStub(const std::string& name,
-                                 int64 time_interval_in_ms) {
-  }
+                                 int64 time_interval_in_ms) {}
 
   void AddEntry(const EntryType& value) {}
   void AddEntry(const EntryType& value, const base::TimeTicks& now) {}
diff --git a/cobalt/base/c_val_time_interval_entry_stats_test.cc b/cobalt/base/c_val_time_interval_entry_stats_test.cc
index be3d93b..56bd15d 100644
--- a/cobalt/base/c_val_time_interval_entry_stats_test.cc
+++ b/cobalt/base/c_val_time_interval_entry_stats_test.cc
@@ -12,16 +12,17 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "cobalt/base/c_val_time_interval_entry_stats.h"
+
 #include <string>
 
-#include "cobalt/base/c_val_time_interval_entry_stats.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using ::testing::_;
 using ::testing::InSequence;
 using ::testing::Return;
 using ::testing::SaveArg;
-using ::testing::_;
 
 namespace base {
 
diff --git a/cobalt/base/c_val_time_interval_timer_stats_test.cc b/cobalt/base/c_val_time_interval_timer_stats_test.cc
index 15190c5..a5ae787 100644
--- a/cobalt/base/c_val_time_interval_timer_stats_test.cc
+++ b/cobalt/base/c_val_time_interval_timer_stats_test.cc
@@ -12,17 +12,18 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "cobalt/base/c_val_time_interval_timer_stats.h"
+
 #include <string>
 
 #include "base/time/time.h"
-#include "cobalt/base/c_val_time_interval_timer_stats.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using ::testing::_;
 using ::testing::InSequence;
 using ::testing::Return;
 using ::testing::SaveArg;
-using ::testing::_;
 
 namespace base {
 
diff --git a/cobalt/base/circular_buffer_shell.h b/cobalt/base/circular_buffer_shell.h
index add70ea..e9fa42e 100644
--- a/cobalt/base/circular_buffer_shell.h
+++ b/cobalt/base/circular_buffer_shell.h
@@ -1,9 +1,10 @@
+// Copyright 2023 The Cobalt Authors. All Rights Reserved.
 // Copyright (c) 2014 Google Inc. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_CIRCULAR_BUFFER_SHELL_H_
-#define BASE_CIRCULAR_BUFFER_SHELL_H_
+#ifndef COBALT_BASE_CIRCULAR_BUFFER_SHELL_H_
+#define COBALT_BASE_CIRCULAR_BUFFER_SHELL_H_
 
 #include "base/base_export.h"
 #include "base/synchronization/lock.h"
@@ -101,4 +102,4 @@
 
 }  // namespace base
 
-#endif  // BASE_CIRCULAR_BUFFER_SHELL_H_
+#endif  // COBALT_BASE_CIRCULAR_BUFFER_SHELL_H_
diff --git a/cobalt/base/circular_buffer_shell_unittest.cc b/cobalt/base/circular_buffer_shell_unittest.cc
index 9c90eaf..444db67 100644
--- a/cobalt/base/circular_buffer_shell_unittest.cc
+++ b/cobalt/base/circular_buffer_shell_unittest.cc
@@ -1,4 +1,5 @@
 /*
+ * Copyright 2023 The Cobalt Authors. All Rights Reserved.
  * Copyright 2014 Google Inc. All Rights Reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,6 +19,8 @@
 
 #include <string.h>
 
+#include <memory>
+
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace {
diff --git a/cobalt/base/event.h b/cobalt/base/event.h
index 5e860f2..71e73ec 100644
--- a/cobalt/base/event.h
+++ b/cobalt/base/event.h
@@ -20,7 +20,7 @@
 namespace base {
 
 // Event is an abstract, generic class representing some system event that
-// occured.  Event producers like a SystemWindow will produce these events
+// occurred.  Event producers like a SystemWindow will produce these events
 // and dispatch them to the registered callbacks.
 // Derived classes should add the BASE_EVENT_SUBCLASS() macro to their public
 // attributes.
diff --git a/cobalt/base/event_dispatcher.cc b/cobalt/base/event_dispatcher.cc
index 018a505..1336d8f 100644
--- a/cobalt/base/event_dispatcher.cc
+++ b/cobalt/base/event_dispatcher.cc
@@ -12,10 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/base/event_dispatcher.h"
 
+#include <memory>
+
 #include "base/logging.h"
 
 namespace base {
diff --git a/cobalt/base/event_dispatcher.h b/cobalt/base/event_dispatcher.h
index 3cc9d3a..cbc6743 100644
--- a/cobalt/base/event_dispatcher.h
+++ b/cobalt/base/event_dispatcher.h
@@ -48,7 +48,7 @@
   void RemoveEventCallback(TypeId type, const EventCallback& cb);
 
  private:
-  typedef hash_map<TypeId, std::vector<EventCallback> > CallbackMap;
+  typedef base::hash_map<TypeId, std::vector<EventCallback> > CallbackMap;
   CallbackMap event_callbacks_;
   // Lock to protect access to the callback map.
   mutable base::Lock lock_;
diff --git a/cobalt/base/generated_resources_types.h b/cobalt/base/generated_resources_types.h
index 0597a12..9b807e5 100644
--- a/cobalt/base/generated_resources_types.h
+++ b/cobalt/base/generated_resources_types.h
@@ -16,12 +16,12 @@
 #define COBALT_BASE_GENERATED_RESOURCES_TYPES_H_
 
 #include <string>
+
 #include "base/containers/hash_tables.h"
 
 struct FileContents {
   FileContents() {}
-  FileContents(const unsigned char *data, int size)
-      : data(data), size(size) {}
+  FileContents(const unsigned char *data, int size) : data(data), size(size) {}
 
   const unsigned char *data;
   int size;
diff --git a/cobalt/base/localized_strings.cc b/cobalt/base/localized_strings.cc
index 3388ca7..48f88bd 100644
--- a/cobalt/base/localized_strings.cc
+++ b/cobalt/base/localized_strings.cc
@@ -16,7 +16,10 @@
 
 #include <algorithm>
 
+#include "base/files/file_path.h"
+#include "base/files/file_util.h"
 #include "base/logging.h"
+#include "base/optional.h"
 #include "starboard/common/file.h"
 #include "starboard/common/log.h"
 #include "starboard/system.h"
@@ -26,64 +29,19 @@
 
 namespace {
 
-std::string GetFilenameForLanguage(const std::string& language) {
+base::Optional<base::FilePath> GetFilenameForLanguage(
+    const std::string& language) {
   const int kBufferSize = 256;
   char buffer[kBufferSize];
   bool got_path =
       SbSystemGetPath(kSbSystemPathContentDirectory, buffer, kBufferSize);
   if (!got_path) {
     DLOG(ERROR) << "Cannot get content path for i18n files.";
-    return std::string();
+    return base::nullopt;
   }
 
-  return std::string(buffer).append("/i18n/").append(language).append(".csv");
-}
-
-bool ReadFile(const std::string& filename, std::string* out_result) {
-  DCHECK_GT(filename.length(), 0);
-  DCHECK(out_result);
-
-  starboard::ScopedFile file(filename.c_str(), kSbFileOpenOnly | kSbFileRead);
-  if (!file.IsValid()) {
-    DLOG(WARNING) << "Cannot open i18n file: " << filename;
-    return false;
-  }
-
-  SbFileInfo file_info = {0};
-  bool got_info = file.GetInfo(&file_info);
-  if (!got_info) {
-    DLOG(ERROR) << "Cannot get information for i18n file.";
-    return false;
-  }
-  DCHECK_GT(file_info.size, 0);
-
-  const int kMaxBufferSize = 16 * 1024;
-  if (file_info.size > kMaxBufferSize) {
-    DLOG(ERROR) << "i18n file exceeds maximum size: " << file_info.size << " ("
-                << kMaxBufferSize << ")";
-    return false;
-  }
-
-  char* buffer = new char[file_info.size];
-  DCHECK(buffer);
-  int64_t bytes_to_read = file_info.size;
-  char* buffer_pos = buffer;
-  while (bytes_to_read > 0) {
-    int max_bytes_to_read = static_cast<int>(
-        std::min(static_cast<int64_t>(kSbInt32Max), bytes_to_read));
-    int bytes_read = file.Read(buffer_pos, max_bytes_to_read);
-    if (bytes_read < 0) {
-      DLOG(ERROR) << "Read from i18n file failed.";
-      delete[] buffer;
-      return false;
-    }
-    bytes_to_read -= bytes_read;
-    buffer_pos += bytes_read;
-  }
-
-  *out_result = std::string(buffer, file_info.size);
-  delete[] buffer;
-  return true;
+  return base::FilePath(buffer).Append("i18n").Append(language).AddExtension(
+      "csv");
 }
 
 }  // namespace
@@ -123,9 +81,13 @@
 }
 
 bool LocalizedStrings::LoadStrings(const std::string& language) {
-  const std::string filename = GetFilenameForLanguage(language);
+  auto opt_file_path = GetFilenameForLanguage(language);
+  if (!opt_file_path) {
+    return false;
+  }
+  auto file_path = opt_file_path.value();
   std::string file_contents;
-  if (!ReadFile(filename, &file_contents)) {
+  if (!base::ReadFileToString(file_path, &file_contents)) {
     DLOG_ONCE(ERROR) << "Error reading i18n file.";
     return false;
   }
diff --git a/cobalt/base/log_message_handler.h b/cobalt/base/log_message_handler.h
index 798a067..fcfca06 100644
--- a/cobalt/base/log_message_handler.h
+++ b/cobalt/base/log_message_handler.h
@@ -66,7 +66,8 @@
  private:
   // Type for map of callbacks.
   typedef std::map<LogMessageHandler::CallbackId,
-                   LogMessageHandler::OnLogMessageCallback> CallbackMap;
+                   LogMessageHandler::OnLogMessageCallback>
+      CallbackMap;
 
   // This class should only be instanced by the base::Singleton.
   LogMessageHandler();
diff --git a/cobalt/base/message_queue.h b/cobalt/base/message_queue.h
index be36eea..34fd96a 100644
--- a/cobalt/base/message_queue.h
+++ b/cobalt/base/message_queue.h
@@ -16,6 +16,7 @@
 #define COBALT_BASE_MESSAGE_QUEUE_H_
 
 #include <queue>
+
 #include "base/callback.h"
 #include "base/logging.h"
 #include "base/synchronization/lock.h"
diff --git a/cobalt/base/path_provider.cc b/cobalt/base/path_provider.cc
index 6dfbbe7..c1a543d 100644
--- a/cobalt/base/path_provider.cc
+++ b/cobalt/base/path_provider.cc
@@ -12,10 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/base/path_provider.h"
 
+#include <memory>
+
 #include "base/files/file_path.h"
 #include "base/files/file_util.h"
 #include "base/logging.h"
diff --git a/cobalt/base/poller.h b/cobalt/base/poller.h
index 2a66ea5..aa3069a 100644
--- a/cobalt/base/poller.h
+++ b/cobalt/base/poller.h
@@ -60,9 +60,7 @@
     timer_->Start(FROM_HERE, period, user_task);
   }
 
-  void StopTimer() {
-    timer_.reset();
-  }
+  void StopTimer() { timer_.reset(); }
 
   base::MessageLoop* message_loop_;
   std::unique_ptr<RepeatingTimer<Poller> > timer_;
diff --git a/cobalt/base/starboard_stats_tracker.h b/cobalt/base/starboard_stats_tracker.h
new file mode 100644
index 0000000..aea4161
--- /dev/null
+++ b/cobalt/base/starboard_stats_tracker.h
@@ -0,0 +1,67 @@
+// Copyright 2023 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 COBALT_BASE_STARBOARD_STATS_TRACKER_H_
+#define COBALT_BASE_STARBOARD_STATS_TRACKER_H_
+
+#include "cobalt/base/c_val.h"
+#include "starboard/common/metrics/stats_tracker.h"
+
+class StarboardStatsTracker : public starboard::StatsTracker {
+ public:
+  StarboardStatsTracker()
+      : file_write_success_("Starboard.FileWrite.Success", 0,
+                            "SbFileWrite() success count from cobalt."),
+        file_write_fail_("Starboard.FileWrite.Fail", 0,
+                         "SbFileWrite() fail count from cobalt."),
+        file_write_bytes_written_("Starboard.FileWrite.BytesWritten", 0,
+                                  "SbFileWrite() bytes written from cobalt."),
+        storage_write_record_success_(
+            "Starboard.StorageWriteRecord.Success", 0,
+            "SbStorageWriteRecord() success count from cobalt."),
+        storage_write_record_fail_(
+            "Starboard.StorageWriteRecord.Fail", 0,
+            "SbStorageWriteRecord() fail count from cobalt."),
+        storage_write_record_bytes_written_(
+            "Starboard.StorageWriteRecord.BytesWritten", 0,
+            "SbStorageWriteRecord() bytes written from cobalt.") {}
+
+  void FileWriteSuccess() override { ++file_write_success_; }
+
+  void FileWriteFail() override { ++file_write_fail_; }
+
+  void FileWriteBytesWritten(int bytes_written) override {
+    file_write_bytes_written_ += bytes_written;
+  }
+
+  void StorageWriteRecordSuccess() override { ++storage_write_record_success_; }
+
+  void StorageWriteRecordFail() override { ++storage_write_record_fail_; }
+
+  void StorageWriteRecordBytesWritten(int bytes_written) override {
+    storage_write_record_bytes_written_ += bytes_written;
+  }
+
+ private:
+  base::CVal<int, base::CValPublic> file_write_success_;
+  base::CVal<int, base::CValPublic> file_write_fail_;
+  base::CVal<base::cval::SizeInBytes, base::CValPublic>
+      file_write_bytes_written_;
+  base::CVal<int, base::CValPublic> storage_write_record_success_;
+  base::CVal<int, base::CValPublic> storage_write_record_fail_;
+  base::CVal<base::cval::SizeInBytes, base::CValPublic>
+      storage_write_record_bytes_written_;
+};
+
+#endif  // COBALT_BASE_STARBOARD_STATS_TRACKER_H_
diff --git a/cobalt/base/token_test.cc b/cobalt/base/token_test.cc
index 4dcb597..2ba7a64 100644
--- a/cobalt/base/token_test.cc
+++ b/cobalt/base/token_test.cc
@@ -17,10 +17,9 @@
 #include <algorithm>
 #include <vector>
 
-#include "testing/gtest/include/gtest/gtest.h"
-
 #include "base/logging.h"
 #include "starboard/common/string.h"
+#include "testing/gtest/include/gtest/gtest.h"
 
 namespace base {
 namespace {
diff --git a/cobalt/base/unicode/character.cc b/cobalt/base/unicode/character.cc
index a5fb6ad..ac0736d 100644
--- a/cobalt/base/unicode/character.cc
+++ b/cobalt/base/unicode/character.cc
@@ -26,17 +26,17 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#include <algorithm>
-
 #include "cobalt/base/unicode/character.h"
 
+#include <algorithm>
+
 namespace base {
 namespace unicode {
 namespace {
 
 // Takes a flattened list of closed intervals
 template <class T, size_t size>
-bool ValueInIntervalList(const T(&intervalList)[size], const T& value) {
+bool ValueInIntervalList(const T (&intervalList)[size], const T& value) {
   const T* bound =
       std::upper_bound(&intervalList[0], &intervalList[size], value);
   if ((bound - intervalList) % 2 == 1) return true;
diff --git a/cobalt/base/unicode/character.h b/cobalt/base/unicode/character.h
index dae1b1b..bef9010 100644
--- a/cobalt/base/unicode/character.h
+++ b/cobalt/base/unicode/character.h
@@ -30,7 +30,6 @@
 #define COBALT_BASE_UNICODE_CHARACTER_H_
 
 #include "cobalt/base/unicode/character_values.h"
-
 #include "third_party/icu/source/common/unicode/uchar.h"
 
 namespace base {
diff --git a/cobalt/base/version_compatibility.cc b/cobalt/base/version_compatibility.cc
index 6b16d88..01149e3 100644
--- a/cobalt/base/version_compatibility.cc
+++ b/cobalt/base/version_compatibility.cc
@@ -12,8 +12,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#if defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
-
 #include "cobalt/base/version_compatibility.h"
 
 #include "base/logging.h"
@@ -49,5 +47,3 @@
 }
 
 }  // namespace base
-
-#endif  // defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
diff --git a/cobalt/base/version_compatibility.h b/cobalt/base/version_compatibility.h
index aa4898e..cb22e24 100644
--- a/cobalt/base/version_compatibility.h
+++ b/cobalt/base/version_compatibility.h
@@ -15,8 +15,6 @@
 #ifndef COBALT_BASE_VERSION_COMPATIBILITY_H_
 #define COBALT_BASE_VERSION_COMPATIBILITY_H_
 
-#if defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
-
 #include <string>
 
 #include "base/atomicops.h"
@@ -57,6 +55,4 @@
 
 }  // namespace base
 
-#endif  // defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
-
 #endif  // COBALT_BASE_VERSION_COMPATIBILITY_H_
diff --git a/cobalt/base/wrap_main_starboard.h b/cobalt/base/wrap_main_starboard.h
index db37f6c..e60b7fc 100644
--- a/cobalt/base/wrap_main_starboard.h
+++ b/cobalt/base/wrap_main_starboard.h
@@ -24,7 +24,7 @@
 #include "starboard/client_porting/wrap_main/wrap_main.h"
 #include "starboard/event.h"
 #include "starboard/system.h"
-#if SB_IS(EVERGREEN)
+#if SB_IS(MODULAR)
 #include "third_party/musl/src/starboard/internal/hwcap_impl.h"
 #endif
 
@@ -45,7 +45,7 @@
       DCHECK(!g_started);
       DCHECK(!g_at_exit);
       g_at_exit = new base::AtExitManager();
-#if SB_IS(EVERGREEN)
+#if SB_IS(MODULAR)
       init_musl_hwcap();
 #endif
       InitCobalt(data->argument_count, data->argument_values, data->link);
@@ -64,7 +64,7 @@
       if (!g_started) {
         DCHECK(!g_at_exit);
         g_at_exit = new base::AtExitManager();
-#if SB_IS(EVERGREEN)
+#if SB_IS(MODULAR)
         init_musl_hwcap();
 #endif
         InitCobalt(data->argument_count, data->argument_values, data->link);
diff --git a/cobalt/bindings/README.md b/cobalt/bindings/README.md
index 18269ee..09758eb 100644
--- a/cobalt/bindings/README.md
+++ b/cobalt/bindings/README.md
@@ -166,4 +166,3 @@
 Bindings test is tested in isolation via the bindings_test target.  Because bindings is the bridge from the JavaScript engine to the DOM, bindings test works by having an [entirely separate set of IDL](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/testing/testing.gyp?type=cs&sq=package:%5Ecobalt$&g=0#27) files that contain [minimal internal logic](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/testing/arbitrary_interface.h?q=arbitrary_interface&sq=package:%5Ecobalt$&dr=CSs#27), and are meant to [stress Web IDL features](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/testing/numeric_types_test_interface.idl?sq=package:%5Ecobalt$&dr=CSs&g=0).  This is accomplished by parameterizing what IDL files should get compiled at gyp time.  All other parts of the bindings build pipeline (such as the IDL compiler and jinja templates) are shared between bindings_test and cobalt entirely.  Note that bindings_test lives above the script/ interface, so no engine specific APIs can be used within the tests.
 
 Additionally, when it is convenient to implement a test entirely within JavaScript, certain script/ and bindings/ features are tested within layout_tests and web_platform_tests (see for example, [platform-object-user-properties-survive-gc.html](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/layout_tests/testdata/cobalt/platform-object-user-properties-survive-gc.html?type=cs&q=platform-object-user&sq=package:%5Ecobalt$&g=0#1)).  These serve as higher level, more end-to-end tests, that are good for testing more complex examples that also involve Cobalt's usage of script/.
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_indexed_getter_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_indexed_getter_interface.cc
index d9037d8..a075e78 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_indexed_getter_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_indexed_getter_interface.cc
@@ -213,7 +213,7 @@
                     [](v8::Isolate* isolate, AnonymousIndexedGetterInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->length(),
               &result_value);
@@ -368,5 +368,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_getter_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_getter_interface.cc
index b1eb1fc..889b4a2 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_getter_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_getter_interface.cc
@@ -376,5 +376,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_indexed_getter_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_indexed_getter_interface.cc
index 1507906..a134146 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_indexed_getter_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_indexed_getter_interface.cc
@@ -322,7 +322,7 @@
                     [](v8::Isolate* isolate, AnonymousNamedIndexedGetterInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->length(),
               &result_value);
@@ -489,5 +489,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_arbitrary_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_arbitrary_interface.cc
index 6ccd0b9..35c9c48 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_arbitrary_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_arbitrary_interface.cc
@@ -130,7 +130,7 @@
                     [](v8::Isolate* isolate, ArbitraryInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->arbitrary_property(),
               &result_value);
@@ -353,5 +353,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_base_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_base_interface.cc
index a529fc2..81542b8 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_base_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_base_interface.cc
@@ -130,7 +130,7 @@
                     [](v8::Isolate* isolate, BaseInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->base_attribute(),
               &result_value);
@@ -331,5 +331,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_boolean_type_test_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_boolean_type_test_interface.cc
index 260c18e..cc68c22 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_boolean_type_test_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_boolean_type_test_interface.cc
@@ -119,7 +119,7 @@
                     [](v8::Isolate* isolate, BooleanTypeTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->boolean_property(),
               &result_value);
@@ -419,5 +419,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_function_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_function_interface.cc
index 5c911dd..1e61da7 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_function_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_function_interface.cc
@@ -123,7 +123,7 @@
                     [](v8::Isolate* isolate, CallbackFunctionInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->callback_attribute(),
               &result_value);
@@ -164,7 +164,7 @@
                     [](v8::Isolate* isolate, CallbackFunctionInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->nullable_callback_attribute(),
               &result_value);
@@ -711,5 +711,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_interface_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_interface_interface.cc
index bd5f09b..592494b 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_interface_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_interface_interface.cc
@@ -123,7 +123,7 @@
                     [](v8::Isolate* isolate, CallbackInterfaceInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->callback_attribute(),
               &result_value);
@@ -417,5 +417,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_conditional_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_conditional_interface.cc
index 1135e4b..bd11e46 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_conditional_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_conditional_interface.cc
@@ -123,7 +123,7 @@
                     [](v8::Isolate* isolate, ConditionalInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->enabled_attribute(),
               &result_value);
@@ -166,7 +166,7 @@
                     [](v8::Isolate* isolate, ConditionalInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->disabled_attribute(),
               &result_value);
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constants_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constants_interface.cc
index d3515c4..574b47d 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constants_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constants_interface.cc
@@ -275,5 +275,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_interface.cc
index a582362..118ffaf 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_interface.cc
@@ -301,5 +301,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_with_arguments_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_with_arguments_interface.cc
index c30834e..9ac00e1 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_with_arguments_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_with_arguments_interface.cc
@@ -173,7 +173,7 @@
                     [](v8::Isolate* isolate, ConstructorWithArgumentsInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->long_arg(),
               &result_value);
@@ -193,7 +193,7 @@
                     [](v8::Isolate* isolate, ConstructorWithArgumentsInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->boolean_arg(),
               &result_value);
@@ -213,7 +213,7 @@
                     [](v8::Isolate* isolate, ConstructorWithArgumentsInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->string_arg(),
               &result_value);
@@ -398,5 +398,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_convert_simple_object_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_convert_simple_object_interface.cc
index 5452403..c874c9f 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_convert_simple_object_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_convert_simple_object_interface.cc
@@ -307,5 +307,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_dictionary.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_dictionary.cc
index 188d81e..6757463 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_dictionary.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_dictionary.cc
@@ -119,4 +119,3 @@
 }  // namespace v8c
 }  // namespace script
 }  // namespace cobalt
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_getter_setter_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_getter_setter_interface.cc
index 3177fef..2c090e0 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_getter_setter_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_getter_setter_interface.cc
@@ -326,7 +326,7 @@
                     [](v8::Isolate* isolate, DerivedGetterSetterInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->length(),
               &result_value);
@@ -346,7 +346,7 @@
                     [](v8::Isolate* isolate, DerivedGetterSetterInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->property_on_derived_class(),
               &result_value);
@@ -786,5 +786,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_interface.cc
index ccd7e97..8f3ecb7 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_interface.cc
@@ -134,7 +134,7 @@
                     [](v8::Isolate* isolate, DerivedInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->derived_attribute(),
               &result_value);
@@ -350,5 +350,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_interface.cc
index 23b7f5d..069c14e 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_interface.cc
@@ -125,7 +125,7 @@
                     [](v8::Isolate* isolate, DictionaryInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->dictionary_sequence(),
               &result_value);
@@ -507,5 +507,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_with_dictionary_member.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_with_dictionary_member.cc
index 0697e7c..7b8e190 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_with_dictionary_member.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_with_dictionary_member.cc
@@ -115,4 +115,3 @@
 }  // namespace v8c
 }  // namespace script
 }  // namespace cobalt
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_disabled_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_disabled_interface.cc
index 97d64d1..8f26a8e 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_disabled_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_disabled_interface.cc
@@ -122,7 +122,7 @@
                     [](v8::Isolate* isolate, DisabledInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->disabled_property(),
               &result_value);
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dom_string_test_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dom_string_test_interface.cc
index e82cf79..a309d07 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dom_string_test_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dom_string_test_interface.cc
@@ -119,7 +119,7 @@
                     [](v8::Isolate* isolate, DOMStringTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->property(),
               &result_value);
@@ -160,7 +160,7 @@
                     [](v8::Isolate* isolate, DOMStringTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->read_only_property(),
               &result_value);
@@ -180,7 +180,7 @@
                     [](v8::Isolate* isolate, DOMStringTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->read_only_token_property(),
               &result_value);
@@ -200,7 +200,7 @@
                     [](v8::Isolate* isolate, DOMStringTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->null_is_empty_property(),
               &result_value);
@@ -241,7 +241,7 @@
                     [](v8::Isolate* isolate, DOMStringTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->undefined_is_empty_property(),
               &result_value);
@@ -282,7 +282,7 @@
                     [](v8::Isolate* isolate, DOMStringTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->nullable_undefined_is_empty_property(),
               &result_value);
@@ -551,5 +551,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_enumeration_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_enumeration_interface.cc
index 3542e55..ae9edb3 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_enumeration_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_enumeration_interface.cc
@@ -132,7 +132,7 @@
                     [](v8::Isolate* isolate, EnumerationInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->enum_property(),
               &result_value);
@@ -372,5 +372,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exception_object_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exception_object_interface.cc
index a8d8540..b941dca 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exception_object_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exception_object_interface.cc
@@ -119,7 +119,7 @@
                     [](v8::Isolate* isolate, ExceptionObjectInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->error(),
               &result_value);
@@ -139,7 +139,7 @@
                     [](v8::Isolate* isolate, ExceptionObjectInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->message(),
               &result_value);
@@ -309,5 +309,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exceptions_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exceptions_interface.cc
index e5125d3..5f5678f 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exceptions_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exceptions_interface.cc
@@ -134,7 +134,7 @@
                     [](v8::Isolate* isolate, ExceptionsInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->attribute_throws_exception(&exception_state),
               &result_value);
@@ -357,5 +357,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_extended_idl_attributes_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_extended_idl_attributes_interface.cc
index 48697f1..3afdbd5 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_extended_idl_attributes_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_extended_idl_attributes_interface.cc
@@ -119,7 +119,7 @@
                     [](v8::Isolate* isolate, ExtendedIDLAttributesInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->attribute_default(),
               &result_value);
@@ -414,5 +414,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_garbage_collection_test_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_garbage_collection_test_interface.cc
index c63d041..61829bc 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_garbage_collection_test_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_garbage_collection_test_interface.cc
@@ -134,7 +134,7 @@
                     [](v8::Isolate* isolate, GarbageCollectionTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->previous(),
               &result_value);
@@ -175,7 +175,7 @@
                     [](v8::Isolate* isolate, GarbageCollectionTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->next(),
               &result_value);
@@ -363,5 +363,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_global_interface_parent.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_global_interface_parent.cc
index dff0c84..76c3add 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_global_interface_parent.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_global_interface_parent.cc
@@ -279,5 +279,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_indexed_getter_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_indexed_getter_interface.cc
index 7e698f2..0525832 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_indexed_getter_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_indexed_getter_interface.cc
@@ -238,7 +238,7 @@
                     [](v8::Isolate* isolate, IndexedGetterInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->length(),
               &result_value);
@@ -625,5 +625,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any.cc
index 48a1d90..37a00ff 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any.cc
@@ -369,5 +369,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any_dictionary.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any_dictionary.cc
index cc777e4..e110aad 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any_dictionary.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any_dictionary.cc
@@ -493,5 +493,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_date.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_date.cc
index 538aebf..6108ba4 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_date.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_date.cc
@@ -369,5 +369,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_unsupported_properties.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_unsupported_properties.cc
index 5ef3e17..5239cb2 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_unsupported_properties.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_unsupported_properties.cc
@@ -119,7 +119,7 @@
                     [](v8::Isolate* isolate, InterfaceWithUnsupportedProperties* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->supported_attribute(),
               &result_value);
@@ -263,5 +263,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_constructor_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_constructor_interface.cc
index 2ac0763..bdc73f5 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_constructor_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_constructor_interface.cc
@@ -235,5 +235,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_getter_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_getter_interface.cc
index 520508d..49ebda4 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_getter_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_getter_interface.cc
@@ -644,5 +644,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_indexed_getter_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_indexed_getter_interface.cc
index 3b5a5b1..b8d9bc0 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_indexed_getter_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_indexed_getter_interface.cc
@@ -322,7 +322,7 @@
                     [](v8::Isolate* isolate, NamedIndexedGetterInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->length(),
               &result_value);
@@ -342,7 +342,7 @@
                     [](v8::Isolate* isolate, NamedIndexedGetterInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->property_on_base_class(),
               &result_value);
@@ -927,5 +927,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nested_put_forwards_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nested_put_forwards_interface.cc
index ab6e99c..3ceaa79 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nested_put_forwards_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nested_put_forwards_interface.cc
@@ -123,7 +123,7 @@
                     [](v8::Isolate* isolate, NestedPutForwardsInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->nested_forwarding_attribute(),
               &result_value);
@@ -311,5 +311,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_constructor_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_constructor_interface.cc
index 788a7ab..ff5d80a 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_constructor_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_constructor_interface.cc
@@ -223,5 +223,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_interface_object_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_interface_object_interface.cc
index e18f1c4..dca8822 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_interface_object_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_interface_object_interface.cc
@@ -223,5 +223,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nullable_types_test_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nullable_types_test_interface.cc
index ee2eef4..c7dd532 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nullable_types_test_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nullable_types_test_interface.cc
@@ -125,7 +125,7 @@
                     [](v8::Isolate* isolate, NullableTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->nullable_boolean_property(),
               &result_value);
@@ -166,7 +166,7 @@
                     [](v8::Isolate* isolate, NullableTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->nullable_numeric_property(),
               &result_value);
@@ -207,7 +207,7 @@
                     [](v8::Isolate* isolate, NullableTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->nullable_string_property(),
               &result_value);
@@ -248,7 +248,7 @@
                     [](v8::Isolate* isolate, NullableTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->nullable_dictionary_property(),
               &result_value);
@@ -289,7 +289,7 @@
                     [](v8::Isolate* isolate, NullableTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->nullable_object_property(),
               &result_value);
@@ -1209,5 +1209,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_numeric_types_test_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_numeric_types_test_interface.cc
index 8e6fdb7..7dec2ca 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_numeric_types_test_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_numeric_types_test_interface.cc
@@ -119,7 +119,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->byte_property(),
               &result_value);
@@ -160,7 +160,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->byte_clamp_property(),
               &result_value);
@@ -201,7 +201,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->octet_property(),
               &result_value);
@@ -242,7 +242,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->octet_clamp_property(),
               &result_value);
@@ -283,7 +283,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->short_property(),
               &result_value);
@@ -324,7 +324,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->short_clamp_property(),
               &result_value);
@@ -365,7 +365,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->unsigned_short_property(),
               &result_value);
@@ -406,7 +406,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->unsigned_short_clamp_property(),
               &result_value);
@@ -447,7 +447,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->long_property(),
               &result_value);
@@ -488,7 +488,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->long_clamp_property(),
               &result_value);
@@ -529,7 +529,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->unsigned_long_property(),
               &result_value);
@@ -570,7 +570,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->unsigned_long_clamp_property(),
               &result_value);
@@ -611,7 +611,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->long_long_property(),
               &result_value);
@@ -652,7 +652,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->long_long_clamp_property(),
               &result_value);
@@ -693,7 +693,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->unsigned_long_long_property(),
               &result_value);
@@ -734,7 +734,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->unsigned_long_long_clamp_property(),
               &result_value);
@@ -775,7 +775,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->double_property(),
               &result_value);
@@ -816,7 +816,7 @@
                     [](v8::Isolate* isolate, NumericTypesTestInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->unrestricted_double_property(),
               &result_value);
@@ -2679,5 +2679,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_object_type_bindings_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_object_type_bindings_interface.cc
index 1295813..753d5bb 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_object_type_bindings_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_object_type_bindings_interface.cc
@@ -131,7 +131,7 @@
                     [](v8::Isolate* isolate, ObjectTypeBindingsInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->arbitrary_object(),
               &result_value);
@@ -172,7 +172,7 @@
                     [](v8::Isolate* isolate, ObjectTypeBindingsInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->base_interface(),
               &result_value);
@@ -192,7 +192,7 @@
                     [](v8::Isolate* isolate, ObjectTypeBindingsInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->derived_interface(),
               &result_value);
@@ -233,7 +233,7 @@
                     [](v8::Isolate* isolate, ObjectTypeBindingsInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->object_property(),
               &result_value);
@@ -461,5 +461,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_operations_test_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_operations_test_interface.cc
index 9d89426..e184220 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_operations_test_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_operations_test_interface.cc
@@ -1748,5 +1748,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_promise_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_promise_interface.cc
index 71e955f..e959090 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_promise_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_promise_interface.cc
@@ -527,5 +527,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_put_forwards_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_put_forwards_interface.cc
index 4d321ab..b4e4a15 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_put_forwards_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_put_forwards_interface.cc
@@ -123,7 +123,7 @@
                     [](v8::Isolate* isolate, PutForwardsInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->forwarding_attribute(),
               &result_value);
@@ -175,7 +175,7 @@
                     [](v8::Isolate* isolate, PutForwardsInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               PutForwardsInterface::static_forwarding_attribute(),
               &result_value);
@@ -373,5 +373,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_sequence_user.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_sequence_user.cc
index 77b171a..0182609 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_sequence_user.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_sequence_user.cc
@@ -1177,5 +1177,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_single_operation_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_single_operation_interface.cc
index 5cb91ed..dc84423 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_single_operation_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_single_operation_interface.cc
@@ -105,4 +105,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_static_properties_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_static_properties_interface.cc
index 79beed9..8cd2ad3 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_static_properties_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_static_properties_interface.cc
@@ -123,7 +123,7 @@
                     [](v8::Isolate* isolate, StaticPropertiesInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               StaticPropertiesInterface::static_attribute(),
               &result_value);
@@ -554,5 +554,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_anonymous_operation_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_anonymous_operation_interface.cc
index a35969c..4cae118 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_anonymous_operation_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_anonymous_operation_interface.cc
@@ -243,5 +243,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_attribute_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_attribute_interface.cc
index d0bbdc0..4a23d1d 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_attribute_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_attribute_interface.cc
@@ -119,7 +119,7 @@
                     [](v8::Isolate* isolate, StringifierAttributeInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->the_stringifier_attribute(),
               &result_value);
@@ -305,5 +305,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_operation_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_operation_interface.cc
index 2cfb54c..f644e4c 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_operation_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_operation_interface.cc
@@ -305,5 +305,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_target_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_target_interface.cc
index 9774c9c..a6b727b 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_target_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_target_interface.cc
@@ -335,5 +335,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_test_dictionary.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_test_dictionary.cc
index 8d035ae..917e74b 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_test_dictionary.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_test_dictionary.cc
@@ -423,4 +423,3 @@
 }  // namespace v8c
 }  // namespace script
 }  // namespace cobalt
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_union_types_interface.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_union_types_interface.cc
index a98e132..871031b 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_union_types_interface.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_union_types_interface.cc
@@ -131,7 +131,7 @@
                     [](v8::Isolate* isolate, UnionTypesInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->union_property(),
               &result_value);
@@ -172,7 +172,7 @@
                     [](v8::Isolate* isolate, UnionTypesInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->union_with_nullable_member_property(),
               &result_value);
@@ -213,7 +213,7 @@
                     [](v8::Isolate* isolate, UnionTypesInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->nullable_union_property(),
               &result_value);
@@ -254,7 +254,7 @@
                     [](v8::Isolate* isolate, UnionTypesInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->union_base_property(),
               &result_value);
@@ -295,7 +295,7 @@
                     [](v8::Isolate* isolate, UnionTypesInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->union_with_dictionary_property(),
               &result_value);
@@ -336,7 +336,7 @@
                     [](v8::Isolate* isolate, UnionTypesInterface* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->union_dicts_objects_property(),
               &result_value);
@@ -607,5 +607,3 @@
 }  // namespace testing
 }  // namespace bindings
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.cc b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.cc
index feb2cd0..75f15c2 100644
--- a/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.cc
+++ b/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.cc
@@ -331,7 +331,7 @@
                     [](v8::Isolate* isolate, Window* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->window_property(),
               &result_value);
@@ -372,7 +372,7 @@
                     [](v8::Isolate* isolate, Window* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->window(),
               &result_value);
@@ -392,7 +392,7 @@
                     [](v8::Isolate* isolate, Window* impl,
                        cobalt::script::ExceptionState& exception_state,
                        v8::Local<v8::Value>& result_value) {
-  
+
       ToJSValue(isolate,
               impl->on_event(),
               &result_value);
@@ -1091,5 +1091,3 @@
 
 }  // namespace script
 }  // namespace cobalt
-
-
diff --git a/cobalt/bindings/templates/dictionary.h.template b/cobalt/bindings/templates/dictionary.h.template
index d178bd6..416d522 100644
--- a/cobalt/bindings/templates/dictionary.h.template
+++ b/cobalt/bindings/templates/dictionary.h.template
@@ -47,6 +47,7 @@
 #include "cobalt/script/script_value.h"
 #include "cobalt/script/sequence.h"
 #include "cobalt/script/typed_arrays.h"
+#include "cobalt/script/union_type.h"
 #include "cobalt/script/value_handle.h"
 {% for include in includes %}
 #include "{{include}}"
diff --git a/cobalt/bindings/testing/any_bindings_test.cc b/cobalt/bindings/testing/any_bindings_test.cc
index ac6539f..951e428 100644
--- a/cobalt/bindings/testing/any_bindings_test.cc
+++ b/cobalt/bindings/testing/any_bindings_test.cc
@@ -13,7 +13,6 @@
 // limitations under the License.
 
 #include "base/logging.h"
-
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/interface_with_any.h"
 #include "testing/gmock/include/gmock/gmock.h"
diff --git a/cobalt/bindings/testing/any_dictionary_bindings_test.cc b/cobalt/bindings/testing/any_dictionary_bindings_test.cc
index 7082f6d..e9996df 100644
--- a/cobalt/bindings/testing/any_dictionary_bindings_test.cc
+++ b/cobalt/bindings/testing/any_dictionary_bindings_test.cc
@@ -13,7 +13,6 @@
 // limitations under the License.
 
 #include "base/logging.h"
-
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/interface_with_any_dictionary.h"
 #include "testing/gmock/include/gmock/gmock.h"
diff --git a/cobalt/bindings/testing/boolean_type_bindings_test.cc b/cobalt/bindings/testing/boolean_type_bindings_test.cc
index b518870..d095a1e 100644
--- a/cobalt/bindings/testing/boolean_type_bindings_test.cc
+++ b/cobalt/bindings/testing/boolean_type_bindings_test.cc
@@ -14,7 +14,6 @@
 
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/boolean_type_test_interface.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 using ::testing::InSequence;
diff --git a/cobalt/bindings/testing/callback_function_test.cc b/cobalt/bindings/testing/callback_function_test.cc
index 6a87b34..7f454bd 100644
--- a/cobalt/bindings/testing/callback_function_test.cc
+++ b/cobalt/bindings/testing/callback_function_test.cc
@@ -18,12 +18,12 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using ::testing::_;
 using ::testing::ContainsRegex;
-using ::testing::Invoke;
 using ::testing::InSequence;
+using ::testing::Invoke;
 using ::testing::Return;
 using ::testing::SaveArg;
-using ::testing::_;
 
 namespace cobalt {
 namespace bindings {
@@ -117,10 +117,10 @@
   FunctionOwner function_owner(&test_mock());
   EXPECT_CALL(test_mock(), TakesFunctionWithOneParameter(_))
       .WillOnce(Invoke(&function_owner, &FunctionOwner::TakeOwnership));
-  EXPECT_TRUE(EvaluateScript(
-      "test.takesFunctionWithOneParameter(function(value) { "
-      "callback_value = value });",
-      NULL));
+  EXPECT_TRUE(
+      EvaluateScript("test.takesFunctionWithOneParameter(function(value) { "
+                     "callback_value = value });",
+                     NULL));
   ASSERT_TRUE(function_owner.IsSet());
 
   // Run the callback, and check that the value was passed through to script.
@@ -142,11 +142,11 @@
   FunctionOwner function_owner(&test_mock());
   EXPECT_CALL(test_mock(), TakesFunctionWithSeveralParameters(_))
       .WillOnce(Invoke(&function_owner, &FunctionOwner::TakeOwnership));
-  EXPECT_TRUE(EvaluateScript(
-      "test.takesFunctionWithSeveralParameters("
-      "function(param1, param2, param3) { "
-      "value1 = param1; value2 = param2; value3 = param3; });",
-      NULL));
+  EXPECT_TRUE(
+      EvaluateScript("test.takesFunctionWithSeveralParameters("
+                     "function(param1, param2, param3) { "
+                     "value1 = param1; value2 = param2; value3 = param3; });",
+                     NULL));
   ASSERT_TRUE(function_owner.IsSet());
 
   // Execute the callback
@@ -180,11 +180,11 @@
   FunctionOwner function_owner(&test_mock());
   EXPECT_CALL(test_mock(), TakesFunctionWithNullableParameters(_))
       .WillOnce(Invoke(&function_owner, &FunctionOwner::TakeOwnership));
-  EXPECT_TRUE(EvaluateScript(
-      "test.takesFunctionWithNullableParameters("
-      "function(param1, param2, param3) { "
-      "value1 = param1; value2 = param2; value3 = param3; });",
-      NULL));
+  EXPECT_TRUE(
+      EvaluateScript("test.takesFunctionWithNullableParameters("
+                     "function(param1, param2, param3) { "
+                     "value1 = param1; value2 = param2; value3 = param3; });",
+                     NULL));
   ASSERT_TRUE(function_owner.IsSet());
 
   // Execute the callback
diff --git a/cobalt/bindings/testing/callback_interface_test.cc b/cobalt/bindings/testing/callback_interface_test.cc
index 6131d45..b3a43bc 100644
--- a/cobalt/bindings/testing/callback_interface_test.cc
+++ b/cobalt/bindings/testing/callback_interface_test.cc
@@ -20,10 +20,10 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using ::testing::_;
 using ::testing::ContainsRegex;
 using ::testing::Invoke;
 using ::testing::Return;
-using ::testing::_;
 
 namespace cobalt {
 namespace bindings {
diff --git a/cobalt/bindings/testing/conditional_attribute_test.cc b/cobalt/bindings/testing/conditional_attribute_test.cc
index f124a35..8cb1325 100644
--- a/cobalt/bindings/testing/conditional_attribute_test.cc
+++ b/cobalt/bindings/testing/conditional_attribute_test.cc
@@ -14,7 +14,6 @@
 
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/conditional_interface.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 using ::testing::Return;
diff --git a/cobalt/bindings/testing/constructor_bindings_test.cc b/cobalt/bindings/testing/constructor_bindings_test.cc
index 4d88d85..23296e4 100644
--- a/cobalt/bindings/testing/constructor_bindings_test.cc
+++ b/cobalt/bindings/testing/constructor_bindings_test.cc
@@ -96,10 +96,10 @@
 
 TEST_F(ConstructorBindingsTest, NamedConstructorHasCorrectPrototype) {
   std::string result;
-  EXPECT_TRUE(EvaluateScript(
-      "Object.getPrototypeOf(SomeNamedConstructor) === "
-      "Object.getPrototypeOf(NamedConstructorInterface);",
-      &result));
+  EXPECT_TRUE(
+      EvaluateScript("Object.getPrototypeOf(SomeNamedConstructor) === "
+                     "Object.getPrototypeOf(NamedConstructorInterface);",
+                     &result));
   EXPECT_STREQ("true", result.c_str());
 }
 
diff --git a/cobalt/bindings/testing/date_bindings_test.cc b/cobalt/bindings/testing/date_bindings_test.cc
index bb58362..9b4c420 100644
--- a/cobalt/bindings/testing/date_bindings_test.cc
+++ b/cobalt/bindings/testing/date_bindings_test.cc
@@ -13,7 +13,6 @@
 // limitations under the License.
 
 #include "base/logging.h"
-
 #include "base/time/time.h"
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/interface_with_date.h"
diff --git a/cobalt/bindings/testing/dependent_interface_test.cc b/cobalt/bindings/testing/dependent_interface_test.cc
index 0bc3f4a..524a2da 100644
--- a/cobalt/bindings/testing/dependent_interface_test.cc
+++ b/cobalt/bindings/testing/dependent_interface_test.cc
@@ -14,7 +14,6 @@
 
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/target_interface.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 using ::testing::Return;
diff --git a/cobalt/bindings/testing/dom_string_bindings_test.cc b/cobalt/bindings/testing/dom_string_bindings_test.cc
index c66bd43..015cda0 100644
--- a/cobalt/bindings/testing/dom_string_bindings_test.cc
+++ b/cobalt/bindings/testing/dom_string_bindings_test.cc
@@ -14,7 +14,6 @@
 
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/dom_string_test_interface.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 using ::testing::Return;
diff --git a/cobalt/bindings/testing/enumeration_bindings_test.cc b/cobalt/bindings/testing/enumeration_bindings_test.cc
index 01acc6a..c985c6d 100644
--- a/cobalt/bindings/testing/enumeration_bindings_test.cc
+++ b/cobalt/bindings/testing/enumeration_bindings_test.cc
@@ -65,10 +65,11 @@
   InSequence dummy;
 
   std::string result;
-  EXPECT_TRUE(EvaluateScript(
-      "var caught_exception = null; "
-      "try { test.enumProperty = \"invalid\"; } "
-      "catch (e) { caught_exception = e }", NULL));
+  EXPECT_TRUE(
+      EvaluateScript("var caught_exception = null; "
+                     "try { test.enumProperty = \"invalid\"; } "
+                     "catch (e) { caught_exception = e }",
+                     NULL));
   EXPECT_TRUE(
       EvaluateScript("caught_exception.constructor === TypeError;", &result));
   EXPECT_STREQ("true", result.c_str());
diff --git a/cobalt/bindings/testing/exceptions_bindings_test.cc b/cobalt/bindings/testing/exceptions_bindings_test.cc
index 44ba808..6b95bfc 100644
--- a/cobalt/bindings/testing/exceptions_bindings_test.cc
+++ b/cobalt/bindings/testing/exceptions_bindings_test.cc
@@ -22,8 +22,8 @@
 using ::testing::DoAll;
 using ::testing::InSequence;
 using ::testing::Invoke;
-using ::testing::Return;
 using ::testing::NiceMock;
+using ::testing::Return;
 using ::testing::WithArg;
 
 #define EXPECT_SUBSTRING(needle, haystack) \
@@ -75,8 +75,9 @@
 
 TEST_F(ExceptionsBindingsTest, ThrowExceptionFromOperation) {
   SimpleExceptionSetter exception_setter(script::kSimpleTypeError);
-  EXPECT_CALL(test_mock(), FunctionThrowsException(_)).WillOnce(
-      Invoke(&exception_setter, &SimpleExceptionSetter::FireException));
+  EXPECT_CALL(test_mock(), FunctionThrowsException(_))
+      .WillOnce(
+          Invoke(&exception_setter, &SimpleExceptionSetter::FireException));
 
   std::string result;
   EXPECT_FALSE(EvaluateScript("test.functionThrowsException();", &result));
@@ -85,9 +86,10 @@
 
 TEST_F(ExceptionsBindingsTest, ThrowExceptionFromGetter) {
   SimpleExceptionSetter exception_setter(script::kSimpleRangeError);
-  EXPECT_CALL(test_mock(), attribute_throws_exception(_)).WillOnce(
-      DoAll(Invoke(&exception_setter, &SimpleExceptionSetter::FireException),
-            Return(false)));
+  EXPECT_CALL(test_mock(), attribute_throws_exception(_))
+      .WillOnce(DoAll(
+          Invoke(&exception_setter, &SimpleExceptionSetter::FireException),
+          Return(false)));
 
   std::string result;
   EXPECT_FALSE(
@@ -113,13 +115,14 @@
   ExceptionObjectSetter exception_setter(exception_object);
 
   InSequence in_sequence_dummy;
-  EXPECT_CALL(test_mock(), FunctionThrowsException(_)).WillOnce(
-      Invoke(&exception_setter, &ExceptionObjectSetter::FireException));
-  EXPECT_TRUE(EvaluateScript(
-      "var error = null;"
-      "try { test.functionThrowsException(); }"
-      "catch(e) { error = e; }",
-      NULL));
+  EXPECT_CALL(test_mock(), FunctionThrowsException(_))
+      .WillOnce(
+          Invoke(&exception_setter, &ExceptionObjectSetter::FireException));
+  EXPECT_TRUE(
+      EvaluateScript("var error = null;"
+                     "try { test.functionThrowsException(); }"
+                     "catch(e) { error = e; }",
+                     NULL));
 
   std::string result;
   EXPECT_TRUE(EvaluateScript("error instanceof Error;", &result));
diff --git a/cobalt/bindings/testing/extended_attributes_test.cc b/cobalt/bindings/testing/extended_attributes_test.cc
index 883ee4f..66708e8 100644
--- a/cobalt/bindings/testing/extended_attributes_test.cc
+++ b/cobalt/bindings/testing/extended_attributes_test.cc
@@ -17,7 +17,6 @@
 #include "base/strings/stringprintf.h"
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/extended_idl_attributes_interface.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 using ::testing::Return;
diff --git a/cobalt/bindings/testing/get_own_property_descriptor.cc b/cobalt/bindings/testing/get_own_property_descriptor.cc
index 5945d36..8814534 100644
--- a/cobalt/bindings/testing/get_own_property_descriptor.cc
+++ b/cobalt/bindings/testing/get_own_property_descriptor.cc
@@ -14,7 +14,6 @@
 
 #include "cobalt/bindings/testing/arbitrary_interface.h"
 #include "cobalt/bindings/testing/bindings_test_base.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace cobalt {
diff --git a/cobalt/bindings/testing/getter_setter_test.cc b/cobalt/bindings/testing/getter_setter_test.cc
index 580aa49..182b59c 100644
--- a/cobalt/bindings/testing/getter_setter_test.cc
+++ b/cobalt/bindings/testing/getter_setter_test.cc
@@ -25,11 +25,11 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-using ::testing::Invoke;
+using ::testing::_;
 using ::testing::InSequence;
+using ::testing::Invoke;
 using ::testing::Return;
 using ::testing::ReturnArg;
-using ::testing::_;
 
 namespace cobalt {
 namespace bindings {
diff --git a/cobalt/bindings/testing/interface_object_test.cc b/cobalt/bindings/testing/interface_object_test.cc
index 80a9fbf..d422738 100644
--- a/cobalt/bindings/testing/interface_object_test.cc
+++ b/cobalt/bindings/testing/interface_object_test.cc
@@ -15,7 +15,6 @@
 #include "cobalt/bindings/testing/arbitrary_interface.h"
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/no_interface_object_interface.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 using ::testing::Return;
@@ -36,16 +35,16 @@
 // Interface object for non-callback interface is a global property.
 TEST_F(InterfaceObjectTest, InterfaceObjectIsGlobalProperty) {
   std::string result;
-  EXPECT_TRUE(EvaluateScript(
-      "this.hasOwnProperty(\"ArbitraryInterface\");", &result));
+  EXPECT_TRUE(
+      EvaluateScript("this.hasOwnProperty(\"ArbitraryInterface\");", &result));
   EXPECT_STREQ("true", result.c_str());
 }
 
 // Interface object for non-callback interface is a function object.
 TEST_F(InterfaceObjectTest, InterfaceObjectIsFunctionObject) {
   std::string result;
-  EXPECT_TRUE(EvaluateScript(
-      "ArbitraryInterface instanceof Function;", &result));
+  EXPECT_TRUE(
+      EvaluateScript("ArbitraryInterface instanceof Function;", &result));
   EXPECT_STREQ("true", result.c_str());
 }
 
@@ -58,8 +57,7 @@
   EXPECT_STREQ("true", result.c_str());
 
   EXPECT_TRUE(EvaluateScript(
-      "ArbitraryInterface.prototype == Object.getPrototypeOf(test);",
-      &result));
+      "ArbitraryInterface.prototype == Object.getPrototypeOf(test);", &result));
   EXPECT_STREQ("true", result.c_str());
 }
 
diff --git a/cobalt/bindings/testing/interface_with_any_dictionary.h b/cobalt/bindings/testing/interface_with_any_dictionary.h
index 11609a9..8748905 100644
--- a/cobalt/bindings/testing/interface_with_any_dictionary.h
+++ b/cobalt/bindings/testing/interface_with_any_dictionary.h
@@ -16,7 +16,6 @@
 #define COBALT_BINDINGS_TESTING_INTERFACE_WITH_ANY_DICTIONARY_H_
 
 #include "base/compiler_specific.h"
-
 #include "cobalt/bindings/testing/test_dictionary.h"
 #include "cobalt/script/script_value.h"
 #include "cobalt/script/value_handle.h"
diff --git a/cobalt/bindings/testing/numeric_type_bindings_test.cc b/cobalt/bindings/testing/numeric_type_bindings_test.cc
index 3906ebc..4cc347e 100644
--- a/cobalt/bindings/testing/numeric_type_bindings_test.cc
+++ b/cobalt/bindings/testing/numeric_type_bindings_test.cc
@@ -17,7 +17,6 @@
 #include "base/strings/stringprintf.h"
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/numeric_types_test_interface.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 using ::testing::Eq;
diff --git a/cobalt/bindings/testing/object_type_bindings_test.cc b/cobalt/bindings/testing/object_type_bindings_test.cc
index fce4047..3472fb7 100644
--- a/cobalt/bindings/testing/object_type_bindings_test.cc
+++ b/cobalt/bindings/testing/object_type_bindings_test.cc
@@ -120,10 +120,10 @@
   EXPECT_CALL(test_mock(), derived_interface());
 
   std::string result;
-  EXPECT_TRUE(EvaluateScript(
-      "Object.getPrototypeOf(test.derivedInterface) === "
-      "DerivedInterface.prototype;",
-      &result));
+  EXPECT_TRUE(
+      EvaluateScript("Object.getPrototypeOf(test.derivedInterface) === "
+                     "DerivedInterface.prototype;",
+                     &result));
   EXPECT_STREQ("true", result.c_str());
 }
 
diff --git a/cobalt/bindings/testing/operations_bindings_test.cc b/cobalt/bindings/testing/operations_bindings_test.cc
index c5f7b49..3f8c077 100644
--- a/cobalt/bindings/testing/operations_bindings_test.cc
+++ b/cobalt/bindings/testing/operations_bindings_test.cc
@@ -15,7 +15,6 @@
 #include "cobalt/bindings/testing/arbitrary_interface.h"
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/operations_test_interface.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 using ::testing::_;
@@ -144,11 +143,11 @@
 TEST_F(OperationsBindingsTest, OverloadedOperationInvalidNumberOfArguments) {
   InSequence in_sequence_dummy;
 
-  EXPECT_TRUE(EvaluateScript(
-      "var error = null;"
-      "try { test.overloadedFunction(1, 2); }"
-      "catch(e) { error = e; }",
-      NULL));
+  EXPECT_TRUE(
+      EvaluateScript("var error = null;"
+                     "try { test.overloadedFunction(1, 2); }"
+                     "catch(e) { error = e; }",
+                     NULL));
   std::string result;
   EXPECT_TRUE(EvaluateScript(
       "Object.getPrototypeOf(error) === TypeError.prototype;", &result));
diff --git a/cobalt/bindings/testing/optional_arguments_bindings_test.cc b/cobalt/bindings/testing/optional_arguments_bindings_test.cc
index cf86e73..0d11ee9 100644
--- a/cobalt/bindings/testing/optional_arguments_bindings_test.cc
+++ b/cobalt/bindings/testing/optional_arguments_bindings_test.cc
@@ -15,7 +15,6 @@
 #include "cobalt/bindings/testing/arbitrary_interface.h"
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/operations_test_interface.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 using ::testing::Return;
diff --git a/cobalt/bindings/testing/promise_test.cc b/cobalt/bindings/testing/promise_test.cc
index c85bc31..ea2bdf7 100644
--- a/cobalt/bindings/testing/promise_test.cc
+++ b/cobalt/bindings/testing/promise_test.cc
@@ -20,12 +20,12 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using ::testing::_;
 using ::testing::ContainsRegex;
-using ::testing::Invoke;
 using ::testing::InSequence;
+using ::testing::Invoke;
 using ::testing::Return;
 using ::testing::SaveArg;
-using ::testing::_;
 
 namespace cobalt {
 namespace bindings {
diff --git a/cobalt/bindings/testing/sequence_bindings_test.cc b/cobalt/bindings/testing/sequence_bindings_test.cc
index ac3737a..b5f2e2f 100644
--- a/cobalt/bindings/testing/sequence_bindings_test.cc
+++ b/cobalt/bindings/testing/sequence_bindings_test.cc
@@ -13,7 +13,6 @@
 // limitations under the License.
 
 #include "base/logging.h"
-
 #include "cobalt/bindings/testing/arbitrary_interface.h"
 #include "cobalt/bindings/testing/base_interface.h"
 #include "cobalt/bindings/testing/bindings_test_base.h"
diff --git a/cobalt/bindings/testing/static_properties_bindings_test.cc b/cobalt/bindings/testing/static_properties_bindings_test.cc
index 170aa9f..ab5137c 100644
--- a/cobalt/bindings/testing/static_properties_bindings_test.cc
+++ b/cobalt/bindings/testing/static_properties_bindings_test.cc
@@ -14,7 +14,6 @@
 
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/static_properties_interface.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 using ::testing::_;
@@ -79,7 +78,8 @@
 TEST_F(StaticPropertiesBindingsTest, GetStaticAttribute) {
   std::string result;
   EXPECT_CALL(StaticPropertiesInterface::static_methods_mock.Get(),
-              static_attribute()).WillOnce(Return("test_string"));
+              static_attribute())
+      .WillOnce(Return("test_string"));
   EXPECT_TRUE(
       EvaluateScript("StaticPropertiesInterface.staticAttribute;", &result));
   EXPECT_STREQ("test_string", result.c_str());
diff --git a/cobalt/bindings/testing/union_type_bindings_test.cc b/cobalt/bindings/testing/union_type_bindings_test.cc
index 01e4a76..060b722 100644
--- a/cobalt/bindings/testing/union_type_bindings_test.cc
+++ b/cobalt/bindings/testing/union_type_bindings_test.cc
@@ -14,14 +14,13 @@
 
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/union_types_interface.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
+using ::testing::_;
 using ::testing::ContainsRegex;
 using ::testing::InSequence;
 using ::testing::Return;
 using ::testing::SaveArg;
-using ::testing::_;
 
 namespace cobalt {
 namespace bindings {
@@ -35,8 +34,9 @@
   InSequence dummy;
 
   std::string result;
-  EXPECT_CALL(test_mock(), union_property()).WillOnce(
-      Return(UnionTypesInterface::UnionPropertyType(std::string("foo"))));
+  EXPECT_CALL(test_mock(), union_property())
+      .WillOnce(
+          Return(UnionTypesInterface::UnionPropertyType(std::string("foo"))));
   EXPECT_TRUE(
       EvaluateScript("typeof test.unionProperty == \"string\";", &result));
   EXPECT_STREQ("true", result.c_str());
@@ -44,10 +44,10 @@
   EXPECT_CALL(test_mock(), union_property())
       .WillOnce(Return(UnionTypesInterface::UnionPropertyType(
           base::WrapRefCounted(new ArbitraryInterface()))));
-  EXPECT_TRUE(EvaluateScript(
-      "Object.getPrototypeOf(test.unionProperty) === "
-      "ArbitraryInterface.prototype;",
-      &result));
+  EXPECT_TRUE(
+      EvaluateScript("Object.getPrototypeOf(test.unionProperty) === "
+                     "ArbitraryInterface.prototype;",
+                     &result));
   EXPECT_STREQ("true", result.c_str());
 
   EXPECT_CALL(test_mock(), union_property())
diff --git a/cobalt/bindings/testing/union_types_interface.h b/cobalt/bindings/testing/union_types_interface.h
index 39e9ff4..86c37c9 100644
--- a/cobalt/bindings/testing/union_types_interface.h
+++ b/cobalt/bindings/testing/union_types_interface.h
@@ -32,9 +32,9 @@
 class UnionTypesInterface : public script::Wrappable {
  public:
   typedef script::UnionType4<std::string, bool,
-                             scoped_refptr<ArbitraryInterface>,
-                             int32_t> UnionPropertyType;
-  typedef base::Optional<script::UnionType2<double, std::string> >
+                             scoped_refptr<ArbitraryInterface>, int32_t>
+      UnionPropertyType;
+  typedef base::Optional<script::UnionType2<double, std::string>>
       NullableUnionPropertyType;
   typedef script::UnionType2<scoped_refptr<BaseInterface>, std::string>
       UnionBasePropertyType;
@@ -45,19 +45,19 @@
       script::UnionType2<DerivedDictionary, scoped_refptr<ArbitraryInterface>>;
 
   MOCK_METHOD0(union_property, UnionPropertyType());
-  MOCK_METHOD1(set_union_property, void(const UnionPropertyType&));
+  MOCK_METHOD1(set_union_property, void(const UnionPropertyType &));
 
   MOCK_METHOD0(union_with_nullable_member_property,
                NullableUnionPropertyType());
   MOCK_METHOD1(set_union_with_nullable_member_property,
-               void(const NullableUnionPropertyType&));
+               void(const NullableUnionPropertyType &));
 
   MOCK_METHOD0(nullable_union_property, NullableUnionPropertyType());
   MOCK_METHOD1(set_nullable_union_property,
-               void(const NullableUnionPropertyType&));
+               void(const NullableUnionPropertyType &));
 
   MOCK_METHOD0(union_base_property, UnionBasePropertyType());
-  MOCK_METHOD1(set_union_base_property, void(const UnionBasePropertyType&));
+  MOCK_METHOD1(set_union_base_property, void(const UnionBasePropertyType &));
 
   MOCK_METHOD0(union_with_dictionary_property, UnionDictPropertyType());
   MOCK_METHOD1(set_union_with_dictionary_property,
diff --git a/cobalt/bindings/testing/variadic_arguments_bindings_test.cc b/cobalt/bindings/testing/variadic_arguments_bindings_test.cc
index ec140aa..ef45ab1 100644
--- a/cobalt/bindings/testing/variadic_arguments_bindings_test.cc
+++ b/cobalt/bindings/testing/variadic_arguments_bindings_test.cc
@@ -15,13 +15,12 @@
 #include "cobalt/bindings/testing/arbitrary_interface.h"
 #include "cobalt/bindings/testing/bindings_test_base.h"
 #include "cobalt/bindings/testing/operations_test_interface.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
+using ::testing::_;
 using ::testing::InSequence;
 using ::testing::Return;
 using ::testing::SaveArg;
-using ::testing::_;
 
 namespace cobalt {
 namespace bindings {
@@ -61,14 +60,16 @@
       "test.variadicStringArgumentsAfterOptionalArgument();", NULL));
 
   std::vector<std::string> string_args;
-  EXPECT_CALL(test_mock(), VariadicStringArgumentsAfterOptionalArgument(
-                               true, _)).WillOnce(SaveArg<1>(&string_args));
+  EXPECT_CALL(test_mock(),
+              VariadicStringArgumentsAfterOptionalArgument(true, _))
+      .WillOnce(SaveArg<1>(&string_args));
   EXPECT_TRUE(EvaluateScript(
       "test.variadicStringArgumentsAfterOptionalArgument(true);", NULL));
   EXPECT_EQ(0, string_args.size());
 
-  EXPECT_CALL(test_mock(), VariadicStringArgumentsAfterOptionalArgument(
-                               false, _)).WillOnce(SaveArg<1>(&string_args));
+  EXPECT_CALL(test_mock(),
+              VariadicStringArgumentsAfterOptionalArgument(false, _))
+      .WillOnce(SaveArg<1>(&string_args));
   EXPECT_TRUE(EvaluateScript(
       "test.variadicStringArgumentsAfterOptionalArgument(false, \"zero\", "
       "\"one\");",
diff --git a/cobalt/bindings/v8c/templates/macros.cc.template b/cobalt/bindings/v8c/templates/macros.cc.template
index ce11720..d7545c9 100644
--- a/cobalt/bindings/v8c/templates/macros.cc.template
+++ b/cobalt/bindings/v8c/templates/macros.cc.template
@@ -220,7 +220,7 @@
 {# If no variadic arguments have been set, we still call the function with
    signature that has the variadic argument and pass an empty vector. There is
    no such function signature that takes the optional parameter immediately
-   preceeding the variadic argument but does not take the variadic arguments. #}
+   preceding the variadic argument but does not take the variadic arguments. #}
 {% if loop.last or not operation.arguments[num_arguments].is_variadic %}
 {% set function_arguments =
       operation.arguments[0:num_arguments]|map(attribute='name')|list %}
diff --git a/cobalt/black_box_tests/README.md b/cobalt/black_box_tests/README.md
index 409390c..1ad41d0 100644
--- a/cobalt/black_box_tests/README.md
+++ b/cobalt/black_box_tests/README.md
@@ -15,37 +15,57 @@
   3. Re-fetch network requests after network shortage.
 
 
+## Adding a New Test
+
+  1. Add a python test script in tests/.
+     1.  The python script, at a minimum, needs to load your HTML (see step #2)
+         and call both `runner.WaitForJSTestsSetup()` and
+         `self.assertTrue(runner.JSTestsSucceeded())`. See one of the many python
+         scripts in this directory as an example.
+  2. Add target web page(s) and associated resources(if any) to testdata/.
+     1.  At a minimum, call `setupFinished()` and `onEndTest()` when the test is
+         ready to run and when it's completed running respectively. You'll need
+         to have loaded `<script src='black_box_js_test_utils.js'></script>` for
+         these utility methods to be available.
+  3. Add the test name (name of the python test script) to black_box_tests.py
+     to automate new test. Add the name to the list of tests requiring
+     app launcher support for system signals (e.g. suspend/resume), or the list
+     of tests requiring deep link support, or the list of tests that don't.
+
+
 ## Running Tests:
 
   1. To run all tests:
 
-     $ python path/to/black_box_tests.py --platform PLATFORM --config CONFIG
+     `$ python path/to/black_box_tests.py --platform PLATFORM --config CONFIG`
 
      e.g.
-     $ python path/to/black_box_tests.py --platform linux-x64x11 --config
-       devel
+     `$ python path/to/black_box_tests.py --platform linux-x64x11 --config
+       devel`
 
 
   2. To run an individual test:
 
-     $ python path/to/black_box_tests.py --platform PLATFORM --config CONFIG
-       --test_name TEST_NAME
+     `$ python path/to/black_box_tests.py --platform PLATFORM --config CONFIG
+       --test_name TEST_NAME`
 
      e.g.
-     $ python path/to/black_box_tests.py --platform linux-x64x11 --config devel
-       --test_name preload_font
+     `$ python path/to/black_box_tests.py --platform linux-x64x11 --config devel
+       --test_name preload_font`
 
-     You can apply --gtest_filter through --target_params, e.g.
-     $ python path/to/black_box_tests.py --platform linux-x64x11 --config devel
-       --test_name web_platform_tests
-       --target_params="--gtest_filter=fetch/*"
+     You can apply `--gtest_filter` through `--target_params`, e.g.
+     ```
+       $ python path/to/black_box_tests.py --platform linux-x64x11 --config devel
+         --test_name web_platform_tests
+         --target_params="--gtest_filter=fetch/*"
+     ```
 
      Note: When declaring a gtest_filter, it will override the filters defined
      in GetWebPlatformTestFilters in configuration.py.
 
   If you see a HTTPConnection error which eventually
   causes a TimeoutException for the test, you might want
-  to add "--server_binding_address localhost" in your
+  to add `--server_binding_address localhost` in your
   python command.
 
 ## Tests
@@ -59,17 +79,18 @@
 
 A wrapper around the app launcher. BlackBoxCobaltRunner includes a webdriver
 module attached to the app launcher's Cobalt instance after it starts running.
-Includes a method(JSTestsSucceeded()) to check test result on the JavaScript
+Includes a method(`JSTestsSucceeded()`) to check test result on the JavaScript
 side. Call this method to wait for JavaScript test result.
 black_box_js_test_utils.js provides some utility functions that are meant to
-work with runner.JSTestsSucceeded() in the python test scripts. Together,
+work with `runner.JSTestsSucceeded()` in the python test scripts. Together,
 they allow for test logic to exist in either the python test scripts or
 JavaScript test data.
-e.g. Call OnEndTest() to signal test completion on the JavaScript side,
-JSTestsSucceeded() will react to the signal and return the test status of
+
+Call `OnEndTest()` to signal test completion on the JavaScript side,
+`JSTestsSucceeded()` will react to the signal and return the test status of
 JavaScript test logic; another example is that when the python script wants to
-wait for some setup steps on JavaScript, call runner.WaitForJSTestsSetup().
-Calling setupFinished() in JavaScript whenever ready will unblock the wait.
+wait for some setup steps on JavaScript, call `runner.WaitForJSTestsSetup()`.
+Calling `setupFinished()` in JavaScript whenever ready will unblock the wait.
 
 
 ## Test Data
@@ -77,18 +98,10 @@
 A default local test server will be launched before any unit test starts to
 serve the test data in black_box_tests/testdata/. The server's port will be
 passed to the app launcher to fetch test data from.
+
 Test data can include the target web page for Cobalt to open and any additional
 resources (font file, JavaScripts...).
+
 Tests are free to start their own HTTP servers if the default test server is
 inadequate (e.g. The test is testing that Cobalt handles receipt of a specific
 HTTP server generated error code properly).
-
-
-## Adding a New Test
-
-  1. Add a python test script in tests/.
-  2. Add target web page(s) and associated resources(if any) to testdata/.
-  3. Add the test name(name of the python test script) to black_box_tests.py
-     to automate new test. Add the name to the list of tests requiring
-     app launcher support for system signals(e.g. suspend/resume), or the list
-     of tests requiring deep link support, or the list of tests that don't.
diff --git a/tools/lbshell/open_source_release/create_tarball.sh b/cobalt/black_box_tests/bbt_settings.py
old mode 100755
new mode 100644
similarity index 79%
rename from tools/lbshell/open_source_release/create_tarball.sh
rename to cobalt/black_box_tests/bbt_settings.py
index 79904b4..d6d67fd
--- a/tools/lbshell/open_source_release/create_tarball.sh
+++ b/cobalt/black_box_tests/bbt_settings.py
@@ -1,5 +1,3 @@
-#!/bin/bash
-#
 # Copyright 2023 The Cobalt Authors. All Rights Reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +11,7 @@
 # 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.
+"""Contains global settings for all tests"""
 
-CURRENT_DIR="$( dirname "${BASH_SOURCE[0]}" )"
-${CURRENT_DIR}/../../../internal/tools/lbshell/open_source_release/create_tarball.sh "$@"
+# Setting it to None instead of 0 exposes issues.
+default_web_server_port = None
diff --git a/cobalt/black_box_tests/black_box_cobalt_runner.py b/cobalt/black_box_tests/black_box_cobalt_runner.py
index 9e83f09..c3829c6 100644
--- a/cobalt/black_box_tests/black_box_cobalt_runner.py
+++ b/cobalt/black_box_tests/black_box_cobalt_runner.py
@@ -50,6 +50,7 @@
                target_params=None,
                success_message=None,
                poll_until_wait_seconds=POLL_UNTIL_WAIT_SECONDS,
+               web_server_port=None,
                **kwargs):
     # For black box tests, don't log inline script warnings, we intend to
     # explicitly control timings for suspends and resumes, so we are not
@@ -65,6 +66,7 @@
         target_params,
         success_message,
         poll_until_wait_seconds=poll_until_wait_seconds,
+        web_server_port=web_server_port,
         **kwargs)
 
     self.poll_until_wait_seconds = poll_until_wait_seconds
diff --git a/cobalt/black_box_tests/black_box_tests.py b/cobalt/black_box_tests/black_box_tests.py
index 99b11c4..3c6c44e 100755
--- a/cobalt/black_box_tests/black_box_tests.py
+++ b/cobalt/black_box_tests/black_box_tests.py
@@ -27,6 +27,7 @@
 import unittest
 
 from cobalt.black_box_tests import black_box_cobalt_runner
+from cobalt.black_box_tests import bbt_settings
 from cobalt.black_box_tests.proxy_server import ProxyServer
 from starboard.tools import abstract_launcher
 from starboard.tools import build
@@ -78,6 +79,7 @@
     'h5vcc_storage_write_verify_test',
     'http_cache',
     'persistent_cookie',
+    'scroll',
     'service_worker_add_to_cache_test',
     'service_worker_cache_keys_test',
     'service_worker_controller_activation_test',
@@ -89,6 +91,7 @@
     'service_worker_test',
     'service_worker_persist_test',
     'soft_mic_platform_service_test',
+    'telemetry_test',
     'text_encoding_test',
     'wasm_basic_test',
     'web_debugger',
@@ -108,7 +111,8 @@
 ]
 # These tests can only run on Evergreen-compatible platforms.
 _TESTS_EVERGREEN_END_TO_END = [
-    'evergreen_verify_qa_channel_update_test',
+    # Temporary disable test to publish new SB 16 changes b/149243810
+    #'evergreen_verify_qa_channel_update_test',
 ]
 # Location of test files.
 _TEST_DIR_PATH = 'cobalt.black_box_tests.tests.'
@@ -153,6 +157,7 @@
         launcher_params=_launcher_params,
         url=url,
         target_params=all_target_params,
+        web_server_port=bbt_settings.default_web_server_port,
         **kwargs)
 
   def GetBindingAddress(self):
@@ -243,6 +248,11 @@
     _wpt_http_port = args.wpt_http_port or str(
         self.GetUnusedPort([_server_binding_address]))
 
+    # Port used to set up tunneling between host and device for testdata server.
+    sock = socket.socket()
+    sock.bind(('', 0))
+    bbt_settings.default_web_server_port = sock.getsockname()[1]
+
     # Proxy is only needed for WPT
     self.use_proxy = args.test_set in ['all', 'wpt']
 
diff --git a/cobalt/black_box_tests/testdata/allow_eval.html b/cobalt/black_box_tests/testdata/allow_eval.html
index c7ad9e4..78f2714 100644
--- a/cobalt/black_box_tests/testdata/allow_eval.html
+++ b/cobalt/black_box_tests/testdata/allow_eval.html
@@ -22,4 +22,4 @@
     }
     onEndTest();
   </script>
-</body>
\ No newline at end of file
+</body>
diff --git a/cobalt/black_box_tests/testdata/black_box_js_test_utils.js b/cobalt/black_box_tests/testdata/black_box_js_test_utils.js
index e4dfc8a..ce5dde4 100644
--- a/cobalt/black_box_tests/testdata/black_box_js_test_utils.js
+++ b/cobalt/black_box_tests/testdata/black_box_js_test_utils.js
@@ -72,7 +72,7 @@
   }
 }
 
-function assertFalse(result) {
+function assertFalse(result, msg) {
   if (result) {
     const errorMessage = '\n' +
       'Black Box Test Assertion failed: \n' +
diff --git a/cobalt/black_box_tests/testdata/disable_eval_with_csp.html b/cobalt/black_box_tests/testdata/disable_eval_with_csp.html
index 447a3bd..349fd4d 100644
--- a/cobalt/black_box_tests/testdata/disable_eval_with_csp.html
+++ b/cobalt/black_box_tests/testdata/disable_eval_with_csp.html
@@ -18,4 +18,4 @@
     eval('1+3')
 
   </script>
-</body>
\ No newline at end of file
+</body>
diff --git a/cobalt/black_box_tests/testdata/persistent_cookie.html b/cobalt/black_box_tests/testdata/persistent_cookie.html
index d7e838f..e029f39 100644
--- a/cobalt/black_box_tests/testdata/persistent_cookie.html
+++ b/cobalt/black_box_tests/testdata/persistent_cookie.html
@@ -71,4 +71,4 @@
     }
     setupFinished();
   </script>
-</body>
\ No newline at end of file
+</body>
diff --git a/cobalt/black_box_tests/testdata/preload_font.html b/cobalt/black_box_tests/testdata/preload_font.html
index 180af0e..b7a17c3 100644
--- a/cobalt/black_box_tests/testdata/preload_font.html
+++ b/cobalt/black_box_tests/testdata/preload_font.html
@@ -44,4 +44,4 @@
     document.addEventListener("visibilitychange", handleVisibilityChange);
     setupFinished();
   </script>
-</body>
\ No newline at end of file
+</body>
diff --git a/cobalt/black_box_tests/testdata/preload_launch_parameter.html b/cobalt/black_box_tests/testdata/preload_launch_parameter.html
index 2576463..a040d79 100644
--- a/cobalt/black_box_tests/testdata/preload_launch_parameter.html
+++ b/cobalt/black_box_tests/testdata/preload_launch_parameter.html
@@ -32,4 +32,4 @@
 
     setupFinished();
   </script>
-</body>
\ No newline at end of file
+</body>
diff --git a/cobalt/black_box_tests/testdata/scroll.html b/cobalt/black_box_tests/testdata/scroll.html
new file mode 100644
index 0000000..d8adade
--- /dev/null
+++ b/cobalt/black_box_tests/testdata/scroll.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+
+<html>
+
+<head>
+  <title>Cobalt scroll test</title>
+  <script src='black_box_js_test_utils.js'></script>
+  <style>
+    .app {
+      position: absolute;
+      width: 80rem;
+      height: 45rem;
+      overflow: hidden;
+      padding: 20px;
+      z-index: 1;
+    }
+
+    .row {
+      /* pointer-events: auto; */
+      position: relative;
+      overflow: auto;
+      height: 20rem;
+      width: 80rem;
+    }
+
+    .tile {
+      position: absolute;
+      height: 10rem;
+      width: 200rem;
+      background: linear-gradient(0.25turn, #f4aca9, #ebf8e1, #bce6f3);
+    }
+  </style>
+</head>
+
+<body>
+  <div class="app" style="overflow:auto;">
+    <div id="row" class="row" style="height: 20rem;">
+      <div id="top_one" class="tile">One</div>
+    </div>
+  </div>
+</body>
+<script>
+  function checkEndState() {
+    const scroll_container = document.getElementById("row");
+    assertTrue(scroll_container.scrollLeft > 0);
+    onEndTest();
+  }
+
+  window.onload = () => {
+    setupFinished();
+  }
+
+  window.onkeydown = (event) => {
+    if (event.key == 0) {
+      checkEndState();
+    }
+  }
+</script>
+
+</html>
diff --git a/cobalt/black_box_tests/testdata/suspend_visibility.html b/cobalt/black_box_tests/testdata/suspend_visibility.html
index 092e817..6dbf5a0 100644
--- a/cobalt/black_box_tests/testdata/suspend_visibility.html
+++ b/cobalt/black_box_tests/testdata/suspend_visibility.html
@@ -74,4 +74,4 @@
     document.addEventListener("visibilitychange", handleVisibilityChange);
     setupFinished();
   </script>
-</body>
\ No newline at end of file
+</body>
diff --git a/cobalt/black_box_tests/testdata/telemetry_test.html b/cobalt/black_box_tests/testdata/telemetry_test.html
new file mode 100644
index 0000000..01ccf90
--- /dev/null
+++ b/cobalt/black_box_tests/testdata/telemetry_test.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<!--
+  Copyright 2023 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.
+-->
+
+<html>
+
+<head>
+    <title>Cobalt Telemetry Test</title>
+    <script src='black_box_js_test_utils.js'></script>
+</head>
+
+<body>
+    <script>
+        const metrics = window.h5vcc.metrics;
+        const EVENT_INTERVAL_SECS = 5;
+        let lastMetricType = '';
+        let lastPayload = '';
+        let payloadCount = 0;
+
+        function metricEventHandler(metricType, payload) {
+            lastMetricType = metricType;
+            lastPayload = payload;
+            payloadCount++;
+        }
+
+        function initTelemetry() {
+            metrics.enable();
+            metrics.setMetricEventInterval(EVENT_INTERVAL_SECS);
+            metrics.onMetricEvent(metricEventHandler);
+        }
+        window.onload = function () {
+            initTelemetry();
+
+            setupFinished();
+
+            setTimeout(() => {
+                assertTrue(metrics.isEnabled(), 'metrics should be enabled');
+                assertEqual('COBALT_UMA', lastMetricType, 'metricType should be uma');
+                assertTrue(lastPayload.length > 0, 'payload should be non-empty');
+                assertEqual(1, payloadCount, 'only one payload sent');
+            }, 4000);
+
+            setTimeout(() => {
+                assertEqual('COBALT_UMA', lastMetricType, 'metricType should be uma');
+                assertTrue(lastPayload.length > 0, 'payload should be non-empty');
+                assertEqual(2, payloadCount, 'two payloads sent');
+
+                metrics.disable();
+
+                setTimeout(() => {
+                    assertFalse(metrics.isEnabled(), 'should disable metrics');
+                    onEndTest();
+                }, 1000);
+            }, 11000);
+        }
+    </script>
+</body>
+
+</html>
diff --git a/cobalt/black_box_tests/testdata/timer_hit_after_preload.html b/cobalt/black_box_tests/testdata/timer_hit_after_preload.html
index facfcfb..cc2c20b 100644
--- a/cobalt/black_box_tests/testdata/timer_hit_after_preload.html
+++ b/cobalt/black_box_tests/testdata/timer_hit_after_preload.html
@@ -41,4 +41,4 @@
     NewElement.setAttribute('id', 'script_executed');
     document.appendChild(NewElement);
   </script>
-</body>
\ No newline at end of file
+</body>
diff --git a/cobalt/black_box_tests/testdata/timer_hit_in_preload.html b/cobalt/black_box_tests/testdata/timer_hit_in_preload.html
index a8b8510..5048f7b 100644
--- a/cobalt/black_box_tests/testdata/timer_hit_in_preload.html
+++ b/cobalt/black_box_tests/testdata/timer_hit_in_preload.html
@@ -37,4 +37,4 @@
       verifyAllMethods();
     }, 1500);
   </script>
-</body>
\ No newline at end of file
+</body>
diff --git a/cobalt/black_box_tests/tests/preload_font.py b/cobalt/black_box_tests/tests/preload_font.py
index b43a00a..6b09bf5 100644
--- a/cobalt/black_box_tests/tests/preload_font.py
+++ b/cobalt/black_box_tests/tests/preload_font.py
@@ -40,8 +40,9 @@
         start_time = time.time()
         while runner.IsInPreload():
           if time.time() - start_time > _MAX_RESUME_WAIT_SECONDS:
-            raise Exception('Cobalt can not exit preload mode after receiving'
-                            'resume signal')
+            raise RuntimeError(
+                'Cobalt can not exit preload mode after receiving'
+                'resume signal')
           time.sleep(.1)
         # At this point, Cobalt is in started mode.
         self.assertTrue(runner.JSTestsSucceeded())
diff --git a/cobalt/black_box_tests/tests/scroll.py b/cobalt/black_box_tests/tests/scroll.py
new file mode 100644
index 0000000..e0db0fd
--- /dev/null
+++ b/cobalt/black_box_tests/tests/scroll.py
@@ -0,0 +1,64 @@
+# Copyright 2023 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.
+"""Tests for scroll containers."""
+
+import logging
+import traceback
+
+from cobalt.black_box_tests import black_box_tests
+from cobalt.black_box_tests.threaded_web_server import ThreadedWebServer
+from selenium.webdriver.common.action_chains import ActionChains
+from selenium.webdriver.common import keys
+
+# Time to sleep after a mouse move to give the device time to process it and
+# to avoid collapsing with subsequent move events.
+_SLEEP_AFTER_MOVE_TIME = 0.5
+
+
+def find_element_by_id(runner, id_selector):
+  return runner.webdriver.find_elements_by_css_selector('#' + id_selector)[0]
+
+
+class PointerTest(black_box_tests.BlackBoxTestCase):
+  """Tests pointer and mouse event."""
+
+  def test_pointer_events(self):
+    try:
+      with ThreadedWebServer(
+          binding_address=self.GetBindingAddress()) as server:
+        url = server.GetURL(file_name='testdata/scroll.html')
+
+        with self.CreateCobaltRunner(url=url) as runner:
+          logging.info('JS Test Setup WaitForJSTestsSetup')
+          runner.WaitForJSTestsSetup()
+          logging.info('JS Test Setup')
+          self.assertTrue(runner.webdriver)
+
+          row = find_element_by_id(runner, 'row')
+
+          # Perform mouse actions with ActionChains.
+          #   https://www.selenium.dev/selenium/docs/api/py/webdriver/selenium.webdriver.common.action_chains.html#module-selenium.webdriver.common.action_chains  # pylint: disable=line-too-long
+          actions = ActionChains(runner.webdriver)
+          actions.click_and_hold(row).pause(_SLEEP_AFTER_MOVE_TIME)
+          actions.move_by_offset(-100, 0)
+          actions.release()
+          actions.perform()
+          runner.SendKeys(keys.Keys.NUMPAD0)
+          self.assertTrue(runner.JSTestsSucceeded())
+    except:  # pylint: disable=bare-except
+      traceback.print_exc()
+      # Consider an exception being thrown as a test failure.
+      self.fail('Test failure')
+    finally:
+      logging.info('Cleaning up.')
diff --git a/cobalt/black_box_tests/tests/telemetry_test.py b/cobalt/black_box_tests/tests/telemetry_test.py
new file mode 100644
index 0000000..dbb937b
--- /dev/null
+++ b/cobalt/black_box_tests/tests/telemetry_test.py
@@ -0,0 +1,34 @@
+# Copyright 2023 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.
+"""Tests Cobalt Telemetry functionality."""
+
+from cobalt.black_box_tests import black_box_tests
+from cobalt.black_box_tests.threaded_web_server import ThreadedWebServer
+
+
+class TelemetryTest(black_box_tests.BlackBoxTestCase):
+  """Test Cobalt Telemetry functionality."""
+
+  def test_telemetry(self):
+
+    with ThreadedWebServer(binding_address=self.GetBindingAddress()) as server:
+      url = server.GetURL(file_name='testdata/telemetry_test.html')
+
+      # target_params to pass args to cobalt
+      with self.CreateCobaltRunner(
+          url=url,
+          poll_until_wait_seconds=70,
+          target_params=['--initial-metrics-upload-interval=0']) as runner:
+        runner.WaitForJSTestsSetup()
+        self.assertTrue(runner.JSTestsSucceeded())
diff --git a/cobalt/black_box_tests/threaded_web_server.py b/cobalt/black_box_tests/threaded_web_server.py
index d305ea3..040dcac 100644
--- a/cobalt/black_box_tests/threaded_web_server.py
+++ b/cobalt/black_box_tests/threaded_web_server.py
@@ -19,11 +19,12 @@
 
 import logging
 import os
-from six.moves import SimpleHTTPServer
-from six.moves import socketserver
 import socket
 import threading
 
+from six.moves import SimpleHTTPServer
+from six.moves import socketserver
+
 
 class _ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
   pass
@@ -67,7 +68,6 @@
     base_path: A path considered to be the root directory.
     paths_to_headers: A dictionary with keys partial paths and values of header
     dicts. Key is expected to be a substring of a file being served.
-
     E.g. if you have a test with files foo.html and foo.js, you can serve them
     separate headers with the following:
     paths_to_headers = {
@@ -154,7 +154,10 @@
     if not binding_address:
       # No specific binding address specified. Bind to any interfaces instead.
       binding_address = '0.0.0.0'
-    self._server = _ThreadedTCPServer((binding_address, 0), handler)
+    # pylint: disable=import-outside-toplevel
+    from cobalt.black_box_tests.bbt_settings import default_web_server_port
+    binding_port = default_web_server_port
+    self._server = _ThreadedTCPServer((binding_address, binding_port), handler)
 
     self._server_thread = None
 
@@ -164,6 +167,9 @@
       # When listening to any interfaces, get the IPv4 address of the hostname.
       self._bound_host = socket.gethostbyname(socket.gethostname())
 
+  def GetPort(self):
+    return self._bound_port
+
   def GetURL(self, file_name):
     """Given a |file_name|, return a HTTP URI that can be fetched.
 
diff --git a/cobalt/black_box_tests/web_platform_test_server.py b/cobalt/black_box_tests/web_platform_test_server.py
index 50ebda8..4d5d38a 100644
--- a/cobalt/black_box_tests/web_platform_test_server.py
+++ b/cobalt/black_box_tests/web_platform_test_server.py
@@ -73,7 +73,7 @@
     self._server_thread = threading.Thread(target=self.main)
     self._server_thread.start()
     while not self._server_started:
-      time.sleep(.1)
+      time.sleep(0.1)
     return self
 
   def __exit__(self, exc_type, exc_value, traceback):
diff --git a/cobalt/browser/BUILD.gn b/cobalt/browser/BUILD.gn
index 5b015e8..97ac9fa 100644
--- a/cobalt/browser/BUILD.gn
+++ b/cobalt/browser/BUILD.gn
@@ -58,7 +58,6 @@
     "//net",
   ]
   data_deps = [
-    "//cobalt/dom:licenses",
     "//cobalt/network:copy_ssl_certificates",
     "//third_party/icu:icudata",
   ]
@@ -157,7 +156,6 @@
     "//cobalt/audio",
     "//cobalt/base",
     "//cobalt/browser/memory_settings:browser_memory_settings",
-    "//cobalt/browser/memory_tracker:memory_tracker_tool",
     "//cobalt/browser/metrics",
     "//cobalt/build:cobalt_build_id",
     "//cobalt/build:cobalt_build_info",
@@ -200,9 +198,9 @@
     "//components/metrics",
     "//components/metrics_services_manager",
     "//crypto",
-    "//nb",
     "//net",
     "//starboard",
+    "//starboard/common",
     "//third_party/icu:icui18n",
     "//third_party/protobuf:protobuf_lite",
     "//url",
@@ -245,8 +243,6 @@
     "memory_settings/pretty_print_test.cc",
     "memory_settings/table_printer_test.cc",
     "memory_settings/test_common.h",
-    "memory_tracker/tool/tool_impl_test.cc",
-    "memory_tracker/tool/util_test.cc",
     "user_agent_string_test.cc",
   ]
 
@@ -255,7 +251,6 @@
     ":browser_switches",
     "//cobalt/base",
     "//cobalt/browser/memory_settings:browser_memory_settings",
-    "//cobalt/browser/memory_tracker:memory_tracker_tool",
     "//cobalt/dom",
     "//cobalt/loader",
     "//cobalt/math",
@@ -263,7 +258,6 @@
     "//cobalt/speech",
     "//cobalt/storage",
     "//cobalt/test:run_all_unittests",
-    "//nb",
     "//testing/gmock",
     "//testing/gtest",
   ]
diff --git a/cobalt/browser/application.cc b/cobalt/browser/application.cc
index 69a52c0..e05b7d0 100644
--- a/cobalt/browser/application.cc
+++ b/cobalt/browser/application.cc
@@ -49,17 +49,15 @@
 #include "cobalt/base/on_screen_keyboard_hidden_event.h"
 #include "cobalt/base/on_screen_keyboard_shown_event.h"
 #include "cobalt/base/on_screen_keyboard_suggestions_updated_event.h"
+#include "cobalt/base/starboard_stats_tracker.h"
 #include "cobalt/base/startup_timer.h"
-#if defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
 #include "cobalt/base/version_compatibility.h"
-#endif  // defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
 #include "cobalt/base/window_on_offline_event.h"
 #include "cobalt/base/window_on_online_event.h"
 #include "cobalt/base/window_size_changed_event.h"
 #include "cobalt/browser/client_hint_headers.h"
 #include "cobalt/browser/device_authentication.h"
 #include "cobalt/browser/memory_settings/auto_mem_settings.h"
-#include "cobalt/browser/memory_tracker/tool.h"
 #include "cobalt/browser/metrics/cobalt_metrics_services_manager.h"
 #include "cobalt/browser/switches.h"
 #include "cobalt/browser/user_agent_platform_info.h"
@@ -78,6 +76,7 @@
 #include "cobalt/watchdog/watchdog.h"
 #include "components/metrics/metrics_service.h"
 #include "starboard/common/device_type.h"
+#include "starboard/common/metrics/stats_tracker.h"
 #include "starboard/common/system_property.h"
 #include "starboard/configuration.h"
 #include "starboard/event.h"
@@ -528,14 +527,6 @@
 base::LazyInstance<NonTrivialStaticFields>::DestructorAtExit
     non_trivial_static_fields = LAZY_INSTANCE_INITIALIZER;
 
-#if defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-const char kMemoryTrackerCommand[] = "memory_tracker";
-const char kMemoryTrackerCommandShortHelp[] = "Create a memory tracker.";
-const char kMemoryTrackerCommandLongHelp[] =
-    "Create a memory tracker of the given type. Use an empty string to see the "
-    "available trackers.";
-#endif  // defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-
 void AddCrashHandlerAnnotations(const UserAgentPlatformInfo& platform_info) {
   auto crash_handler_extension =
       static_cast<const CobaltExtensionCrashHandlerApi*>(
@@ -631,17 +622,7 @@
 
 Application::Application(const base::Closure& quit_closure, bool should_preload,
                          SbTimeMonotonic timestamp)
-    : message_loop_(base::MessageLoop::current()),
-      quit_closure_(quit_closure)
-#if defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-      ,
-      ALLOW_THIS_IN_INITIALIZER_LIST(memory_tracker_command_handler_(
-          kMemoryTrackerCommand,
-          base::Bind(&Application::OnMemoryTrackerCommand,
-                     base::Unretained(this)),
-          kMemoryTrackerCommandShortHelp, kMemoryTrackerCommandLongHelp))
-#endif  // defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-{
+    : message_loop_(base::MessageLoop::current()), quit_closure_(quit_closure) {
   DCHECK(!quit_closure_.is_null());
   if (should_preload) {
     preload_timestamp_ = timestamp;
@@ -693,6 +674,9 @@
   // URLRequestContext;
   base::TaskScheduler::CreateAndStartWithDefaultParams("Cobalt TaskScheduler");
 
+  starboard::StatsTrackerContainer::GetInstance()->set_stats_tracker(
+      std::make_unique<StarboardStatsTracker>());
+
   // Initializes persistent settings.
   persistent_settings_ =
       std::make_unique<persistent_storage::PersistentSettings>(
@@ -768,7 +752,6 @@
 
 #endif  // defined(ENABLE_DEBUG_COMMAND_LINE_SWITCHES)
 
-#if defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
   constexpr int kDefaultMinCompatibilityVersion = 1;
   int minimum_version = kDefaultMinCompatibilityVersion;
 #if defined(ENABLE_DEBUG_COMMAND_LINE_SWITCHES)
@@ -781,7 +764,6 @@
   }
 #endif  // defined(ENABLE_DEBUG_COMMAND_LINE_SWITCHES)
   base::VersionCompatibility::GetInstance()->SetMinimumVersion(minimum_version);
-#endif  // defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
 
   base::Optional<std::string> partition_key;
   if (command_line->HasSwitch(browser::switches::kLocalStoragePartitionUrl)) {
@@ -860,14 +842,6 @@
 
   EnableUsingStubImageDecoderIfRequired();
 
-#if defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-  if (command_line->HasSwitch(switches::kMemoryTracker)) {
-    std::string command_arg =
-        command_line->GetSwitchValueASCII(switches::kMemoryTracker);
-    memory_tracker_tool_ = memory_tracker::CreateMemoryTrackerTool(command_arg);
-  }
-#endif  // defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-
   if (command_line->HasSwitch(switches::kDisableImageAnimations)) {
     options.web_module_options.enable_image_animations = false;
   }
@@ -907,6 +881,9 @@
   network_module_.reset(new network::NetworkModule(
       CreateUserAgentString(platform_info), GetClientHintHeaders(platform_info),
       &event_dispatcher_, network_module_options));
+  // This is not necessary, but since some platforms need a lot of time to read
+  // the savegame, start the storage manager as soon as possible here.
+  network_module_->EnsureStorageManagerStarted();
 
   AddCrashHandlerAnnotations(platform_info);
 
@@ -1013,15 +990,20 @@
 #endif  // ENABLE_WEBDRIVER
 
 #if defined(ENABLE_DEBUGGER)
-  int remote_debugging_port = GetRemoteDebuggingPort();
-  if (remote_debugging_port == 0) {
-    DLOG(INFO) << "Remote web debugger disabled because "
-               << switches::kRemoteDebuggingPort << " is 0.";
+  if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+          switches::kDisableWebDebugger)) {
+    LOG(INFO) << "Remote web debugger disabled.";
   } else {
-    debug_web_server_.reset(new debug::remote::DebugWebServer(
-        remote_debugging_port, GetDevServersListenIp(),
-        base::Bind(&BrowserModule::CreateDebugClient,
-                   base::Unretained(browser_module_.get()))));
+    int remote_debugging_port = GetRemoteDebuggingPort();
+    if (remote_debugging_port == 0) {
+      LOG(INFO) << "Remote web debugger disabled because "
+                << switches::kRemoteDebuggingPort << " is 0.";
+    } else {
+      debug_web_server_.reset(new debug::remote::DebugWebServer(
+          remote_debugging_port, GetDevServersListenIp(),
+          base::Bind(&BrowserModule::CreateDebugClient,
+                     base::Unretained(browser_module_.get()))));
+    }
   }
 #endif  // ENABLE_DEBUGGER
 
@@ -1052,10 +1034,6 @@
   // an opportunity to clean up late logs and persist metrics.
   metrics::CobaltMetricsServicesManager::DeleteInstance();
 
-#if defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-  memory_tracker_tool_.reset(NULL);
-#endif  // defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-
   // Unregister event callbacks.
   event_dispatcher_.RemoveEventCallback(base::WindowSizeChangedEvent::TypeId(),
                                         window_size_change_event_callback_);
@@ -1471,24 +1449,6 @@
   event_dispatcher_.DispatchEvent(std::unique_ptr<base::Event>(event));
 }
 
-#if defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-void Application::OnMemoryTrackerCommand(const std::string& message) {
-  if (base::MessageLoop::current() != message_loop_) {
-    message_loop_->task_runner()->PostTask(
-        FROM_HERE, base::Bind(&Application::OnMemoryTrackerCommand,
-                              base::Unretained(this), message));
-    return;
-  }
-
-  if (memory_tracker_tool_) {
-    LOG(ERROR) << "Can not create a memory tracker when one is already active.";
-    return;
-  }
-  LOG(WARNING) << "Creating \"" << message << "\" memory tracker.";
-  memory_tracker_tool_ = memory_tracker::CreateMemoryTrackerTool(message);
-}
-#endif  // defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-
 // Called to handle deep link consumed events.
 void Application::OnDeepLinkConsumedCallback(const std::string& link) {
   LOG(INFO) << "Got deep link consumed callback: " << link;
@@ -1558,9 +1518,9 @@
   // it's enabled or upload interval.
   bool is_metrics_enabled = persistent_settings_->GetPersistentSettingAsBool(
       metrics::kMetricEnabledSettingName, false);
-  metrics_services_manager_->SetUploadInterval(
-      persistent_settings_->GetPersistentSettingAsInt(
-          metrics::kMetricEventIntervalSettingName, 300));
+  auto metric_event_interval = persistent_settings_->GetPersistentSettingAsInt(
+      metrics::kMetricEventIntervalSettingName, 300);
+  metrics_services_manager_->SetUploadInterval(metric_event_interval);
   metrics_services_manager_->ToggleMetricsEnabled(is_metrics_enabled);
   // Metric recording state initialization _must_ happen before we bootstrap
   // otherwise we crash.
@@ -1569,6 +1529,10 @@
   // UpdateUploadPermissions bootstraps the whole metric reporting, scheduling,
   // and uploading cycle.
   metrics_services_manager_->UpdateUploadPermissions(is_metrics_enabled);
+  LOG(INFO)
+      << "Cobalt Telemetry initialized with settings: is_metrics_enabled: "
+      << is_metrics_enabled
+      << ", metric_event_interval: " << metric_event_interval;
 }
 
 }  // namespace browser
diff --git a/cobalt/browser/application.h b/cobalt/browser/application.h
index 7ca2d5d..5015219 100644
--- a/cobalt/browser/application.h
+++ b/cobalt/browser/application.h
@@ -26,7 +26,6 @@
 #include "base/threading/thread_checker.h"
 #include "cobalt/base/event_dispatcher.h"
 #include "cobalt/browser/browser_module.h"
-#include "cobalt/browser/memory_tracker/tool.h"
 #include "cobalt/browser/metrics/cobalt_metrics_services_manager.h"
 #include "cobalt/network/network_module.h"
 #include "cobalt/persistent_storage/persistent_settings.h"
@@ -199,17 +198,6 @@
 
   base::RepeatingTimer stats_update_timer_;
 
-#if defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-  std::unique_ptr<memory_tracker::Tool> memory_tracker_tool_;
-
-  // Command handler object for creating a memory tracker.
-  debug::console::ConsoleCommandManager::CommandHandler
-      memory_tracker_command_handler_;
-
-  // Create a memory tracker with the given message
-  void OnMemoryTrackerCommand(const std::string& message);
-#endif  // defined(ENABLE_DEBUGGER) && defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-
   // Deep links are stored here until they are reported consumed.
   std::string unconsumed_deep_link_;
 
diff --git a/cobalt/browser/browser_module.cc b/cobalt/browser/browser_module.cc
index e8f1c28..d83200f 100644
--- a/cobalt/browser/browser_module.cc
+++ b/cobalt/browser/browser_module.cc
@@ -55,7 +55,6 @@
 #include "cobalt/ui_navigation/scroll_engine/scroll_engine.h"
 #include "cobalt/web/csp_delegate_factory.h"
 #include "cobalt/web/navigator_ua_data.h"
-#include "nb/memory_scope.h"
 #include "starboard/atomic.h"
 #include "starboard/common/string.h"
 #include "starboard/configuration.h"
@@ -621,6 +620,10 @@
   }
 
   options.debugger_state = debugger_state_.get();
+  if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+          switches::kDisableWebDebugger)) {
+    options.enable_debugger = true;
+  }
 #endif  // ENABLE_DEBUGGER
 
   // Pass down this callback from to Web module.
@@ -1419,9 +1422,14 @@
       FROM_HERE,
       base::Bind(&BrowserModule::GetDebugDispatcherInternal,
                  base::Unretained(this), base::Unretained(&debug_dispatcher)));
-  DCHECK(debug_dispatcher);
-  return std::unique_ptr<debug::DebugClient>(
-      new debug::DebugClient(debug_dispatcher, delegate));
+  if (debug_dispatcher) {
+    return std::unique_ptr<debug::DebugClient>(
+        new debug::DebugClient(debug_dispatcher, delegate));
+  } else {
+    LOG(ERROR)
+        << "Debugger connected but debugging the main web module is disabled.";
+    return nullptr;
+  }
 }
 
 void BrowserModule::GetDebugDispatcherInternal(
diff --git a/cobalt/browser/debug_console.cc b/cobalt/browser/debug_console.cc
index b08fed0..f540eec 100644
--- a/cobalt/browser/debug_console.cc
+++ b/cobalt/browser/debug_console.cc
@@ -205,7 +205,14 @@
 
 void DebugConsole::CycleMode() {
   base::AutoLock lock(mode_mutex_);
-  mode_ = (mode_ + 1) % debug::console::kDebugConsoleModeCount;
+  int number_of_modes = debug::console::kDebugConsoleModeCount;
+#if defined(ENABLE_DEBUGGER)
+  if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+          switches::kDisableWebDebugger)) {
+    number_of_modes = (debug::console::kDebugConsoleModeHud + 1);
+  }
+#endif
+  mode_ = (mode_ + 1) % number_of_modes;
 }
 
 debug::console::DebugConsoleMode DebugConsole::GetMode() {
diff --git a/cobalt/browser/idl_files.gni b/cobalt/browser/idl_files.gni
index 4663d09..12adde0 100644
--- a/cobalt/browser/idl_files.gni
+++ b/cobalt/browser/idl_files.gni
@@ -156,7 +156,6 @@
   "//cobalt/h5vcc/dial/dial_server.idl",
   "//cobalt/h5vcc/h5vcc.idl",
   "//cobalt/h5vcc/h5vcc_accessibility.idl",
-  "//cobalt/h5vcc/h5vcc_account_info.idl",
   "//cobalt/h5vcc/h5vcc_account_manager_internal.idl",
   "//cobalt/h5vcc/h5vcc_audio_config.idl",
   "//cobalt/h5vcc/h5vcc_audio_config_array.idl",
diff --git a/cobalt/browser/memory_settings/calculations_test.cc b/cobalt/browser/memory_settings/calculations_test.cc
index 62104a7..502321e 100644
--- a/cobalt/browser/memory_settings/calculations_test.cc
+++ b/cobalt/browser/memory_settings/calculations_test.cc
@@ -24,7 +24,6 @@
 #include "starboard/common/log.h"
 #include "starboard/memory.h"
 #include "starboard/system.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace cobalt {
diff --git a/cobalt/browser/memory_settings/pretty_print_test.cc b/cobalt/browser/memory_settings/pretty_print_test.cc
index 4034bfa..3eafe36 100644
--- a/cobalt/browser/memory_settings/pretty_print_test.cc
+++ b/cobalt/browser/memory_settings/pretty_print_test.cc
@@ -30,7 +30,6 @@
 #include "starboard/memory.h"
 #include "starboard/string.h"
 #include "starboard/system.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace cobalt {
diff --git a/cobalt/browser/memory_tracker/BUILD.gn b/cobalt/browser/memory_tracker/BUILD.gn
deleted file mode 100644
index f2ecb49..0000000
--- a/cobalt/browser/memory_tracker/BUILD.gn
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 2021 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.
-
-static_library("memory_tracker_tool") {
-  has_pedantic_warnings = true
-  sources = [
-    "tool.cc",
-    "tool.h",
-    "tool/buffered_file_writer.cc",
-    "tool/buffered_file_writer.h",
-    "tool/compressed_time_series_tool.cc",
-    "tool/compressed_time_series_tool.h",
-    "tool/histogram_table_csv_base.h",
-    "tool/internal_fragmentation_tool.cc",
-    "tool/internal_fragmentation_tool.h",
-    "tool/leak_finder_tool.cc",
-    "tool/leak_finder_tool.h",
-    "tool/log_writer_tool.cc",
-    "tool/log_writer_tool.h",
-    "tool/malloc_logger_tool.cc",
-    "tool/malloc_logger_tool.h",
-    "tool/malloc_stats_tool.cc",
-    "tool/malloc_stats_tool.h",
-    "tool/memory_size_binner_tool.cc",
-    "tool/memory_size_binner_tool.h",
-    "tool/params.cc",
-    "tool/params.h",
-    "tool/print_csv_tool.cc",
-    "tool/print_csv_tool.h",
-    "tool/print_tool.cc",
-    "tool/print_tool.h",
-    "tool/tool_impl.cc",
-    "tool/tool_impl.h",
-    "tool/tool_thread.cc",
-    "tool/tool_thread.h",
-    "tool/util.cc",
-    "tool/util.h",
-  ]
-  deps = [
-    "//base",
-    "//cobalt/base",
-    "//cobalt/script",
-    "//nb",
-    "//starboard",
-  ]
-}
diff --git a/cobalt/browser/memory_tracker/tool.cc b/cobalt/browser/memory_tracker/tool.cc
deleted file mode 100644
index 0db436a..0000000
--- a/cobalt/browser/memory_tracker/tool.cc
+++ /dev/null
@@ -1,514 +0,0 @@
-// Copyright 2016 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 "cobalt/browser/memory_tracker/tool.h"
-
-#include <cmath>
-#include <cstdlib>
-#include <map>
-#include <memory>
-#include <string>
-
-#include "base/logging.h"
-#include "base/strings/string_number_conversions.h"
-#include "cobalt/browser/memory_tracker/tool/compressed_time_series_tool.h"
-#include "cobalt/browser/memory_tracker/tool/internal_fragmentation_tool.h"
-#include "cobalt/browser/memory_tracker/tool/leak_finder_tool.h"
-#include "cobalt/browser/memory_tracker/tool/log_writer_tool.h"
-#include "cobalt/browser/memory_tracker/tool/malloc_logger_tool.h"
-#include "cobalt/browser/memory_tracker/tool/malloc_stats_tool.h"
-#include "cobalt/browser/memory_tracker/tool/memory_size_binner_tool.h"
-#include "cobalt/browser/memory_tracker/tool/print_csv_tool.h"
-#include "cobalt/browser/memory_tracker/tool/print_tool.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-#include "cobalt/browser/memory_tracker/tool/tool_thread.h"
-#include "nb/analytics/memory_tracker_helpers.h"
-#include "starboard/common/log.h"
-#include "starboard/configuration.h"
-#include "starboard/configuration_constants.h"
-#include "starboard/file.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-#if !defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-// Null implementation for memory tracker tool.
-class NullTool : public Tool {
- public:
-  virtual ~NullTool() {}
-};
-
-// Instantiates the memory tracker tool from the command argument.
-std::unique_ptr<Tool> CreateMemoryTrackerTool(const std::string&) {
-  return std::unique_ptr<Tool>(new NullTool);
-}
-
-#else
-
-using nb::analytics::MemoryTracker;
-
-namespace {
-enum SwitchEnum {
-  kNull,
-  kStartup,
-  kContinuousPrinter,
-  kCompressedTimeseries,
-  kBinnerAnalytics,
-  kAllocationLogger,
-  kLeakTracer,
-  kJavascriptLeakTracer,
-  kInternalFragmentationTracer,
-  kMallocStats,
-  kMallocLogger,
-};
-
-struct SwitchVal {
-  SwitchVal() : help_msg(), enum_value(kNull) {}
-  SwitchVal(const SwitchVal& other)
-      : tool_name(other.tool_name),
-        help_msg(other.help_msg),
-        enum_value(other.enum_value) {}
-  SwitchVal(const char* name, const char* msg, SwitchEnum val)
-      : tool_name(name), help_msg(msg), enum_value(val) {}
-
-  std::string tool_name;
-  std::string help_msg;
-  SwitchEnum enum_value;
-};
-
-class SbLogger : public AbstractLogger {
- public:
-  void Output(const char* str) override { LOG(INFO) << str; }
-  void Flush() override { SbLogFlush(); }
-};
-
-class FileLogger : public AbstractLogger {
- public:
-  explicit FileLogger(const std::string& filename);
-  ~FileLogger();
-  void Output(const char* str) override {
-    if (SbFileIsValid(log_file_)) {
-      SbFileWrite(log_file_, str, static_cast<int>(strlen(str)));
-      SbFileFlush(log_file_);
-    } else {
-      LOG(INFO) << str;
-    }
-  }
-  void Flush() override { SbLogFlush(); }
-
- private:
-  SbFile log_file_;
-};
-
-FileLogger::FileLogger(const std::string& filename)
-    : log_file_(kSbFileInvalid) {
-  char file_name_buff[2048] = {};
-  SbSystemGetPath(kSbSystemPathDebugOutputDirectory, file_name_buff,
-                  arraysize(file_name_buff));
-  std::string path(file_name_buff);
-  if (!path.empty()) {  // Protect against a dangling "/" at end.
-    const int back_idx_signed = static_cast<int>(path.length()) - 1;
-    if (back_idx_signed >= 0) {
-      const size_t idx = back_idx_signed;
-      if (path[idx] == kSbFileSepChar) {
-        path.erase(idx);
-      }
-    }
-  }
-  path.push_back(kSbFileSepChar);
-  path.append(filename);
-  int flags = kSbFileCreateAlways | kSbFileWrite;
-  bool created_ok = false;
-  SbFileError error_code = kSbFileOk;
-  log_file_ = SbFileOpen(path.c_str(), flags, &created_ok, &error_code);
-  if (log_file_ == kSbFileInvalid || !created_ok) {
-    LOG(ERROR) << "Error creating log file";
-    return;
-  } else {
-    LOG(INFO) << "Logging to file: " << path;
-  }
-}
-
-FileLogger::~FileLogger() {
-  SbFileClose(log_file_);
-  log_file_ = kSbFileInvalid;
-}  // namespace
-
-// Parses out the toolname for a tool command.
-// Example:
-//   INPUT:  "tool_name(arg):filename"
-//   OUTPUT: "tool_name"
-std::string ParseToolName(const std::string& command_arg) {
-  const size_t first_open_paren_idx = command_arg.find('(');
-  if (first_open_paren_idx == std::string::npos) {
-    const size_t first_colon_idx = command_arg.find(':');
-    if (first_colon_idx == std::string::npos) {
-      return command_arg;
-    }
-    return command_arg.substr(0, first_colon_idx);
-  }
-  return command_arg.substr(0, first_open_paren_idx);
-}
-
-// Parses out the output filename for a tool command.
-// Example:
-//   INPUT:  "tool_name(arg):filename"
-//   OUTPUT: "filename"
-std::string ParseFileName(const std::string& command_arg) {
-  const size_t first_colon_idx = command_arg.find(':');
-  if (first_colon_idx == std::string::npos) {
-    return "";
-  }
-  return command_arg.substr(1 + first_colon_idx);
-}
-
-// Parses out the arguments for a tool.
-// Example:
-//   INPUT:  "tool_name(arg):filename"
-//   OUTPUT: "arg"
-std::string ParseToolArg(const std::string& command_arg) {
-  const size_t first_open_paren_idx = command_arg.find('(');
-  const size_t last_closing_paren_idx = command_arg.find_last_of(')');
-
-  if ((first_open_paren_idx == std::string::npos) ||
-      (last_closing_paren_idx == std::string::npos)) {
-    return "";
-  }
-
-  if (last_closing_paren_idx < first_open_paren_idx) {
-    return "";
-  }
-
-  const size_t begin_idx = first_open_paren_idx + 1;
-  const size_t length = (last_closing_paren_idx - begin_idx);
-  std::string arg_str = command_arg.substr(begin_idx, length);
-  return arg_str;
-}
-
-struct DisableMemoryTrackerInScope {
-  explicit DisableMemoryTrackerInScope(MemoryTracker* tracker)
-      : tracker_(tracker) {
-    if (tracker_) {
-      tracker_->SetMemoryTrackingEnabled(false);
-    }
-  }
-
-  ~DisableMemoryTrackerInScope() {
-    if (tracker_) {
-      tracker_->SetMemoryTrackingEnabled(true);
-    }
-  }
-
-  MemoryTracker* tracker_;
-};
-
-}  // namespace.
-
-class MemoryTrackerThreadImpl : public Tool {
- public:
-  explicit MemoryTrackerThreadImpl(base::SimpleThread* ptr)
-      : thread_ptr_(ptr) {}
-  ~MemoryTrackerThreadImpl() override { thread_ptr_.reset(NULL); }
-  std::unique_ptr<base::SimpleThread> thread_ptr_;
-};
-
-std::unique_ptr<Tool> CreateMemoryTrackerTool(const std::string& command_arg) {
-  // The command line switch for memory_tracker was used. Look into the args
-  // and determine the mode that the memory_tracker should be used for.
-
-  // The map is used to
-  // 1) Resolve the string to an enum.
-  // 2) Print a useful help method of all known memory_tracker modes.
-  typedef std::map<std::string, SwitchVal> SwitchMap;
-
-  SwitchVal startup_tool(
-      "startup(num_mins=1)",  // Name of tool.
-      "  Records high-frequency memory metrics for the first 60\n"
-      "  seconds of program launch and then dumps it out in CSV format\n"
-      "  to stdout.\n",
-      kStartup);
-
-  SwitchVal continuous_printer_tool(
-      "continuous_printer",  // Name of tool.
-      "  Once every second the memory state is dumped to stdout.\n",
-      kContinuousPrinter);
-
-  SwitchVal compressed_timeseries_tool(
-      "compressed_timeseries",  // Name of tool.
-      "  Use this tool to see the growth in memory usage as the app runs.\n"
-      "  The memory growth is segmented into memory scopes and outputted as\n"
-      "  CSV. The compressed time-series will depict the full history of\n"
-      "  the memory using a fixed number of rows. Older history has degraded\n"
-      "  resolution and while new entries are captured in full detail. This\n"
-      "  achieved by evicting old entries by an exponential decay scheme.\n",
-      kCompressedTimeseries);
-
-  SwitchVal binner_tool(
-      "binner(region=NULL)",
-      "  Dumps memory statistics once a second in CSV format to stdout.\n"
-      "  The default memory region is all memory regions. Pass the\n"
-      "  name of the memory region to specify that only that memory region\n"
-      "  should be tracked. For example: binner(Javascript).\n",
-      kBinnerAnalytics);
-
-  SwitchVal allocation_logger_tool(
-      "allocation_logger",
-      "  Continuously writes allocations and deallocations to\n"
-      "  memory_log.txt. This is a legacy format used by lbshell. The\n"
-      "  location of this memory_log.txt file is in the platform dependent\n"
-      "  directory specified by kSbSystemPathDebugOutputDirectory.\n",
-      kAllocationLogger);
-
-  SwitchVal leak_tracing_tool(
-      "leak_tracer",
-      "  Automatically detects leaks and reports them in CSV format.\n",
-      kLeakTracer);
-
-  SwitchVal js_leak_tracing_tool(
-      "js_leak_tracer",
-      "  Automatically detects Javascript leaks and reports them in CSV\n"
-      "  format.\n",
-      kJavascriptLeakTracer);
-
-  SwitchVal internal_fragmentation_tracer_tool(
-      "internal_fragmentation_tracer",
-      "  Traces internal fragmentation and stores it in CSV format.\n",
-      kInternalFragmentationTracer);
-
-  SwitchVal malloc_stats_tool(
-      "malloc_stats",
-      "  Queries the allocation system for memory usage. This is the most\n"
-      "  lightweight tool. Output is CSV format.\n",
-      kMallocStats);
-
-  SwitchVal malloc_logger_tool(
-      "malloc_logger",
-      "  Continuously writes allocations, deallocations, allocation location\n"
-      "  and malloc stats to memory_log_<timestamp>.csv, without headers.\n"
-      "  The location of this log file is in the platform dependent\n"
-      "  directory specified by kSbSystemPathDebugOutputDirectory.\n",
-      kMallocLogger);
-
-  SwitchMap switch_map;
-  switch_map[ParseToolName(startup_tool.tool_name)] = startup_tool;
-  switch_map[ParseToolName(continuous_printer_tool.tool_name)] =
-      continuous_printer_tool;
-  switch_map[ParseToolName(compressed_timeseries_tool.tool_name)] =
-      compressed_timeseries_tool;
-  switch_map[ParseToolName(binner_tool.tool_name)] = binner_tool;
-  switch_map[ParseToolName(allocation_logger_tool.tool_name)] =
-      allocation_logger_tool;
-  switch_map[ParseToolName(leak_tracing_tool.tool_name)] = leak_tracing_tool;
-  switch_map[ParseToolName(js_leak_tracing_tool.tool_name)] =
-      js_leak_tracing_tool;
-  switch_map[ParseToolName(internal_fragmentation_tracer_tool.tool_name)] =
-      internal_fragmentation_tracer_tool;
-  switch_map[ParseToolName(malloc_logger_tool.tool_name)] = malloc_logger_tool;
-
-  switch_map[ParseToolName(malloc_stats_tool.tool_name)] = malloc_stats_tool;
-
-  std::string tool_name = ParseToolName(command_arg);
-  std::string tool_arg = ParseToolArg(command_arg);
-  std::string filename = ParseFileName(command_arg);
-
-  // FAST OUT - is a thread type not selected? Then print out a help menu
-  // and request that the app should shut down.
-  SwitchMap::const_iterator found_it = switch_map.find(tool_name);
-  if (found_it == switch_map.end()) {
-    // Error, tell the user what to do instead and then exit.
-    std::stringstream ss;
-    ss << "\nNo memory tracker tool selected so help has been invoked:\n";
-    ss << "Memory Tracker help:\n";
-    for (SwitchMap::const_iterator it = switch_map.begin();
-         it != switch_map.end(); ++it) {
-      const std::string& name = it->first;
-      const SwitchVal& val = it->second;
-      ss << "    memory_tracker=" << name << " \n" << val.help_msg;
-    }
-    ss << "\nIf the string has a colon, then the name after the colon is used\n"
-          "as the filename for output.\n"
-          "For example: \"leak_tracer:leaks.csv\"\n";
-    LOG(INFO) << ss.str();
-    ss.str("");  // Clears the contents of stringstream.
-
-    // Try and turn off all logging so that the stdout is less likely to be
-    // polluted by interleaving output.
-    logging::SetMinLogLevel(INT_MAX);
-    // SbThreadSleep wants microseconds. We sleep here so that the user can
-    // read the help message before the engine starts up again and the
-    // fills the output with more logging text.
-    const SbTime four_seconds = 4000 * kSbTimeMillisecond;
-    SbThreadSleep(four_seconds);
-
-    found_it = switch_map.find(continuous_printer_tool.tool_name);
-
-    // One more help message and 1-second pause. Then continue on with the
-    // execution as normal.
-    const SbTime one_second = 1000 * kSbTimeMillisecond;
-    SbThreadSleep(one_second);
-  }
-
-  // Okay we have been resolved to use a memory tracker in some way.
-  DLOG(INFO) << "\n\nUsing MemoryTracking=" << found_it->first << "\n";
-
-  // Tools are expected to instantiate the MemoryTracker if they need it.
-  MemoryTracker* memory_tracker = NULL;
-  std::unique_ptr<AbstractTool> tool_ptr;
-
-  const SwitchVal& value = found_it->second;
-  switch (value.enum_value) {
-    case kNull: {
-      SB_NOTREACHED();
-      break;
-    }
-    case kStartup: {
-      double num_mins = 1.0;
-      if (!tool_arg.empty()) {
-        if (!base::StringToDouble(tool_arg, &num_mins) ||
-            std::isnan(num_mins) || num_mins <= 0) {
-          num_mins = 1.0;
-        }
-      }
-      memory_tracker = MemoryTracker::Get();
-      memory_tracker->InstallGlobalTrackingHooks();
-
-      // Converts minutes into Sampling interval and also total sampling time.
-      // To keep the amount of elements in the output static, we adjust the
-      // sampling.
-      //
-      // The number of samples produced is held constants and is:
-      //   kNumSamples = F::TotalSamplingTime(num_mins) /
-      //                 F::SamplingIntervalMs(num_mins)
-      struct F {
-        static int SamplingIntervalMs(double mins) {
-          // kNumSamples is chosen such that SamplingIntervalMs(1) outputs
-          // 240ms.
-          static const double kNumSamples = 250.;
-          const int sample_time_ms =
-              static_cast<int>(ToMilliseconds(mins) / kNumSamples);
-          return static_cast<int>(sample_time_ms);
-        }
-
-        // TotalSamplingTime(1) outputs 60,000 milliseconds, or 1 minute.
-        static int ToMilliseconds(double mins) {
-          const double milliseconds = mins * 60. * 1000.;
-          return static_cast<int>(milliseconds);
-        }
-      };
-
-      // Sample time increases with the number of seconds. At one second we
-      // sample 4 times a second. This keeps the number of samples constant
-      // regardless of input time.
-      int sampling_interval_ms = F::SamplingIntervalMs(num_mins);
-      // Time until output is triggered.
-      int sampling_time_ms = F::ToMilliseconds(num_mins);
-      // Create a thread that will gather memory metrics for startup.
-      DisableMemoryTrackerInScope disable_in_scope(memory_tracker);
-      tool_ptr.reset(new PrintCSVTool(sampling_interval_ms, sampling_time_ms));
-      break;
-    }
-    case kContinuousPrinter: {
-      memory_tracker = MemoryTracker::Get();
-      memory_tracker->InstallGlobalTrackingHooks();
-      // Create a thread that will continuously report memory use.
-      DisableMemoryTrackerInScope disable_in_scope(memory_tracker);
-      tool_ptr.reset(new PrintTool);
-      break;
-    }
-    case kCompressedTimeseries: {
-      memory_tracker = MemoryTracker::Get();
-      memory_tracker->InstallGlobalTrackingHooks();
-      // Create a thread that will continuously report memory use.
-      DisableMemoryTrackerInScope disable_in_scope(memory_tracker);
-      tool_ptr.reset(new CompressedTimeSeriesTool);
-      break;
-    }
-    case kBinnerAnalytics: {
-      memory_tracker = MemoryTracker::Get();
-      memory_tracker->InstallGlobalTrackingHooks();
-      DisableMemoryTrackerInScope disable_in_scope(memory_tracker);
-      // Create a thread that will continuously report javascript memory
-      // analytics.
-      tool_ptr.reset(new MemorySizeBinnerTool(tool_arg));
-      break;
-    }
-    case kAllocationLogger: {
-      std::unique_ptr<LogWriterTool> disk_writer_tool(new LogWriterTool());
-      tool_ptr.reset(disk_writer_tool.release());
-      break;
-    }
-    case kLeakTracer: {
-      std::unique_ptr<LeakFinderTool> leak_finder(
-          new LeakFinderTool(LeakFinderTool::kCPlusPlus));
-
-      memory_tracker = MemoryTracker::Get();
-      memory_tracker->InstallGlobalTrackingHooks();
-      memory_tracker->SetMemoryTrackerDebugCallback(leak_finder.get());
-      tool_ptr.reset(leak_finder.release());
-      break;
-    }
-    case kJavascriptLeakTracer: {
-      std::unique_ptr<LeakFinderTool> leak_finder(
-          new LeakFinderTool(LeakFinderTool::kJavascript));
-
-      memory_tracker = MemoryTracker::Get();
-      memory_tracker->InstallGlobalTrackingHooks();
-      memory_tracker->SetMemoryTrackerDebugCallback(leak_finder.get());
-      tool_ptr.reset(leak_finder.release());
-      break;
-    }
-    case kInternalFragmentationTracer: {
-      memory_tracker = MemoryTracker::Get();
-      memory_tracker->InstallGlobalTrackingHooks();
-      tool_ptr.reset(new InternalFragmentationTool());
-      break;
-    }
-    case kMallocStats: {
-      tool_ptr.reset(new MallocStatsTool);
-      break;
-    }
-    case kMallocLogger: {
-      std::unique_ptr<MallocLoggerTool> malloc_logger(new MallocLoggerTool());
-
-      memory_tracker = MemoryTracker::Get();
-      memory_tracker->InstallGlobalTrackingHooks();
-      memory_tracker->SetMemoryTrackerDebugCallback(malloc_logger.get());
-      tool_ptr.reset(malloc_logger.release());
-      break;
-    }
-  }
-
-  if (tool_ptr.get()) {
-    DisableMemoryTrackerInScope disable_in_scope(memory_tracker);
-    AbstractLogger* logger = NULL;
-    if (!filename.empty()) {
-      logger = new FileLogger(filename);
-    }
-    if (!logger) {
-      logger = new SbLogger;
-    }
-    base::SimpleThread* thread = new ToolThread(memory_tracker,  // May be NULL.
-                                                tool_ptr.release(), logger);
-    return std::unique_ptr<Tool>(new MemoryTrackerThreadImpl(thread));
-  } else {
-    return std::unique_ptr<Tool>();
-  }
-}
-
-#endif  // !defined(STARBOARD_ALLOWS_MEMORY_TRACKING)
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool.h b/cobalt/browser/memory_tracker/tool.h
deleted file mode 100644
index d18fdce..0000000
--- a/cobalt/browser/memory_tracker/tool.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2016 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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_H_
-
-#include <memory>
-#include <string>
-
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-// Self running tool. It only has a destructor defined.
-class Tool {
- public:
-  virtual ~Tool() {}
-};
-
-// Instantiates the memory tracker tool from the command argument.
-std::unique_ptr<Tool> CreateMemoryTrackerTool(const std::string& command_arg);
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_H_
diff --git a/cobalt/browser/memory_tracker/tool/buffered_file_writer.cc b/cobalt/browser/memory_tracker/tool/buffered_file_writer.cc
deleted file mode 100644
index 73d3b47..0000000
--- a/cobalt/browser/memory_tracker/tool/buffered_file_writer.cc
+++ /dev/null
@@ -1,152 +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 "cobalt/browser/memory_tracker/tool/buffered_file_writer.h"
-
-#include "base/basictypes.h"
-#include "base/logging.h"
-
-#include "starboard/common/condition_variable.h"
-#include "starboard/common/log.h"
-#include "starboard/common/mutex.h"
-#include "starboard/file.h"
-#include "starboard/thread.h"
-#include "starboard/types.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-BufferedFileWriter::BufferedFileWriter(const std::string& file_path)
-    : current_log_buffer_(0),
-      log_buffer_to_flush_(NULL),
-      log_file_(kSbFileInvalid),
-      diskwrite_mutex_(),
-      diskwrite_cond_(diskwrite_mutex_),
-      quit_thread_(false),
-      file_path_(file_path) {
-  memset(log_buffers_, 0, sizeof(log_buffers_));
-  StartThread();
-}
-
-BufferedFileWriter::~BufferedFileWriter() { QuitThread(); }
-
-void BufferedFileWriter::QuitThread() {
-  quit_thread_ = true;
-  SwapBuffers();
-  diskwrite_cond_.Signal();
-
-  SbThreadJoin(flush_thread_, NULL);
-
-  SbFileClose(log_file_);
-  log_file_ = kSbFileInvalid;
-}
-
-void BufferedFileWriter::StartThread() {
-  // Do not reset the LogBuffers here, as they may have been written to
-  // before the log thread was started.
-  int flags = kSbFileCreateAlways | kSbFileWrite;
-  bool created_ok = false;
-  SbFileError error_code = kSbFileOk;
-
-  log_file_ = SbFileOpen(file_path_.c_str(), flags, &created_ok, &error_code);
-
-  if (log_file_ == kSbFileInvalid || !created_ok) {
-    SbLogRaw("Error creating memory log file\n");
-    return;
-  }
-
-  flush_thread_ = SbThreadCreate(0,  // default stack size.
-                                 kSbThreadPriorityHigh, kSbThreadNoAffinity,
-                                 true,  // true - joinable.
-                                 "AllocationLoggerWriter", ThreadEntryFunc,
-                                 static_cast<void*>(this));
-}
-
-void BufferedFileWriter::Append(const char* data, size_t num_bytes) {
-  if (num_bytes > kBufferSize) {
-    // We can never log this, and it's probably an error, but let's not write
-    // over the end of the buffer.
-    DCHECK(false) << "Log data is larger than the full buffer size. "
-                     "Dropping log data\n";
-    return;
-  }
-
-  starboard::ScopedLock lock(buffer_write_mutex_);
-
-  // This function may be called before memory_log_writer_start.
-  if (log_buffers_[current_log_buffer_].num_bytes + num_bytes > kBufferSize) {
-    if (!SwapBuffers()) {
-      // Failed to swap the buffer, so we will have to drop this log
-      DCHECK(false) << "Dropping log data. Try increasing buffer size.";
-      return;
-    }
-  }
-
-  LogBuffer& current_buffer = log_buffers_[current_log_buffer_];
-  memcpy(current_buffer.buffer + current_buffer.num_bytes, data,
-               num_bytes);
-  current_buffer.num_bytes += num_bytes;
-  return;
-}
-
-void BufferedFileWriter::Run() {
-  starboard::ScopedLock lock(diskwrite_mutex_);
-  while (!quit_thread_) {
-    if (log_buffer_to_flush_ != NULL) {
-      size_t bytes_written =
-          SbFileWrite(log_file_, log_buffer_to_flush_->buffer,
-                      static_cast<int>(log_buffer_to_flush_->num_bytes));
-      if (bytes_written != log_buffer_to_flush_->num_bytes) {
-        SbLogRaw("Error writing to memory log. Aborting logging\n");
-        break;
-      }
-      log_buffer_to_flush_->num_bytes = 0;
-      log_buffer_to_flush_ = NULL;
-    }
-    diskwrite_cond_.Wait();  // Unlocks diskwrite_mutex_.
-  }
-}
-
-void* BufferedFileWriter::ThreadEntryFunc(void* context) {
-  BufferedFileWriter* self = static_cast<BufferedFileWriter*>(context);
-  self->Run();
-  return NULL;
-}
-
-bool BufferedFileWriter::SwapBuffers() {
-  // If the non-logging threads block on this for too long, try increasing
-  // the size of the buffers.
-  diskwrite_mutex_.Acquire();
-
-  bool can_swap = (log_buffer_to_flush_ == NULL);
-  if (!can_swap) {
-    SbLogRaw("Cannot swap buffer while a flush is pending.\n");
-  } else {
-    log_buffer_to_flush_ = &(log_buffers_[current_log_buffer_]);
-    current_log_buffer_ = (current_log_buffer_ + 1) % kNumBuffers;
-    SB_DCHECK(log_buffers_[current_log_buffer_].num_bytes == 0);
-  }
-
-  diskwrite_cond_.Signal();
-
-  diskwrite_mutex_.Release();
-  SbThreadYield();
-
-  return can_swap;
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/buffered_file_writer.h b/cobalt/browser/memory_tracker/tool/buffered_file_writer.h
deleted file mode 100644
index 7001464..0000000
--- a/cobalt/browser/memory_tracker/tool/buffered_file_writer.h
+++ /dev/null
@@ -1,83 +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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_BUFFERED_FILE_WRITER_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_BUFFERED_FILE_WRITER_H_
-
-#include <string>
-
-#include "starboard/common/condition_variable.h"
-#include "starboard/common/log.h"
-#include "starboard/common/mutex.h"
-#include "starboard/file.h"
-#include "starboard/memory.h"
-#include "starboard/thread.h"
-#include "starboard/types.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-// This is a heavy weight file writing class. It's "heavy weight" because
-// 1) It uses its own thread.
-// 2) It uses a 4mb inlined buffer for file writes. This class guarantees
-// that it will never allocate memory and therefore can be used in high
-// performance, low-level data writes.
-class BufferedFileWriter {
- public:
-  // Constructs the BufferedFileWriter with the path to write to. A thread is
-  // started which will begin writing to the file object.
-  explicit BufferedFileWriter(const std::string& file_path);
-
-  // Implicitly calls JoinThread(). This is safe if JoinThread() has already
-  // been called.
-  ~BufferedFileWriter();
-
-  // Can be called by any thread. Pushes data to the buffer to be written out
-  // by the disk writing thread as is.
-  // Note that this append is raw and will NOT add any new line or other
-  // formatting characters.
-  void Append(const char* data, size_t num_bytes);
-
- private:
-  static void* ThreadEntryFunc(void* context);  // Delegates to Run().
-  void Run();
-  bool SwapBuffers();
-  void StartThread();
-  void QuitThread();
-
-  static const int kBufferSize = 1 << 20;
-  static const int kNumBuffers = 2;
-  struct LogBuffer {
-    char buffer[kBufferSize];
-    size_t num_bytes;
-  };
-  LogBuffer log_buffers_[kNumBuffers];
-  int current_log_buffer_;
-  LogBuffer* log_buffer_to_flush_;
-  SbFile log_file_;
-
-  starboard::Mutex diskwrite_mutex_;
-  starboard::Mutex buffer_write_mutex_;
-  starboard::ConditionVariable diskwrite_cond_;
-  SbThread flush_thread_;
-  bool quit_thread_;
-  std::string file_path_;
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_BUFFERED_FILE_WRITER_H_
diff --git a/cobalt/browser/memory_tracker/tool/compressed_time_series_tool.cc b/cobalt/browser/memory_tracker/tool/compressed_time_series_tool.cc
deleted file mode 100644
index 5cb3d52..0000000
--- a/cobalt/browser/memory_tracker/tool/compressed_time_series_tool.cc
+++ /dev/null
@@ -1,247 +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 "cobalt/browser/memory_tracker/tool/compressed_time_series_tool.h"
-
-#include <iomanip>
-#include <map>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "base/time/time.h"
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-#include "cobalt/browser/memory_tracker/tool/util.h"
-#include "nb/analytics/memory_tracker.h"
-#include "starboard/common/log.h"
-#include "starboard/types.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-///////////////////////////////////////////////////////////////////////////////
-CompressedTimeSeriesTool::CompressedTimeSeriesTool() : number_samples_(400) {}
-
-void CompressedTimeSeriesTool::Run(Params* params) {
-  TimeSeries timeseries;
-  Timer timer_status_message(base::TimeDelta::FromSeconds(1));
-
-  // Outputs CSV once every minute.
-  Timer timer_output_csv(base::TimeDelta::FromMinutes(1));
-
-  // Initial sample time is every 50 milliseconds.
-  base::TimeDelta current_sample_interval =
-      base::TimeDelta::FromMilliseconds(50);
-
-  while (!params->wait_for_finish_signal(current_sample_interval.ToSbTime())) {
-    AcquireSample(params->memory_tracker(), &timeseries,
-                  params->time_since_start());
-
-    if (IsFull(timeseries, number_samples_)) {
-      Compress(&timeseries);           // Remove every other element.
-      current_sample_interval *= 2;    // Double the sample time.
-      timer_status_message.Restart();  // Skip status message.
-    }
-
-    if (timer_output_csv.UpdateAndIsExpired()) {
-      const std::string str = ToCsvString(timeseries);
-      params->logger()->Output(str.c_str());
-      timer_status_message.Restart();  // Skip status message.
-    }
-
-    // Print status message.
-    if (timer_status_message.UpdateAndIsExpired()) {
-      std::stringstream ss;
-      ss << tool_name() << " is running..." << kNewLine;
-      params->logger()->Output(ss.str().c_str());
-    }
-  }
-}
-
-std::string CompressedTimeSeriesTool::ToCsvString(
-    const TimeSeries& timeseries) {
-  size_t largest_sample_size = 0;
-  size_t smallest_sample_size = INT_MAX;
-
-  typedef MapAllocationSamples::const_iterator MapIt;
-
-  // Sanitize samples_in and store as samples.
-  const MapAllocationSamples& samples_in = timeseries.samples_;
-  MapAllocationSamples samples;
-  for (MapIt it = samples_in.begin(); it != samples_in.end(); ++it) {
-    std::string name = it->first;
-    const AllocationSamples& value = it->second;
-
-    if (value.allocated_bytes_.size() != value.number_allocations_.size()) {
-      SB_NOTREACHED() << "Error at " << __FILE__ << ":" << __LINE__;
-      return "ERROR";
-    }
-
-    const size_t n = value.allocated_bytes_.size();
-    if (n > largest_sample_size) {
-      largest_sample_size = n;
-    }
-    if (n < smallest_sample_size) {
-      smallest_sample_size = n;
-    }
-
-    const bool duplicate_found = (samples.end() != samples.find(name));
-    if (duplicate_found) {
-      SB_NOTREACHED() << "Error, duplicate found for entry: " << name
-                      << kNewLine;
-    }
-    // Store value as a sanitized sample.
-    samples[name] = value;
-  }
-
-  SB_DCHECK(largest_sample_size == smallest_sample_size);
-
-  std::stringstream ss;
-
-  // Begin output to CSV.
-
-  // Preamble
-  ss << kNewLine << "//////////////////////////////////////////////" << kNewLine
-     << "// CSV of BYTES allocated per region (MB's)." << kNewLine
-     << "// Units are in Megabytes. This is designed" << kNewLine
-     << "// to be used in a stacked graph." << kNewLine;
-
-  // HEADER.
-  ss << kQuote << "Time(mins)" << kQuote << kDelimiter;
-  for (MapIt it = samples.begin(); it != samples.end(); ++it) {
-    const std::string& name = it->first;
-    ss << kQuote << SanitizeCSVKey(name) << kQuote << kDelimiter;
-  }
-  ss << kNewLine;
-
-  // Print out the values of each of the samples.
-  for (size_t i = 0; i < smallest_sample_size; ++i) {
-    // Output time first so that it can be used as an x-axis.
-    const double time_mins =
-        timeseries.time_stamps_[i].InMilliseconds() / (1000. * 60.);
-    ss << time_mins << ",";
-    for (MapIt it = samples.begin(); it != samples.end(); ++it) {
-      const int64 alloc_bytes = it->second.allocated_bytes_[i];
-      // Convert to float megabytes with decimals of precision.
-      double n = static_cast<double>(alloc_bytes / (1000 * 10));
-      n = n / (100.);
-      ss << n << kDelimiter;
-    }
-    ss << kNewLine;
-  }
-  ss << "// END CSV of BYTES allocated per region." << kNewLine;
-  ss << "//////////////////////////////////////////////";
-
-  ss << kNewLine;
-  // Preamble
-  ss << kNewLine << "//////////////////////////////////////////////";
-  ss << kNewLine << "// CSV of COUNT of allocations per region." << kNewLine;
-
-  // HEADER
-  ss << kQuote << "Time(mins)" << kQuote << kDelimiter;
-  for (MapIt it = samples.begin(); it != samples.end(); ++it) {
-    const std::string& name = it->first;
-    ss << kQuote << SanitizeCSVKey(name) << kQuote << kDelimiter;
-  }
-  ss << kNewLine;
-  for (size_t i = 0; i < smallest_sample_size; ++i) {
-    // Output time first so that it can be used as an x-axis.
-    const double time_mins =
-        timeseries.time_stamps_[i].InMilliseconds() / (1000. * 60.);
-    ss << time_mins << ",";
-    for (MapIt it = samples.begin(); it != samples.end(); ++it) {
-      const int64 n_allocs = it->second.number_allocations_[i];
-      ss << n_allocs << kDelimiter;
-    }
-    ss << kNewLine;
-  }
-  ss << "// END CSV of COUNT of allocations per region." << kNewLine;
-  ss << "//////////////////////////////////////////////";
-  ss << kNewLine << kNewLine;
-
-  std::string output = ss.str();
-  return output;
-}
-
-void CompressedTimeSeriesTool::AcquireSample(
-    nb::analytics::MemoryTracker* memory_tracker, TimeSeries* timeseries,
-    const base::TimeDelta& time_now) {
-  const size_t sample_count = timeseries->time_stamps_.size();
-  timeseries->time_stamps_.push_back(time_now);
-
-  MapAllocationSamples& map_samples = timeseries->samples_;
-
-  std::vector<const nb::analytics::AllocationGroup*> vector_output;
-  memory_tracker->GetAllocationGroups(&vector_output);
-
-  // Sample all known memory scopes.
-  for (size_t i = 0; i < vector_output.size(); ++i) {
-    const nb::analytics::AllocationGroup* group = vector_output[i];
-    const std::string& name = group->name();
-
-    const bool first_creation =
-        map_samples.find(group->name()) == map_samples.end();
-
-    AllocationSamples& new_entry = map_samples[name];
-
-    // Didn't see it before so create new entry.
-    if (first_creation) {
-      // Make up for lost samples...
-      new_entry.allocated_bytes_.resize(sample_count, 0);
-      new_entry.number_allocations_.resize(sample_count, 0);
-    }
-
-    int32 num_allocs = -1;
-    int64 allocation_bytes = -1;
-    group->GetAggregateStats(&num_allocs, &allocation_bytes);
-
-    new_entry.allocated_bytes_.push_back(allocation_bytes);
-    new_entry.number_allocations_.push_back(num_allocs);
-  }
-
-  // Sample the in use memory bytes reported by malloc.
-  nb::analytics::MemoryStats memory_stats =
-      nb::analytics::GetProcessMemoryStats();
-  AllocationSamples& process_mem_in_use = map_samples["ProcessMemoryInUse"];
-  process_mem_in_use.allocated_bytes_.push_back(memory_stats.used_cpu_memory);
-  process_mem_in_use.number_allocations_.push_back(0);
-
-  // Sample the reserved memory bytes reported by malloc.
-  AllocationSamples& process_mem_reserved =
-      map_samples["ProcessMemoryReserved"];
-  process_mem_reserved.allocated_bytes_.push_back(memory_stats.used_cpu_memory);
-  process_mem_reserved.number_allocations_.push_back(0);
-}
-
-bool CompressedTimeSeriesTool::IsFull(const TimeSeries& timeseries,
-                                      size_t samples_limit) {
-  return timeseries.time_stamps_.size() >= samples_limit;
-}
-
-void CompressedTimeSeriesTool::Compress(TimeSeries* timeseries) {
-  typedef MapAllocationSamples::iterator MapIt;
-  MapAllocationSamples& samples = timeseries->samples_;
-  RemoveOddElements(&(timeseries->time_stamps_));
-  for (MapIt it = samples.begin(); it != samples.end(); ++it) {
-    AllocationSamples& data = it->second;
-    RemoveOddElements(&data.allocated_bytes_);
-    RemoveOddElements(&data.number_allocations_);
-  }
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/compressed_time_series_tool.h b/cobalt/browser/memory_tracker/tool/compressed_time_series_tool.h
deleted file mode 100644
index 35bcfe0..0000000
--- a/cobalt/browser/memory_tracker/tool/compressed_time_series_tool.h
+++ /dev/null
@@ -1,83 +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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_COMPRESSED_TIME_SERIES_TOOL_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_COMPRESSED_TIME_SERIES_TOOL_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-#include "cobalt/browser/memory_tracker/tool/util.h"
-#include "nb/analytics/memory_tracker.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-// Generates CSV values of the engine memory. This includes memory
-// consumption in bytes and also the number of allocations.
-// Allocations are segmented by category such as "Javascript" and "Network and
-// are periodically dumped to the Params::abstract_logger_.
-//
-// Compression:
-//  During early run, the sampling rate is extremely high, however the sampling
-//  rate will degrade by half each time the sampling buffer fills up.
-//
-//  Additionally, every time the sampling buffer fills up, space is freed by
-//  evicting every other element.
-//
-// Example output:
-//  //////////////////////////////////////////////
-//  // CSV of BYTES allocated per region (MB's).
-//  // Units are in Megabytes. This is designed
-//  // to be used in a stacked graph.
-//  "Time(mins)","CSS","DOM","Javascript","Media","base::MessageLoop"....
-//  0,0,0,0,0,0...
-//  1022.54,3.3,7.19,49.93,50.33....
-//  ...
-//  // END CSV of BYTES allocated per region.
-//  //////////////////////////////////////////////
-//
-//  //////////////////////////////////////////////
-//  // CSV of COUNT of allocations per region.
-//  "Time(mins)","CSS","DOM","Javascript","Media","base::MessageLoop"....
-//  0,0,0,0,0,0...
-//  1022.54,57458,70011,423217,27,54495,43460...
-//  ...
-//  // END CSV of COUNT of allocations per region.
-//  //////////////////////////////////////////////
-class CompressedTimeSeriesTool : public AbstractTool {
- public:
-  CompressedTimeSeriesTool();
-  void Run(Params* params) override;
-  std::string tool_name() const override {
-    return "MemoryTrackerCompressedTimeSeries";
-  }
-
- private:
-  static std::string ToCsvString(const TimeSeries& histogram);
-  static void AcquireSample(nb::analytics::MemoryTracker* memory_tracker,
-                            TimeSeries* histogram, const base::TimeDelta& dt);
-  static bool IsFull(const TimeSeries& histogram, size_t num_samples);
-  static void Compress(TimeSeries* histogram);
-
-  const int number_samples_;
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_COMPRESSED_TIME_SERIES_TOOL_H_
diff --git a/cobalt/browser/memory_tracker/tool/histogram_table_csv_base.h b/cobalt/browser/memory_tracker/tool/histogram_table_csv_base.h
deleted file mode 100644
index 3a96a34..0000000
--- a/cobalt/browser/memory_tracker/tool/histogram_table_csv_base.h
+++ /dev/null
@@ -1,190 +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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_HISTOGRAM_TABLE_CSV_BASE_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_HISTOGRAM_TABLE_CSV_BASE_H_
-
-#include <map>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "base/logging.h"
-#include "cobalt/browser/memory_tracker/tool/util.h"
-#include "starboard/types.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-// This HistogramTableCSV provides most of the functionality for generating a
-// csv table from a histogram of data.
-//
-// Subclasses need to override ValueToString(...) so that the
-// data-type can be stringified during the call to ToString().
-//
-// Example:
-//  class MyHistogram : public HistogramTableCSV<int64_t>() {...}
-//  MyHistogram my_histogram;
-//  my_histogram.set_title("Memory Values");
-//
-//  // Add first row.
-//  my_histogram.BeginRow(time_delta);
-//  my_histogram.AddRowValue("ColumnA", 0);
-//  my_histogram.AddRowValue("ColumnB", 0);
-//  my_histogram.FinalizeRow();
-//
-//  // Add second row.
-//  my_histogram.BeginRow(time_delta);
-//  my_histogram.AddRowValue("ColumnA", 1);
-//  my_histogram.AddRowValue("ColumnB", 2);
-//  my_histogram.AddRowValue("ColumnC", 1);  // Ok, ColumnC will be autofilled.
-//  my_histogram.FinalizeRow();
-//
-//  Print(my_histogram.ToString());
-template <typename ValueType>
-class HistogramTableCSVBase {
- public:
-  typedef std::map<std::string, std::vector<ValueType> > TableData;
-
-  // default_value is used to auto-fill values, such as when a new column
-  // is introduced.
-  explicit HistogramTableCSVBase(const ValueType& default_value)
-      : default_value_(default_value) {}
-
-  virtual std::string ValueToString(const ValueType& value) const = 0;
-
-  void set_title(const std::string& title) { title_ = title; }
-
-  void BeginRow(const base::TimeDelta time_value) {
-    time_values_.push_back(time_value);
-  }
-
-  void AddRowValue(const std::string& column_key, const ValueType& value) {
-    if (time_values_.empty()) {
-      NOTREACHED() << "table_data_ was empty.";
-      time_values_.push_back(base::TimeDelta());
-    }
-    const size_t n = time_values_.size();
-    std::vector<ValueType>& column = table_data_[column_key];
-    while (column.size() < n - 1) {
-      column.push_back(default_value_);
-    }
-    column.push_back(value);
-  }
-
-  void FinalizeRow() {
-    const size_t n = time_values_.size();
-    for (typename TableData::iterator it = table_data_.begin();
-         it != table_data_.end(); ++it) {
-      std::vector<ValueType>& column = it->second;
-      while (column.size() < n) {
-        column.push_back(default_value_);
-      }
-    }
-  }
-
-  std::string ToString() const {
-    const char kSeparator[] = "//////////////////////////////////////////////";
-    std::stringstream ss;
-    ss << kSeparator << kNewLine;
-    if (title_.size()) {
-      ss << "// CSV of " << title_ << kNewLine;
-    }
-    for (size_t i = 0; i < NumberOfRows(); ++i) {
-      ss << StringifyRow(i);
-    }
-    ss << kSeparator;
-    return ss.str();
-  }
-
-  // All odd elements are removed. Effectively compressing the table in half.
-  void RemoveOddElements() {
-    memory_tracker::RemoveOddElements(&time_values_);
-    for (typename TableData::iterator it = table_data_.begin();
-         it != table_data_.end(); ++it) {
-      memory_tracker::RemoveOddElements(&it->second);
-    }
-  }
-
-  size_t NumberOfRows() const { return time_values_.size(); }
-
- protected:
-  static std::string JoinValues(const std::vector<std::string>& row_values) {
-    std::stringstream ss;
-    for (size_t i = 0; i < row_values.size(); ++i) {
-      ss << kQuote << row_values[i] << kQuote << kDelimiter;
-    }
-    ss << kNewLine;
-    return ss.str();
-  }
-
-  static std::string TimeToMinutesString(base::TimeDelta dt) {
-    double value_minutes = dt.InSecondsF() / 60.;
-    char buff[128];
-    SbStringFormatF(buff, sizeof(buff), "%.2f", value_minutes);
-    return std::string(buff);
-  }
-
-  std::string StringifyRow(size_t index) const {
-    if (index == 0) {
-      // Create header row.
-      std::vector<std::string> column_keys;
-      column_keys.push_back("Time(min)");
-      for (typename TableData::const_iterator it = table_data_.begin();
-           it != table_data_.end(); ++it) {
-        column_keys.push_back(SanitizeCSVKey(it->first));
-      }
-      return JoinValues(column_keys);
-    } else {
-      // Create data row.
-      std::vector<std::string> row_values;
-      row_values.push_back(TimeToMinutesString(time_values_[index]));
-      for (typename TableData::const_iterator it = table_data_.begin();
-           it != table_data_.end(); ++it) {
-        const std::vector<ValueType>& column = it->second;
-        const std::string value_str = ValueToString(column[index]);
-        row_values.push_back(value_str);
-      }
-      return JoinValues(row_values);
-    }
-  }
-
-  std::string title_;
-  ValueType default_value_;
-  std::vector<base::TimeDelta> time_values_;
-  TableData table_data_;
-};
-
-// Useful for tracking values in megabytes.
-class MemoryBytesHistogramCSV : public HistogramTableCSVBase<int64_t> {
- public:
-  MemoryBytesHistogramCSV() : HistogramTableCSVBase<int64_t>(0) {}
-  std::string ValueToString(const int64_t& bytes) const override {
-    return ToMegabyteString(bytes);
-  }
-
-  static std::string ToMegabyteString(int64_t bytes) {
-    double megabytes = static_cast<double>(bytes) / (1024.0 * 1024.0);
-    char buff[128];
-    SbStringFormatF(buff, sizeof(buff), "%.1f", megabytes);
-    return std::string(buff);
-  }
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_HISTOGRAM_TABLE_CSV_BASE_H_
diff --git a/cobalt/browser/memory_tracker/tool/internal_fragmentation_tool.cc b/cobalt/browser/memory_tracker/tool/internal_fragmentation_tool.cc
deleted file mode 100644
index 223af84..0000000
--- a/cobalt/browser/memory_tracker/tool/internal_fragmentation_tool.cc
+++ /dev/null
@@ -1,202 +0,0 @@
-// 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 "cobalt/browser/memory_tracker/tool/internal_fragmentation_tool.h"
-// C++ headers.
-#include <algorithm>
-#include <map>
-#include <set>
-#include <vector>
-// Cobalt headers.
-#include "cobalt/browser/memory_tracker/tool/histogram_table_csv_base.h"
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "cobalt/browser/memory_tracker/tool/util.h"
-#include "nb/bit_cast.h"
-// Starboard headers.
-#include "starboard/configuration_constants.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-namespace {
-
-using nb::analytics::AllocationRecord;
-using nb::analytics::AllocationVisitor;
-using nb::analytics::MemoryTracker;
-
-class FragmentationProcessor : private AllocationVisitor {
- public:
-  explicit FragmentationProcessor(uintptr_t page_size)
-      : page_size_(page_size) {}
-
-  void Process(MemoryTracker* tracker, size_t* allocated_memory_in_pages,
-               size_t* used_memory_in_segments) {
-    memory_segments_.erase(memory_segments_.begin(), memory_segments_.end());
-    *allocated_memory_in_pages = 0;
-    *used_memory_in_segments = 0;
-    tracker->Accept(this);
-
-    // Note that because of the fine course locking used for
-    // the memory tracker, it's accepted that there can be
-    // an occasional overlapping memory segment, where the memory region
-    // was deallocated and then recycled during the segment collection phase.
-    // This will then show up as an overlapping region. This is resolved
-    // by selecting the first memory segment, and discarding any
-    // memory segments that overlap it.
-    // While this can skew results, the rate of overlaps in practice is so low
-    // that we can essentially ignore it without warning the user.
-    std::sort(memory_segments_.begin(), memory_segments_.end());
-    std::vector<Segment> copy_no_overlaps;
-    copy_no_overlaps.reserve(memory_segments_.size());
-    for (const Segment& seg : memory_segments_) {
-      if (copy_no_overlaps.empty() ||
-          !seg.Intersects(copy_no_overlaps.back())) {
-        copy_no_overlaps.push_back(seg);
-      }
-    }
-    memory_segments_.swap(copy_no_overlaps);
-
-    if (!memory_segments_.empty()) {
-      std::set<uintptr_t> page_ids;
-
-      std::vector<Segment> sub_segments;
-      for (const Segment& seg : memory_segments_) {
-        if (!seg.size()) {  // Ignore 0-size segments.
-          continue;
-        }
-        // Use erase() instead of clear(), because it has stronger
-        // guarantees about recycling memory in the vector.
-        sub_segments.erase(sub_segments.begin(), sub_segments.end());
-        // Memory allocation segments may span multiple pages. In this
-        // case we will break them up and store them in sub_segments.
-        seg.SplitAcrossPageBoundaries(page_size_, &sub_segments);
-
-        for (const Segment& sub_seg : sub_segments) {
-          uintptr_t page_id = GetPageId(sub_seg.begin());
-          page_ids.insert(page_id);
-        }
-      }
-      *allocated_memory_in_pages = page_ids.size() * page_size_;
-    }
-    *used_memory_in_segments = CountUsedMemoryInSegments();
-  }
-
- private:
-  // Implements AllocationVisitor::Visitor().
-  bool Visit(const void* memory,
-             const AllocationRecord& alloc_record) override {
-    const char* memory_begin = static_cast<const char*>(memory);
-    const char* memory_end = memory_begin + alloc_record.size;
-    memory_segments_.push_back(Segment(nullptr, memory_begin, memory_end));
-    return true;
-  }
-  uintptr_t GetPageId(const char* ptr) const {
-    return nb::bit_cast<uintptr_t>(ptr) / page_size_;
-  }
-  size_t CountUsedMemoryInSegments() const {
-    if (memory_segments_.empty()) {
-      return 0;
-    }
-    size_t total_bytes = 0;
-    const Segment* prev_segment = nullptr;
-    for (const Segment& seg : memory_segments_) {
-      size_t size = seg.size();
-      if (prev_segment && prev_segment->Intersects(seg)) {
-        // Sanity check - FragmentationProcessor::Process() is expected
-        // to resolve overlapping memory segments that occur from the
-        // concurrent nature of memory collection.
-        SB_NOTREACHED() << "Memory segments intersected!";
-        size = 0;
-      }
-      prev_segment = &seg;
-      total_bytes += size;
-    }
-    return total_bytes;
-  }
-
-  std::vector<Segment> memory_segments_;
-  const uintptr_t page_size_;
-};
-
-}  // namespace.
-
-InternalFragmentationTool::InternalFragmentationTool() {}
-
-InternalFragmentationTool::~InternalFragmentationTool() {}
-
-std::string InternalFragmentationTool::tool_name() const {
-  return "InternalFragmentationTool";
-}
-
-void InternalFragmentationTool::Run(Params* params) {
-  // Run function does almost nothing.
-  params->logger()->Output("InternalFragmentationTool running...\n");
-
-  Timer output_timer(base::TimeDelta::FromSeconds(30));
-  Timer sample_timer(base::TimeDelta::FromMilliseconds(50));
-
-  MemoryBytesHistogramCSV histogram_table;
-  histogram_table.set_title("Internal Fragmentation - Probably undercounts");
-
-  FragmentationProcessor visitor(kSbMemoryPageSize);
-
-  // If we get a finish signal then this will break out of the loop.
-  while (!params->wait_for_finish_signal(250 * kSbTimeMillisecond)) {
-    // LOG CSV.
-    if (output_timer.UpdateAndIsExpired()) {
-      std::stringstream ss;
-      ss << kNewLine << histogram_table.ToString() << kNewLine << kNewLine;
-      params->logger()->Output(ss.str());
-    }
-
-    // ADD A HISTOGRAM SAMPLE.
-    if (sample_timer.UpdateAndIsExpired()) {
-      histogram_table.BeginRow(params->time_since_start());
-
-      size_t allocated_memory_in_pages = 0;
-      size_t used_memory = 0;
-      visitor.Process(params->memory_tracker(), &allocated_memory_in_pages,
-                      &used_memory);
-
-      SB_DCHECK(allocated_memory_in_pages > used_memory)
-          << "allocated_memory_in_pages: " << allocated_memory_in_pages << ","
-          << "used_memory: " << used_memory;
-
-      histogram_table.AddRowValue("TotalReservedCpuMemoryInPages(MB)",
-                                  allocated_memory_in_pages);
-      histogram_table.AddRowValue("TotalCpuMemoryInUse(MB)", used_memory);
-      histogram_table.FinalizeRow();
-    }
-
-    // COMPRESS TABLE WHEN FULL.
-    //
-    // Table is full, therefore eliminate half of the elements.
-    // Reduce sample frequency to match.
-    if (histogram_table.NumberOfRows() >= 100) {
-      // Compression step.
-      histogram_table.RemoveOddElements();
-
-      // By doubling the sampling time this keeps the table linear with
-      // respect to time. If sampling time was not doubled then there
-      // would be time distortion in the graph.
-      sample_timer.ScaleTriggerTime(2.0);
-      sample_timer.Restart();
-    }
-  }
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/internal_fragmentation_tool.h b/cobalt/browser/memory_tracker/tool/internal_fragmentation_tool.h
deleted file mode 100644
index bebd634..0000000
--- a/cobalt/browser/memory_tracker/tool/internal_fragmentation_tool.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// 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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_INTERNAL_FRAGMENTATION_TOOL_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_INTERNAL_FRAGMENTATION_TOOL_H_
-
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-class InternalFragmentationTool : public AbstractTool {
- public:
-  InternalFragmentationTool();
-  ~InternalFragmentationTool() override;
-  // Interface AbstractMemoryTrackerTool
-  std::string tool_name() const override;
-  void Run(Params* params) override;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(InternalFragmentationTool);
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_INTERNAL_FRAGMENTATION_TOOL_H_
diff --git a/cobalt/browser/memory_tracker/tool/leak_finder_tool.cc b/cobalt/browser/memory_tracker/tool/leak_finder_tool.cc
deleted file mode 100644
index 31a89a3..0000000
--- a/cobalt/browser/memory_tracker/tool/leak_finder_tool.cc
+++ /dev/null
@@ -1,476 +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 "cobalt/browser/memory_tracker/tool/leak_finder_tool.h"
-
-#include <algorithm>
-#include <iomanip>
-#include <map>
-#include <utility>
-
-#include "base/timer/timer.h"
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-#include "cobalt/browser/memory_tracker/tool/util.h"
-#include "cobalt/script/util/stack_trace_helpers.h"
-#include "nb/memory_scope.h"
-#include "starboard/common/string.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-// Number of output values to display in the csv.
-const size_t kNumberOfOutputColumns = 40;
-
-LeakFinderTool::LeakFinderTool(StackTraceMode mode)
-    : string_pool_(128),
-      frame_map_(128),
-      callframe_map_(128),
-      stack_trace_mode_(mode) {
-  default_callframe_str_ = &string_pool_.Intern("<Unknown>");
-}
-
-LeakFinderTool::~LeakFinderTool() {
-  frame_map_.Clear();
-  callframe_map_.Clear();
-}
-
-bool LeakFinderTool::IsJavascriptScope(
-    const nb::analytics::CallStack& callstack) {
-  // March through all MemoryScopes in the callstack and check if any of them
-  // contains a javascript scope. If it does return true.
-  for (nb::analytics::CallStack::const_iterator it = callstack.begin();
-       it != callstack.end(); ++it) {
-    const NbMemoryScopeInfo* memory_scope = *it;
-    const bool is_javascript_scope =
-        strstr(memory_scope->memory_scope_name_, "Javascript");
-    if (is_javascript_scope) {
-      return true;
-    }
-  }
-  return false;
-}
-
-void LeakFinderTool::OnMemoryAllocation(
-    const void* memory_block, const nb::analytics::AllocationRecord& record,
-    const nb::analytics::CallStack& callstack) {
-  // When in javascript mode, filter only allocations with "Javascript" in
-  // the memory scope name.
-  if (stack_trace_mode_ == kJavascript) {
-    if (!IsJavascriptScope(callstack)) {
-      return;
-    }
-  }
-
-  // symbol_str can be used as a unique key. The same value of callstack will
-  // always produce the same string pointer.
-  const std::string* symbol_str = GetOrCreateSymbol(callstack);
-  // Track the allocation.
-  if (!callframe_map_.SetIfMissing(memory_block, symbol_str)) {
-    CallFrameMap::EntryHandle entry_handle;
-    callframe_map_.Get(memory_block, &entry_handle);
-
-    const void* ptr = entry_handle.Valid() ? entry_handle.Key() : NULL;
-    entry_handle.ReleaseLockAndInvalidate();
-
-    DCHECK(false) << "Unexpected memory block at " << memory_block
-                  << " already existed as: " << ptr;
-  }
-
-  AllocationFrameMap::EntryHandle entry_handle;
-  frame_map_.GetOrCreate(symbol_str, &entry_handle);
-
-  // While this entry_handle is in use, no other threads
-  // can modify this entry.
-  AllocRec& alloc_rec = entry_handle.ValueMutable();
-  alloc_rec.total_bytes += record.size;
-  alloc_rec.num_allocs++;
-}
-
-void LeakFinderTool::OnMemoryDeallocation(
-    const void* memory_block, const nb::analytics::AllocationRecord& record,
-    const nb::analytics::CallStack& callstack) {
-
-  const std::string* symbol_str = NULL;
-
-  {
-    CallFrameMap::EntryHandle entry_handle;
-    if (!callframe_map_.Get(memory_block, &entry_handle)) {
-      // This happens if the allocation happened before this tool attached
-      // to the memory tracker or if the memory allocation was filtered and
-      // therefore isn't being tracked.
-      return;
-    }
-    symbol_str = entry_handle.Value();
-    callframe_map_.Remove(&entry_handle);
-  }
-
-  // This case can happen if the memory tracker attaches after the allocation.
-  if (!symbol_str) {
-    return;
-  }
-
-  AllocationFrameMap::EntryHandle entry_handle;
-  frame_map_.GetOrCreate(symbol_str, &entry_handle);
-
-  // While entry_handle is in use, no other element can modify
-  // this element.
-  AllocRec& alloc_rec = entry_handle.ValueMutable();
-  alloc_rec.total_bytes -= record.size;
-  alloc_rec.num_allocs--;
-}
-
-std::string LeakFinderTool::tool_name() const {
-  return "MemoryTrackerLeakFinder";
-}
-
-void LeakFinderTool::Run(Params* params) {
-  // Run function does almost nothing.
-  params->logger()->Output("MemoryTrackerLeakFinder running...");
-
-  static const size_t kMaxSamples = 400;
-
-  // This value will decay whenever the buffer fills up and is compressed via
-  // sample elimination.
-  SbTime sample_time = 50;  // 50 microseconds.
-
-  std::vector<base::TimeDelta> time_values;
-  std::map<const std::string*, std::vector<AllocRec> > map_allocations;
-
-  SbTime start_time = SbTimeGetMonotonicNow();
-  Timer output_trigger(base::TimeDelta::FromMinutes(1));
-
-  const double recording_delay_mins = 5.0;
-
-  // Controls how often an update status message is sent to output.
-  Timer output_status_timer(base::TimeDelta::FromSeconds(1));
-
-  while (true) {
-    if (params->wait_for_finish_signal(sample_time)) {
-      break;  // Finish received, break.
-    }
-    SbTime now_time = SbTimeGetMonotonicNow();
-
-    const base::TimeDelta time_since_start =
-        base::Time::FromSbTime(now_time) - base::Time::FromSbTime(start_time);
-
-    // DELAY RECORDING AS STARTUP MEMORY IS INITIALIZED
-    // Cleaner graphs if we wait until after startup.
-    //
-    const double times_since_start_mins = time_since_start.InSecondsF() / 60.0;
-    if (times_since_start_mins < recording_delay_mins) {
-      if (output_status_timer.UpdateAndIsExpired()) {
-        double remaining_time_mins =
-            (recording_delay_mins - times_since_start_mins);
-        std::stringstream ss;
-        ss << "MemoryTrackerLeakFinder starting in " << remaining_time_mins
-           << " minutes.\n";
-        params->logger()->Output(ss.str().c_str());
-      }
-      continue;
-    }
-
-    time_values.push_back(time_since_start);
-
-    // To improve performance, make a copy of the values to a vector on
-    // the stack.
-    std::vector<std::pair<const std::string*, AllocRec> > samples;
-    SampleSnapshot(&samples);
-
-    // Take a snapshot.
-    for (size_t i = 0; i < samples.size(); ++i) {
-      std::pair<const std::string*, AllocRec> sample = samples[i];
-      std::vector<AllocRec>& sample_history = map_allocations[sample.first];
-
-      sample_history.resize(time_values.size());
-      sample_history.back() = sample.second;
-    }
-
-    if (output_trigger.UpdateAndIsExpired() && time_values.size() > 10) {
-      // Timer expired so dump the current information output.
-
-      std::vector<AllocationProfile> alloc_profiles;
-      GenerateTopLeakingAllocationProfiles(time_values, map_allocations,
-                                           &alloc_profiles);
-      if (alloc_profiles.empty()) {
-        params->logger()->Output(
-            "MemoryTrackerLeakFinder: alloc_profiles was "
-            "empty and nothing is written.");
-      } else {
-        if (alloc_profiles.size() > kNumberOfOutputColumns) {
-          alloc_profiles.resize(kNumberOfOutputColumns);
-        }
-
-        std::string csv_str = GenerateCSV(time_values, alloc_profiles);
-        params->logger()->Output(csv_str.c_str());
-      }
-    }
-
-    // Compress the buffer, and modify sample_time so that it's twice as slow.
-    if (time_values.size() >= kMaxSamples) {
-      sample_time *= 2;  // Double the time that it takes to trigger a sample.
-      // Remove every other element in time_values.
-      RemoveOddElements(&time_values);
-
-      // Remove every other element in the samples.
-      for (size_t i = 0; i < samples.size(); ++i) {
-        std::pair<const std::string*, AllocRec> sample = samples[i];
-        std::vector<AllocRec>& sample_history = map_allocations[sample.first];
-        RemoveOddElements(&sample_history);
-      }
-    }
-  }
-}
-
-const std::string* LeakFinderTool::GetOrCreateSymbol(
-    const nb::analytics::CallStack& callstack) {
-  const std::string* symbol_str = NULL;
-
-  // In javascript mode we try and get the javascript symbol. Otherwise
-  // fallback to C++ symbol.
-  if (stack_trace_mode_ == kJavascript) {
-    symbol_str = TryGetJavascriptSymbol();
-    if (symbol_str) {
-      return symbol_str;
-    }
-  }
-
-  symbol_str = GetOrCreateCplusPlusSymbol(callstack);
-  return symbol_str;
-}
-
-const std::string* LeakFinderTool::GetOrCreateCplusPlusSymbol(
-    const nb::analytics::CallStack& callstack) {
-  if (callstack.empty()) {
-    return default_callframe_str_;
-  } else {
-    const NbMemoryScopeInfo* memory_scope = callstack.back();
-
-    const bool skip =
-        strstr(memory_scope->function_name_, "js_malloc") ||
-        strstr(memory_scope->function_name_, "js_realloc") ||
-        strstr(memory_scope->function_name_, "new_");
-
-    // Skip up one callstack because we don't want to track calls to
-    // allocation functions.
-    if (skip && callstack.size() > 1) {
-      memory_scope = callstack[callstack.size() - 2];
-    }
-
-    const char* file_name = BaseNameFast(memory_scope->file_name_);
-
-    // Generates a symbol.
-    // Example:
-    //   "Javascript:Interpreter.cpp(415):RunScript()"
-    char symbol_buff[128];
-    SbStringFormatF(symbol_buff, sizeof(symbol_buff), "%s:%s(%d)::%s()",
-                    memory_scope->memory_scope_name_, file_name,
-                    memory_scope->line_number_, memory_scope->function_name_);
-
-    // Get's a unique pointer to a string containing the symbol. If the symbol
-    // was previously generated then the previous symbol is returned.
-    return &string_pool_.Intern(symbol_buff);
-  }
-}
-
-const std::string* LeakFinderTool::TryGetJavascriptSymbol() {
-  auto* js_stack_gen = script::util::GetThreadLocalStackTraceGenerator();
-  if (!js_stack_gen || !js_stack_gen->Valid()) {
-    return NULL;
-  }
-
-  // Only get one symbol.
-  char buffer[256];
-  if (!js_stack_gen->GenerateStackTraceString(1, buffer, sizeof(buffer))) {
-    return NULL;
-  }
-  const char* file_name = BaseNameFast(buffer);
-  return &string_pool_.Intern(file_name);
-}
-
-void LeakFinderTool::SampleSnapshot(
-    std::vector<std::pair<const std::string*, AllocRec> >* destination) {
-  destination->erase(destination->begin(), destination->end());
-
-  const size_t sample_size = frame_map_.GetSize();
-
-  // Do this locally.
-  destination->reserve(sample_size + 10);
-  frame_map_.CopyToStdVector(destination);
-}
-
-std::string LeakFinderTool::GenerateCSV(
-    const std::vector<base::TimeDelta>& time_values,
-    const std::vector<AllocationProfile>& data) {
-  std::stringstream ss;
-  ss << std::fixed;  // Turn off scientific notation for CSV values.
-  ss << std::setprecision(3);
-  ss << kNewLine << kNewLine;
-
-  // HEADER
-  ss << "// Allocation in megabytes. Keep in mind that only" << kNewLine
-     << "// the N top allocations will be displayed, sorted" << kNewLine
-     << "// by slope steepness. Negative slopping allocations" << kNewLine
-     << "// and allocations that have few blocks may be filtered" << kNewLine
-     << "// out." << kNewLine << kQuote << "Time(min)" << kQuote << kDelimiter;
-  for (size_t i = 0; i < data.size(); ++i) {
-    const AllocationProfile& alloc_profile = data[i];
-    const std::string& name = *alloc_profile.name_;
-    ss << kQuote << name << kQuote << kDelimiter;
-  }
-  ss << kNewLine;
-
-  // BODY
-  for (size_t i = 0; i < time_values.size(); ++i) {
-    for (size_t j = 0; j < data.size(); ++j) {
-      if (j == 0) {
-        double mins = time_values[i].InSecondsF() / 60.f;
-        if (mins < .001) {
-          mins = 0;
-        }
-        ss << mins << kDelimiter;
-      }
-
-      const AllocationProfile& alloc_profile = data[j];
-      const std::vector<AllocRec>& alloc_history =
-          *alloc_profile.alloc_history_;
-
-      double megabytes = static_cast<double>(alloc_history[i].total_bytes) /
-                         static_cast<double>(1024 * 1024);
-
-      DCHECK_EQ(alloc_history.size(), time_values.size());
-      ss << megabytes << kDelimiter;
-    }
-    ss << kNewLine;
-  }
-  ss << kNewLine << kNewLine;
-  ss << "// Object counts." << kNewLine;
-  ss << kQuote << "Time(min)" << kQuote << kDelimiter;
-  for (size_t i = 0; i < data.size(); ++i) {
-    const AllocationProfile& alloc_profile = data[i];
-    const std::string& name = *alloc_profile.name_;
-    ss << kQuote << name << kQuote << kDelimiter;
-  }
-  ss << kNewLine;
-  for (size_t i = 0; i < time_values.size(); ++i) {
-    for (size_t j = 0; j < data.size(); ++j) {
-      if (j == 0) {
-        double mins = time_values[i].InSecondsF() / 60.f;
-        if (mins < .001) {
-          mins = 0;
-        }
-        ss << mins << kDelimiter;
-      }
-      const AllocationProfile& alloc_profile = data[j];
-      const std::vector<AllocRec>& alloc_history =
-          *alloc_profile.alloc_history_;
-      DCHECK_EQ(alloc_history.size(), time_values.size());
-      ss << alloc_history[i].num_allocs << kDelimiter;
-    }
-    ss << kNewLine;
-  }
-
-  ss << kNewLine << kNewLine;
-  return ss.str();
-}
-
-void LeakFinderTool::GenerateTopLeakingAllocationProfiles(
-    const std::vector<base::TimeDelta>& time_values, const MapSamples& samples,
-    std::vector<AllocationProfile>* destination) {
-  // GENERATE LINEAR REGRESSION LINE
-  // first value is time in microseconds.
-  // second value is total_bytes.
-  std::vector<std::pair<int64_t, int64_t> > sample_data;
-
-  typedef std::map<const std::string*, SlopeYIntercept> LinearRegressionMap;
-  LinearRegressionMap linear_regression_map;
-
-  std::vector<AllocationProfile> allocation_profiles;
-
-  for (MapSamples::const_iterator it = samples.begin(); it != samples.end();
-       ++it) {
-    const std::string* allocation_name = it->first;
-    const std::vector<AllocRec>& allocation_samples = it->second;
-
-    if (allocation_samples.empty()) {
-      continue;
-    }
-
-    // Filter out allocations records that have low number of allocations.
-    if (allocation_samples.back().num_allocs < 10) {
-      continue;
-    }
-
-    // Filter out allocations that are insignificant.
-    int64_t largest_allocation_sample = 0;
-    const int64_t kMinAllocationSize = 1024 * 64;
-    for (size_t i = 0; i < allocation_samples.size(); ++i) {
-      int64_t bytes = allocation_samples[i].total_bytes;
-      largest_allocation_sample = std::max(largest_allocation_sample, bytes);
-    }
-    if (largest_allocation_sample < kMinAllocationSize) {
-      continue;
-    }
-
-    // Filter out allocations where there is no growth between first quartile
-    // and final output.
-    const AllocRec& first_quartile_sample =
-        allocation_samples[allocation_samples.size() / 4];
-    const AllocRec& final_sample = allocation_samples.back();
-
-    const double increase_ratio =
-        static_cast<double>(final_sample.total_bytes) /
-        static_cast<double>(first_quartile_sample.total_bytes);
-
-    // 5% threshold of increase to be qualified as a lead.
-    static const double kMinIncreaseThreshold = .05;
-
-    // If the increase between first quartile and final sample less than 5%
-    // then skip.
-    if (increase_ratio < kMinIncreaseThreshold) {
-      continue;
-    }
-
-    sample_data.clear();  // Recycle.
-    for (size_t i = 0; i < time_values.size(); ++i) {
-      std::pair<int64_t, int64_t> datum(time_values[i].InMicroseconds(),
-                                        allocation_samples[i].total_bytes);
-      sample_data.push_back(datum);
-    }
-
-    double slope = 0;
-    double y_intercept = 0;
-    bool valid = GetLinearFit(sample_data.begin(), sample_data.end(), &slope,
-                              &y_intercept);
-    DCHECK(valid);
-    linear_regression_map[allocation_name] =
-        SlopeYIntercept(slope, y_intercept);
-    AllocationProfile alloc_profile(allocation_name, &allocation_samples, slope,
-                                    y_intercept);
-    alloc_profile.leak_potential_ =
-        allocation_samples.back().total_bytes * slope;
-    allocation_profiles.push_back(alloc_profile);
-  }
-
-  std::sort(allocation_profiles.begin(), allocation_profiles.end(),
-            AllocationProfile::CompareLeakPotential);
-  // Biggest one first.
-  std::reverse(allocation_profiles.begin(), allocation_profiles.end());
-  *destination = allocation_profiles;
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/leak_finder_tool.h b/cobalt/browser/memory_tracker/tool/leak_finder_tool.h
deleted file mode 100644
index 66f42f5..0000000
--- a/cobalt/browser/memory_tracker/tool/leak_finder_tool.h
+++ /dev/null
@@ -1,163 +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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_LEAK_FINDER_TOOL_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_LEAK_FINDER_TOOL_H_
-
-#include <map>
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "base/compiler_specific.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-#include "nb/analytics/memory_tracker.h"
-#include "nb/concurrent_map.h"
-#include "nb/hash.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-// Records allocations and outputs leaks as a CSV. Each column will
-// have an associated symbol.
-class LeakFinderTool : public AbstractTool,
-                       public nb::analytics::MemoryTrackerDebugCallback {
- public:
-  enum StackTraceMode {
-    // Always get the C++ version of the stack trace.
-    kCPlusPlus,
-    // Whenever possible, get the javascript stack trace,
-    // else fallback to CPlusPlus.
-    kJavascript,
-  };
-
-  explicit LeakFinderTool(StackTraceMode pref);
-  virtual ~LeakFinderTool();
-
-  // OnMemoryAllocation() and OnMemoryDeallocation() are part of
-  // class MemoryTrackerDebugCallback.
-  void OnMemoryAllocation(const void* memory_block,
-                          const nb::analytics::AllocationRecord& record,
-                          const nb::analytics::CallStack& callstack) override;
-
-  void OnMemoryDeallocation(const void* memory_block,
-                            const nb::analytics::AllocationRecord& record,
-                            const nb::analytics::CallStack& callstack) override;
-
-  // Interface AbstractMemoryTrackerTool
-  std::string tool_name() const override;
-  void Run(Params* params) override;
-
-  const std::string* GetOrCreateSymbol(
-      const nb::analytics::CallStack& callstack);
-
-  const std::string* TryGetJavascriptSymbol();
-  const std::string* GetOrCreateCplusPlusSymbol(
-      const nb::analytics::CallStack& callstack);
-
- private:
-  struct AllocRec;
-  // A map from callsite -> allocation size.
-  // typedef std::map<const std::string*, AllocRec> AllocationFrameMap;
-  typedef nb::ConcurrentMap<const std::string*, AllocRec,
-                            nb::PODHasher<const std::string*> >
-      AllocationFrameMap;
-
-  // A map of memory -> callsite.
-  // This keeps track of what callsites belong to which allocations.
-  // typedef std::map<const void*, const std::string*> CallFrameMap;
-  //
-  typedef nb::ConcurrentMap<const void*, const std::string*,
-                            nb::PODHasher<const std::string*> >
-      CallFrameMap;
-
-  // A map from callsite -> allocation data.
-  typedef std::map<const std::string*, std::vector<AllocRec> > MapSamples;
-  // A value type for holding a slope and Y-intercept.
-  typedef std::pair<double, double> SlopeYIntercept;
-  // An AllocationRecord.
-  struct AllocRec {
-    AllocRec() : total_bytes(0), num_allocs(0) {}
-    AllocRec(const AllocRec& other)
-        : total_bytes(other.total_bytes), num_allocs(other.num_allocs) {}
-    AllocRec& operator=(const AllocRec& other) {
-      total_bytes = other.total_bytes;
-      num_allocs = other.num_allocs;
-      return *this;
-    }
-    int64_t total_bytes;
-    int32_t num_allocs;
-  };
-
-  // This data structure is used to for sorting leaks. The important variable
-  // is |leak_potential|, which represents how likely this AllocationProfile
-  // is a leak.
-  struct AllocationProfile {
-    AllocationProfile()
-        : name_(NULL),
-          alloc_history_(NULL),
-          slope_(0),
-          y_intercept_(0),
-          leak_potential_(0) {}
-
-    AllocationProfile(const std::string* name,
-                      const std::vector<AllocRec>* alloc_history, double slope,
-                      double y_intercept)
-        : name_(name),
-          alloc_history_(alloc_history),
-          slope_(slope),
-          y_intercept_(y_intercept),
-          leak_potential_(0) {}
-    const std::string* name_;
-    const std::vector<AllocRec>* alloc_history_;
-    // Linear regression data.
-    double slope_;
-    double y_intercept_;
-
-    // This this value is set externally. Higher values indicate higher chance
-    // that this is a leak.
-    double leak_potential_;
-
-    static bool CompareLeakPotential(const AllocationProfile& a,
-                                     const AllocationProfile& b) {
-      return a.leak_potential_ < b.leak_potential_;
-    }
-  };
-
-  static std::string GenerateCSV(
-      const std::vector<base::TimeDelta>& time_values,
-      const std::vector<AllocationProfile>& data);
-
-  void SampleSnapshot(
-      std::vector<std::pair<const std::string*, AllocRec> >* destination);
-
-  static void GenerateTopLeakingAllocationProfiles(
-      const std::vector<base::TimeDelta>& time_values,
-      const MapSamples& samples, std::vector<AllocationProfile>* destination);
-
-  static bool IsJavascriptScope(const nb::analytics::CallStack& callstack);
-
-  const std::string* default_callframe_str_;
-  nb::ConcurrentStringInterner string_pool_;
-  AllocationFrameMap frame_map_;
-  CallFrameMap callframe_map_;
-  StackTraceMode stack_trace_mode_;
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_LEAK_FINDER_TOOL_H_
diff --git a/cobalt/browser/memory_tracker/tool/log_writer_tool.cc b/cobalt/browser/memory_tracker/tool/log_writer_tool.cc
deleted file mode 100644
index b8dd168..0000000
--- a/cobalt/browser/memory_tracker/tool/log_writer_tool.cc
+++ /dev/null
@@ -1,171 +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 "cobalt/browser/memory_tracker/tool/log_writer_tool.h"
-
-#include <algorithm>
-
-#include "base/time/time.h"
-#include "cobalt/browser/memory_tracker/tool/buffered_file_writer.h"
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "starboard/client_porting/poem/string_poem.h"
-#include "starboard/common/string.h"
-#include "starboard/configuration.h"
-#include "starboard/configuration_constants.h"
-#include "starboard/types.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-LogWriterTool::LogWriterTool() : start_time_(NowTime()) {
-  buffered_file_writer_.reset(new BufferedFileWriter(MemoryLogPath()));
-  InitAndRegisterMemoryReporter();
-}
-
-LogWriterTool::~LogWriterTool() {
-  // No locks are used for the thread reporter, so when it's set to null
-  // we allow one second for any suspended threads to run through and finish
-  // their reporting.
-  SbMemorySetReporter(NULL);
-  SbThreadSleep(kSbTimeSecond);
-  buffered_file_writer_.reset(NULL);
-}
-
-std::string LogWriterTool::tool_name() const {
-  return "MemoryTrackerLogWriter";
-}
-
-void LogWriterTool::Run(Params* params) {
-  // Run function does almost nothing.
-  params->logger()->Output("MemoryTrackerLogWriter running...");
-}
-
-void LogWriterTool::OnMemoryAllocation(const void* memory_block, size_t size) {
-  void* addresses[kMaxStackSize] = {};
-  // Though the SbSystemGetStack API documentation does not specify any possible
-  // negative return values, we take no chance.
-  const size_t count = std::max(SbSystemGetStack(addresses, kMaxStackSize), 0);
-
-  const size_t n = 256;
-  char buff[n] = {0};
-  size_t buff_pos = 0;
-
-  int time_since_start_ms = GetTimeSinceStartMs();
-  // Writes "+ <ALLOCATION ADDRESS> <size> <time>"
-  int bytes_written =
-      SbStringFormatF(buff, sizeof(buff), "+ %" PRIXPTR " %x %d",
-                      reinterpret_cast<uintptr_t>(memory_block),
-                      static_cast<unsigned int>(size), time_since_start_ms);
-
-  buff_pos += bytes_written;
-  const size_t end_index = std::min(count, kStartIndex + kNumAddressPrints);
-
-  // For each of the stack addresses that we care about, concat them to the
-  // buffer. This was originally written to do multiple stack addresses but
-  // this tends to overflow on some lower platforms so it's possible that
-  // this loop only iterates once.
-  for (size_t i = kStartIndex; i < end_index; ++i) {
-    void* p = addresses[i];
-    bytes_written =
-        SbStringFormatF(buff + buff_pos, sizeof(buff) - buff_pos,
-                        " %" PRIXPTR "", reinterpret_cast<uintptr_t>(p));
-    DCHECK_GE(bytes_written, 0);
-
-    if (bytes_written < 0) {
-      DCHECK(false) << "Error occurred while writing string.";
-      continue;
-    }
-
-    buff_pos += static_cast<size_t>(bytes_written);
-  }
-  // Adds a "\n" at the end.
-  starboard::strlcat(buff + buff_pos, "\n", static_cast<int>(n - buff_pos));
-  buffered_file_writer_->Append(buff, strlen(buff));
-}
-
-void LogWriterTool::OnMemoryDeallocation(const void* memory_block) {
-  const size_t n = 256;
-  char buff[n] = {0};
-  // Writes "- <ADDRESS OF ALLOCATION> \n"
-  SbStringFormatF(buff, sizeof(buff), "- %" PRIXPTR "\n",
-                  reinterpret_cast<uintptr_t>(memory_block));
-  buffered_file_writer_->Append(buff, strlen(buff));
-}
-
-void LogWriterTool::OnAlloc(void* context, const void* memory, size_t size) {
-  LogWriterTool* self = static_cast<LogWriterTool*>(context);
-  self->OnMemoryAllocation(memory, size);
-}
-
-void LogWriterTool::OnDealloc(void* context, const void* memory) {
-  LogWriterTool* self = static_cast<LogWriterTool*>(context);
-  self->OnMemoryDeallocation(memory);
-}
-
-void LogWriterTool::OnMapMemory(void* context, const void* memory,
-                                size_t size) {
-  LogWriterTool* self = static_cast<LogWriterTool*>(context);
-  self->OnMemoryAllocation(memory, size);
-}
-
-void LogWriterTool::OnUnMapMemory(void* context, const void* memory,
-                                  size_t size) {
-  LogWriterTool* self = static_cast<LogWriterTool*>(context);
-  self->OnMemoryDeallocation(memory);
-}
-
-std::string LogWriterTool::MemoryLogPath() {
-  char file_name_buff[2048] = {};
-  SbSystemGetPath(kSbSystemPathDebugOutputDirectory, file_name_buff,
-                  arraysize(file_name_buff));
-  std::string path(file_name_buff);
-  if (!path.empty()) {  // Protect against a dangling "/" at end.
-    const int back_idx_signed = static_cast<int>(path.length()) - 1;
-    if (back_idx_signed >= 0) {
-      const size_t idx = back_idx_signed;
-      if (path[idx] == kSbFileSepChar) {
-        path.erase(idx);
-      }
-    }
-  }
-  path.push_back(kSbFileSepChar);
-  path.append("memory_log.txt");
-  return path;
-}
-
-base::TimeTicks LogWriterTool::NowTime() {
-  // NowFromSystemTime() is slower but more accurate. However it might
-  // be useful to use the faster but less accurate version if there is
-  // a speedup.
-  return base::TimeTicks::Now();
-}
-
-int LogWriterTool::GetTimeSinceStartMs() const {
-  base::TimeDelta dt = NowTime() - start_time_;
-  return static_cast<int>(dt.InMilliseconds());
-}
-
-void LogWriterTool::InitAndRegisterMemoryReporter() {
-  DCHECK(!memory_reporter_.get()) << "Memory Reporter already registered.";
-
-  SbMemoryReporter mem_reporter = {OnAlloc, OnDealloc, OnMapMemory,
-                                   OnUnMapMemory, this};
-  memory_reporter_.reset(new SbMemoryReporter(mem_reporter));
-  SbMemorySetReporter(memory_reporter_.get());
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/log_writer_tool.h b/cobalt/browser/memory_tracker/tool/log_writer_tool.h
deleted file mode 100644
index dfd7b42..0000000
--- a/cobalt/browser/memory_tracker/tool/log_writer_tool.h
+++ /dev/null
@@ -1,74 +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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_LOG_WRITER_TOOL_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_LOG_WRITER_TOOL_H_
-
-#include <memory>
-#include <string>
-
-#include "base/compiler_specific.h"
-#include "base/time/time.h"
-#include "cobalt/browser/memory_tracker/tool/buffered_file_writer.h"
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-#include "starboard/memory_reporter.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-class BufferedFileWriter;
-
-// Outputs memory_log.txt to the output log location. This log contains
-// allocations with a stack trace (non-symbolized) and deallocations without
-// a stack.
-class LogWriterTool : public AbstractTool {
- public:
-  LogWriterTool();
-  virtual ~LogWriterTool();
-
-  // Interface AbstractMemoryTrackerTool
-  std::string tool_name() const override;
-  void Run(Params* params) override;
-
-  void OnMemoryAllocation(const void* memory_block, size_t size);
-  void OnMemoryDeallocation(const void* memory_block);
-
- private:
-  // Callbacks for MemoryReporter
-  static void OnAlloc(void* context, const void* memory, size_t size);
-  static void OnDealloc(void* context, const void* memory);
-  static void OnMapMemory(void* context, const void* memory, size_t size);
-  static void OnUnMapMemory(void* context, const void* memory, size_t size);
-  static std::string MemoryLogPath();
-
-  static base::TimeTicks NowTime();
-  static const size_t kStartIndex = 5;
-  static const size_t kNumAddressPrints = 1;
-  static const size_t kMaxStackSize = 10;
-
-  int GetTimeSinceStartMs() const;
-  void InitAndRegisterMemoryReporter();
-
-  base::TimeTicks start_time_;
-  std::unique_ptr<SbMemoryReporter> memory_reporter_;
-  std::unique_ptr<BufferedFileWriter> buffered_file_writer_;
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_LOG_WRITER_TOOL_H_
diff --git a/cobalt/browser/memory_tracker/tool/malloc_logger_tool.cc b/cobalt/browser/memory_tracker/tool/malloc_logger_tool.cc
deleted file mode 100644
index 1bae210..0000000
--- a/cobalt/browser/memory_tracker/tool/malloc_logger_tool.cc
+++ /dev/null
@@ -1,204 +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 "cobalt/browser/memory_tracker/tool/malloc_logger_tool.h"
-
-#include <algorithm>
-
-#include "base/time/time.h"
-#include "cobalt/base/c_val.h"
-#include "cobalt/browser/memory_tracker/tool/buffered_file_writer.h"
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "cobalt/browser/memory_tracker/tool/util.h"
-#include "nb/memory_scope.h"
-#include "starboard/common/string.h"
-#include "starboard/types.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-namespace {
-const int kAllocationRecord = 1;
-const int kDeallocationRecord = 0;
-const size_t kStartIndex = 5;
-const size_t kNumAddressPrints = 2;
-const size_t kMaxStackSize = 10;
-const size_t kRecordLimit = 1024;
-const NbMemoryScopeInfo kEmptyCallstackMemoryScopeInfo = {nullptr, "-", "-",
-                                                          0,       "-", true};
-}  // namespace
-
-MallocLoggerTool::MallocLoggerTool()
-    : start_time_(NowTime()),
-      atomic_counter_(0),
-      atomic_used_memory_(SbSystemGetUsedCPUMemory()) {
-  buffered_file_writer_.reset(new BufferedFileWriter(MemoryLogPath()));
-}
-
-MallocLoggerTool::~MallocLoggerTool() {
-  // No locks are used for the thread reporter, so when it's set to null
-  // we allow one second for any suspended threads to run through and finish
-  // their reporting.
-  SbMemorySetReporter(NULL);
-  SbThreadSleep(kSbTimeSecond);
-  buffered_file_writer_.reset(NULL);
-}
-
-std::string MallocLoggerTool::tool_name() const {
-  return "MemoryTrackerMallocLogger";
-}
-
-void MallocLoggerTool::Run(Params* params) {
-  // Update malloc stats every second
-  params->logger()->Output("MemoryTrackerMallocLogger running...");
-
-  // There are some memory allocations which do not get tracked.
-  // Those allocations show up as fragmentation.
-  // It has been empirically observed that a majority (98%+) of these
-  // untracked allocations happen in the first 20 seconds of Cobalt runtime.
-  //
-  // Also, there is minimal external fragmentation (< 1 MB) during this initial
-  // period.
-  //
-  // The following piece of code resets atomic_used_memory_ at the 20 second
-  // mark, to compensate for the deviation due to untracked memory.
-  base::TimeDelta current_sample_interval = base::TimeDelta::FromSeconds(20);
-  if (!params->wait_for_finish_signal(current_sample_interval.ToSbTime())) {
-    atomic_used_memory_.store(SbSystemGetUsedCPUMemory());
-  }
-
-  // Export fragmentation as a CVal on HUD.
-  base::CVal<base::cval::SizeInBytes> memory_fragmentation(
-      "Memory.CPU.Fragmentation", base::cval::SizeInBytes(0),
-      "Memory Fragmentation");
-
-  // Update CVal every 5 seconds
-  current_sample_interval = base::TimeDelta::FromSeconds(5);
-  int64_t allocated_memory = 0;
-  int64_t used_memory = 0;
-  while (!params->wait_for_finish_signal(current_sample_interval.ToSbTime())) {
-    allocated_memory = SbSystemGetUsedCPUMemory();
-    used_memory = atomic_used_memory_.load();
-    memory_fragmentation = static_cast<uint64>(
-        std::max(allocated_memory - used_memory, static_cast<int64_t>(0)));
-  }
-}
-
-void MallocLoggerTool::LogRecord(const void* memory_block,
-                                 const nb::analytics::AllocationRecord& record,
-                                 const nb::analytics::CallStack& callstack,
-                                 int type) {
-  const int log_counter = atomic_counter_.increment();
-  const int64_t used_memory = atomic_used_memory_.load();
-  const int64_t allocated_memory = SbSystemGetUsedCPUMemory();
-  const int time_since_start_ms = GetTimeSinceStartMs();
-  char buff[kRecordLimit] = {0};
-  size_t buff_pos = 0;
-  void* addresses[kMaxStackSize];
-
-  const NbMemoryScopeInfo* memory_scope;
-  if (callstack.empty()) {
-    memory_scope = &kEmptyCallstackMemoryScopeInfo;
-  } else {
-    memory_scope = callstack.back();
-  }
-
-  int bytes_written = SbStringFormatF(
-      buff, sizeof(buff),
-      "%u,%d,%zd,\"%s\",%d,%s,%d,%" PRId64 ",%" PRId64 ",%" PRIXPTR ",\"",
-      log_counter, type, record.size, memory_scope->file_name_,
-      memory_scope->line_number_, memory_scope->function_name_,
-      time_since_start_ms, allocated_memory, used_memory,
-      reinterpret_cast<uintptr_t>(memory_block));
-
-  buff_pos += static_cast<size_t>(bytes_written);
-  const size_t count = std::max(SbSystemGetStack(addresses, kMaxStackSize), 0);
-  const size_t end_index = std::min(count, kStartIndex + kNumAddressPrints);
-  // For each of the stack addresses that we care about, concat them to the
-  // buffer. This was originally written to do multiple stack addresses but
-  // this tends to overflow on some lower platforms so it's possible that
-  // this loop only iterates once.
-  for (size_t i = kStartIndex; i < end_index; ++i) {
-    void* p = addresses[i];
-    bytes_written =
-        SbStringFormatF(buff + buff_pos, kRecordLimit - buff_pos,
-                        ",%" PRIXPTR "", reinterpret_cast<uintptr_t>(p));
-    DCHECK_GE(bytes_written, 0);
-    buff_pos += static_cast<size_t>(bytes_written);
-  }
-
-  // Adds a "\n" at the end.
-  bytes_written = starboard::strlcat(buff + buff_pos, "\"\n",
-                                     static_cast<int>(kRecordLimit - buff_pos));
-  buff_pos += bytes_written;
-  buffered_file_writer_->Append(buff, buff_pos);
-}
-
-void MallocLoggerTool::OnMemoryAllocation(
-    const void* memory_block, const nb::analytics::AllocationRecord& record,
-    const nb::analytics::CallStack& callstack) {
-  atomic_used_memory_.fetch_add(record.size);
-  LogRecord(memory_block, record, callstack, kAllocationRecord);
-}
-
-void MallocLoggerTool::OnMemoryDeallocation(
-    const void* memory_block, const nb::analytics::AllocationRecord& record,
-    const nb::analytics::CallStack& callstack) {
-  atomic_used_memory_.fetch_sub(record.size);
-  LogRecord(memory_block, record, callstack, kDeallocationRecord);
-}
-
-std::string MallocLoggerTool::MemoryLogPath() {
-  char file_name_buff[2048] = {};
-  SbSystemGetPath(kSbSystemPathDebugOutputDirectory, file_name_buff,
-                  arraysize(file_name_buff));
-  std::string path(file_name_buff);
-  if (!path.empty()) {  // Protect against a dangling "/" at end.
-    const int back_idx_signed = static_cast<int>(path.length()) - 1;
-    if (back_idx_signed >= 0) {
-      const size_t idx = back_idx_signed;
-      if (path[idx] == '/') {
-        path.erase(idx);
-      }
-    }
-  }
-
-  base::Time time = base::Time::Now();
-  base::Time::Exploded exploded;
-  time.LocalExplode(&exploded);
-
-  std::stringstream ss;
-  ss << "/memory_log_" << exploded.year << "-" << exploded.month << "-"
-     << exploded.day_of_month << ":" << exploded.hour << "-" << exploded.minute
-     << "-" << exploded.second << ".csv";
-  path.append(ss.str());
-  return path;
-}
-
-base::TimeTicks MallocLoggerTool::NowTime() {
-  // NowFromSystemTime() is slower but more accurate. However it might
-  // be useful to use the faster but less accurate version if there is
-  // a speedup.
-  return base::TimeTicks::Now();
-}
-
-int MallocLoggerTool::GetTimeSinceStartMs() const {
-  base::TimeDelta dt = NowTime() - start_time_;
-  return static_cast<int>(dt.InMilliseconds());
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/malloc_logger_tool.h b/cobalt/browser/memory_tracker/tool/malloc_logger_tool.h
deleted file mode 100644
index 2086d79..0000000
--- a/cobalt/browser/memory_tracker/tool/malloc_logger_tool.h
+++ /dev/null
@@ -1,79 +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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_MALLOC_LOGGER_TOOL_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_MALLOC_LOGGER_TOOL_H_
-
-#include <memory>
-#include <string>
-
-#include "base/compiler_specific.h"
-#include "base/time/time.h"
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-#include "nb/memory_scope.h"
-#include "starboard/common/atomic.h"
-#include "starboard/memory_reporter.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-class BufferedFileWriter;
-
-// Outputs memory_log_<time_stamp>.csv to the output log location. This log
-// contains allocations and deallocations with a non-symbolized stack trace.
-class MallocLoggerTool : public AbstractTool,
-                         public nb::analytics::MemoryTrackerDebugCallback {
- public:
-  MallocLoggerTool();
-  virtual ~MallocLoggerTool();
-
-  // Interface AbstractMemoryTrackerTool
-  std::string tool_name() const override;
-  void Run(Params* params) override;
-
-  // OnMemoryAllocation() and OnMemoryDeallocation() are part of
-  // class MemoryTrackerDebugCallback.
-  void OnMemoryAllocation(const void* memory_block,
-                          const nb::analytics::AllocationRecord& record,
-                          const nb::analytics::CallStack& callstack) override;
-
-  void OnMemoryDeallocation(const void* memory_block,
-                            const nb::analytics::AllocationRecord& record,
-                            const nb::analytics::CallStack& callstack) override;
-
-  // Method to obtain allocation, stack information and generate records
-  void LogRecord(const void* memory_block,
-                 const nb::analytics::AllocationRecord& record,
-                 const nb::analytics::CallStack& callstack, const int type);
-
- private:
-  static std::string MemoryLogPath();
-  static base::TimeTicks NowTime();
-
-  int GetTimeSinceStartMs() const;
-
-  base::TimeTicks start_time_;
-  std::unique_ptr<SbMemoryReporter> memory_reporter_;
-  std::unique_ptr<BufferedFileWriter> buffered_file_writer_;
-  starboard::atomic_int32_t atomic_counter_;
-  starboard::atomic_int64_t atomic_used_memory_;
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_MALLOC_LOGGER_TOOL_H_
diff --git a/cobalt/browser/memory_tracker/tool/malloc_stats_tool.cc b/cobalt/browser/memory_tracker/tool/malloc_stats_tool.cc
deleted file mode 100644
index bbb7e58..0000000
--- a/cobalt/browser/memory_tracker/tool/malloc_stats_tool.cc
+++ /dev/null
@@ -1,90 +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 "cobalt/browser/memory_tracker/tool/malloc_stats_tool.h"
-
-#include <string>
-#include <vector>
-
-#include "cobalt/browser/memory_tracker/tool/histogram_table_csv_base.h"
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-#include "nb/analytics/memory_tracker.h"
-#include "starboard/common/string.h"
-#include "starboard/types.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-MallocStatsTool::MallocStatsTool() {}
-
-std::string MallocStatsTool::tool_name() const { return "MallocStatsTool"; }
-
-void MallocStatsTool::Run(Params* params) {
-  params->logger()->Output("MallocStatsTool running...\n");
-
-  Timer output_timer(base::TimeDelta::FromSeconds(30));
-  Timer sample_timer(base::TimeDelta::FromMilliseconds(50));
-
-  MemoryBytesHistogramCSV histogram_table;
-  histogram_table.set_title("Malloc Stats");
-
-  // If we get a finish signal then this will break out of the loop.
-  while (!params->wait_for_finish_signal(250 * kSbTimeMillisecond)) {
-    // LOG CSV.
-    if (output_timer.UpdateAndIsExpired()) {
-      std::stringstream ss;
-      ss << kNewLine << histogram_table.ToString() << kNewLine << kNewLine;
-      params->logger()->Output(ss.str());
-    }
-
-    // ADD A HISTOGRAM SAMPLE.
-    if (sample_timer.UpdateAndIsExpired()) {
-      // Take a sample.
-      nb::analytics::MemoryStats memory_stats =
-          nb::analytics::GetProcessMemoryStats();
-
-      histogram_table.BeginRow(params->time_since_start());
-      histogram_table.AddRowValue("TotalCpuMemory(MB)",
-                                  memory_stats.total_cpu_memory);
-      histogram_table.AddRowValue("UsedCpuMemory(MB)",
-                                  memory_stats.used_cpu_memory);
-      histogram_table.AddRowValue("TotalGpuMemory(MB)",
-                                  memory_stats.total_gpu_memory);
-      histogram_table.AddRowValue("UsedGpuMemory(MB)",
-                                  memory_stats.used_gpu_memory);
-      histogram_table.FinalizeRow();
-    }
-
-    // COMPRESS TABLE WHEN FULL.
-    //
-    // Table is full, therefore eliminate half of the elements.
-    // Reduce sample frequency to match.
-    if (histogram_table.NumberOfRows() >= 100) {
-      // Compression step.
-      histogram_table.RemoveOddElements();
-
-      // By double the sampling time this keeps the table linear with
-      // respect to time. If sampling time was not doubled then there
-      // would be time distortion in the graph.
-      sample_timer.ScaleTriggerTime(2.0);
-      sample_timer.Restart();
-    }
-  }
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/malloc_stats_tool.h b/cobalt/browser/memory_tracker/tool/malloc_stats_tool.h
deleted file mode 100644
index 0d16bd7..0000000
--- a/cobalt/browser/memory_tracker/tool/malloc_stats_tool.h
+++ /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.
-
-#ifndef COBALT_BROWSER_MEMORY_TRACKER_TOOL_MALLOC_STATS_TOOL_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_MALLOC_STATS_TOOL_H_
-
-#include <string>
-
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-// Generates a CSV table of the memory stats. This tool does not use
-// per-allocation tracking and therefore has a lower memory footprint than
-// most other tools.
-class MallocStatsTool : public AbstractTool {
- public:
-  MallocStatsTool();
-  std::string tool_name() const override;
-  void Run(Params* params) override;
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_MALLOC_STATS_TOOL_H_
diff --git a/cobalt/browser/memory_tracker/tool/memory_size_binner_tool.cc b/cobalt/browser/memory_tracker/tool/memory_size_binner_tool.cc
deleted file mode 100644
index 709d88a..0000000
--- a/cobalt/browser/memory_tracker/tool/memory_size_binner_tool.cc
+++ /dev/null
@@ -1,111 +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 "cobalt/browser/memory_tracker/tool/memory_size_binner_tool.h"
-
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "base/threading/platform_thread.h"
-#include "base/time/time.h"
-#include "cobalt/base/c_val.h"
-#include "cobalt/browser/memory_tracker/tool/util.h"
-#include "nb/analytics/memory_tracker.h"
-#include "nb/analytics/memory_tracker_helpers.h"
-#include "starboard/common/log.h"
-#include "starboard/types.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-namespace {
-
-const nb::analytics::AllocationGroup* FindAllocationGroup(
-    const std::string& name, nb::analytics::MemoryTracker* memory_tracker) {
-  std::vector<const nb::analytics::AllocationGroup*> groups;
-  memory_tracker->GetAllocationGroups(&groups);
-  // Find by exact string match.
-  for (size_t i = 0; i < groups.size(); ++i) {
-    const nb::analytics::AllocationGroup* group = groups[i];
-    if (group->name().compare(name) == 0) {
-      return group;
-    }
-  }
-  return NULL;
-}
-}  // namespace.
-
-MemorySizeBinnerTool::MemorySizeBinnerTool(const std::string& memory_scope_name)
-    : memory_scope_name_(memory_scope_name) {}
-
-void MemorySizeBinnerTool::Run(Params* params) {
-  const nb::analytics::AllocationGroup* target_group = NULL;
-
-  while (!params->finished()) {
-    if (target_group == NULL && !memory_scope_name_.empty()) {
-      target_group =
-          FindAllocationGroup(memory_scope_name_, params->memory_tracker());
-    }
-
-    std::stringstream ss;
-    ss.precision(2);
-    if (target_group || memory_scope_name_.empty()) {
-      AllocationSizeBinner visitor_binner = AllocationSizeBinner(target_group);
-      params->memory_tracker()->Accept(&visitor_binner);
-
-      size_t min_size = 0;
-      size_t max_size = 0;
-
-      visitor_binner.GetLargestSizeRange(&min_size, &max_size);
-
-      FindTopSizes top_size_visitor =
-          FindTopSizes(min_size, max_size, target_group);
-      params->memory_tracker()->Accept(&top_size_visitor);
-
-      ss << kNewLine;
-      ss << "TimeNow " << params->TimeInMinutesString() << " (minutes):";
-      ss << kNewLine;
-      if (!memory_scope_name_.empty()) {
-        ss << "Tracking Memory Scope \"" << memory_scope_name_ << "\", ";
-      } else {
-        ss << "Tracking whole program, ";
-      }
-      ss << "first row is allocation size range, second row is number of "
-         << kNewLine << "allocations in that range." << kNewLine;
-      ss << visitor_binner.ToCSVString();
-      ss << kNewLine;
-      ss << "Largest allocation range: \"" << min_size << "..." << max_size
-         << "\"" << kNewLine;
-      ss << "Printing out top allocations from this range: " << kNewLine;
-      ss << top_size_visitor.ToString(5) << kNewLine;
-    } else {
-      ss << "No allocations for \"" << memory_scope_name_ << "\".";
-    }
-
-    params->logger()->Output(ss.str().c_str());
-    params->logger()->Flush();
-
-    // Sleep until the next sample.
-    base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1));
-  }
-}
-
-std::string MemorySizeBinnerTool::tool_name() const {
-  return "MemoryTrackerCompressedTimeSeries";
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/memory_size_binner_tool.h b/cobalt/browser/memory_tracker/tool/memory_size_binner_tool.h
deleted file mode 100644
index 324e6df..0000000
--- a/cobalt/browser/memory_tracker/tool/memory_size_binner_tool.h
+++ /dev/null
@@ -1,49 +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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_MEMORY_SIZE_BINNER_TOOL_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_MEMORY_SIZE_BINNER_TOOL_H_
-
-#include <string>
-
-#include "base/compiler_specific.h"
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-// This tool inspects a memory scope and reports on the memory usage.
-// The output will be a CSV file printed to stdout representing
-// the number of memory allocations for objects. The objects are binned
-// according to the size of the memory allocation. Objects within the same
-// power of two are binned together. For example 1024 will be binned with 1025.
-class MemorySizeBinnerTool : public AbstractTool {
- public:
-  // memory_scope_name represents the memory scope that is to be investigated.
-  explicit MemorySizeBinnerTool(const std::string& memory_scope_name);
-
-  void Run(Params* params) override;
-  std::string tool_name() const override;
-
- private:
-  std::string memory_scope_name_;
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_MEMORY_SIZE_BINNER_TOOL_H_
diff --git a/cobalt/browser/memory_tracker/tool/params.cc b/cobalt/browser/memory_tracker/tool/params.cc
deleted file mode 100644
index d1fc5a3..0000000
--- a/cobalt/browser/memory_tracker/tool/params.cc
+++ /dev/null
@@ -1,68 +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 "cobalt/browser/memory_tracker/tool/params.h"
-
-#include <sstream>
-
-#include "base/basictypes.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-Params::Params(nb::analytics::MemoryTracker* memory_tracker,
-               AbstractLogger* logger, base::Time start_time)
-    : memory_tracker_(memory_tracker),
-      finished_(false),
-      logger_(logger),
-      timer_(start_time) {}
-
-bool Params::finished() const { return finished_; }
-
-bool Params::wait_for_finish_signal(SbTime wait_us) {
-  return finished_semaphore_.TakeWait(wait_us);
-}
-
-void Params::set_finished(bool val) {
-  finished_ = val;
-  finished_semaphore_.Put();
-}
-
-nb::analytics::MemoryTracker* Params::memory_tracker() const {
-  return memory_tracker_;
-}
-
-cobalt::browser::memory_tracker::AbstractLogger* Params::logger() {
-  return logger_.get();
-}
-
-base::TimeDelta Params::time_since_start() const {
-  return base::Time::NowFromSystemTime() - timer_;
-}
-
-std::string Params::TimeInMinutesString() const {
-  base::TimeDelta delta_t = time_since_start();
-  int64 seconds = delta_t.InSeconds();
-  float time_mins = static_cast<float>(seconds) / 60.f;
-  std::stringstream ss;
-
-  ss << time_mins;
-  return ss.str();
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/params.h b/cobalt/browser/memory_tracker/tool/params.h
deleted file mode 100644
index 1f71052..0000000
--- a/cobalt/browser/memory_tracker/tool/params.h
+++ /dev/null
@@ -1,56 +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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_PARAMS_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_PARAMS_H_
-
-#include <memory>
-#include <string>
-
-#include "base/time/time.h"
-#include "nb/analytics/memory_tracker.h"
-#include "starboard/common/semaphore.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-class AbstractLogger;
-
-class Params {
- public:
-  Params(nb::analytics::MemoryTracker* memory_tracker, AbstractLogger* logger,
-         base::Time start_time);
-  bool finished() const;
-  bool wait_for_finish_signal(SbTime wait_us);
-  void set_finished(bool val);
-
-  nb::analytics::MemoryTracker* memory_tracker() const;
-  AbstractLogger* logger();
-  base::TimeDelta time_since_start() const;
-  std::string TimeInMinutesString() const;
-
- private:
-  nb::analytics::MemoryTracker* memory_tracker_;
-  bool finished_;
-  std::unique_ptr<AbstractLogger> logger_;
-  base::Time timer_;
-  starboard::Semaphore finished_semaphore_;
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_PARAMS_H_
diff --git a/cobalt/browser/memory_tracker/tool/print_csv_tool.cc b/cobalt/browser/memory_tracker/tool/print_csv_tool.cc
deleted file mode 100644
index 90ecb57..0000000
--- a/cobalt/browser/memory_tracker/tool/print_csv_tool.cc
+++ /dev/null
@@ -1,262 +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 "cobalt/browser/memory_tracker/tool/print_csv_tool.h"
-
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "cobalt/base/c_val.h"
-#include "cobalt/browser/memory_tracker/tool/util.h"
-#include "nb/analytics/memory_tracker.h"
-#include "nb/analytics/memory_tracker_helpers.h"
-#include "starboard/common/log.h"
-#include "starboard/types.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-PrintCSVTool::PrintCSVTool(int sampling_interval_ms, int sampling_time_ms)
-    : sample_interval_ms_(sampling_interval_ms),
-      sampling_time_ms_(sampling_time_ms) {}
-
-std::string PrintCSVTool::ToCsvString(const MapAllocationSamples& samples_in) {
-  typedef MapAllocationSamples Map;
-  typedef Map::const_iterator MapIt;
-
-  size_t largest_sample_size = 0;
-  size_t smallest_sample_size = INT_MAX;
-
-  // Sanitize samples_in and store as samples.
-  MapAllocationSamples samples;
-  for (MapIt it = samples_in.begin(); it != samples_in.end(); ++it) {
-    std::string name = it->first;
-    const AllocationSamples& value = it->second;
-
-    if (value.allocated_bytes_.size() != value.number_allocations_.size()) {
-      SB_NOTREACHED() << "Error at " << __FILE__ << ":" << __LINE__;
-      return "ERROR";
-    }
-
-    const size_t n = value.allocated_bytes_.size();
-    if (n > largest_sample_size) {
-      largest_sample_size = n;
-    }
-    if (n < smallest_sample_size) {
-      smallest_sample_size = n;
-    }
-
-    const bool duplicate_found = (samples.end() != samples.find(name));
-    if (duplicate_found) {
-      SB_NOTREACHED() << "Error, duplicate found for entry: " << name
-                      << kNewLine;
-    }
-    // Store value as a sanitized sample.
-    samples[name] = value;
-  }
-
-  SB_DCHECK(largest_sample_size == smallest_sample_size);
-
-  std::stringstream ss;
-
-  // Begin output to CSV.
-  // Sometimes we need to skip the CPU memory entry.
-  const MapIt total_cpu_memory_it = samples.find(UntrackedMemoryKey());
-
-  // Preamble
-  ss << kNewLine << "//////////////////////////////////////////////";
-  ss << kNewLine << "// CSV of bytes / allocation" << kNewLine;
-  // HEADER.
-  ss << "Name" << kDelimiter << kQuote << "Bytes/Alloc" << kQuote << kNewLine;
-  // DATA.
-  for (MapIt it = samples.begin(); it != samples.end(); ++it) {
-    if (total_cpu_memory_it == it) {
-      continue;
-    }
-
-    const AllocationSamples& samples_ref = it->second;
-    if (samples_ref.allocated_bytes_.empty() ||
-        samples_ref.number_allocations_.empty()) {
-      SB_NOTREACHED() << "Should not be here";
-      return "ERROR";
-    }
-    const int64 n_allocs = samples_ref.number_allocations_.back();
-    const int64 n_bytes = samples_ref.allocated_bytes_.back();
-    int64 bytes_per_alloc = 0;
-    if (n_allocs > 0) {
-      bytes_per_alloc = n_bytes / n_allocs;
-    }
-    const std::string& name = it->first;
-    ss << kQuote << SanitizeCSVKey(name) << kQuote << kDelimiter
-       << bytes_per_alloc << kNewLine;
-  }
-  ss << kNewLine;
-
-  // Preamble
-  ss << kNewLine << "//////////////////////////////////////////////" << kNewLine
-     << "// CSV of bytes allocated per region (MB's)." << kNewLine
-     << "// Units are in Megabytes. This is designed" << kNewLine
-     << "// to be used in a stacked graph." << kNewLine;
-
-  // HEADER.
-  for (MapIt it = samples.begin(); it != samples.end(); ++it) {
-    if (total_cpu_memory_it == it) {
-      continue;
-    }
-    // Strip out any characters that could make parsing the csv difficult.
-    const std::string name = SanitizeCSVKey(it->first);
-    ss << kQuote << name << kQuote << kDelimiter;
-  }
-  // Save the total for last.
-  if (total_cpu_memory_it != samples.end()) {
-    const std::string& name = SanitizeCSVKey(total_cpu_memory_it->first);
-    ss << kQuote << name << kQuote << kDelimiter;
-  }
-  ss << kNewLine;
-
-  // Print out the values of each of the samples.
-  for (size_t i = 0; i < smallest_sample_size; ++i) {
-    for (MapIt it = samples.begin(); it != samples.end(); ++it) {
-      if (total_cpu_memory_it == it) {
-        continue;
-      }
-      const int64 alloc_bytes = it->second.allocated_bytes_[i];
-      // Convert to float megabytes with decimals of precision.
-      double n = static_cast<double>(alloc_bytes / (1000 * 10));
-      n = n / (100.);
-      ss << n << kDelimiter;
-    }
-    if (total_cpu_memory_it != samples.end()) {
-      const int64 alloc_bytes = total_cpu_memory_it->second.allocated_bytes_[i];
-      // Convert to float megabytes with decimals of precision.
-      double n = static_cast<double>(alloc_bytes / (1000 * 10));
-      n = n / (100.);
-      ss << n << kDelimiter;
-    }
-    ss << kNewLine;
-  }
-
-  ss << kNewLine;
-  // Preamble
-  ss << kNewLine << "//////////////////////////////////////////////";
-  ss << kNewLine << "// CSV of number of allocations per region." << kNewLine;
-
-  // HEADER
-  for (MapIt it = samples.begin(); it != samples.end(); ++it) {
-    if (total_cpu_memory_it == it) {
-      continue;
-    }
-    const std::string& name = SanitizeCSVKey(it->first);
-    ss << kQuote << name << kQuote << kDelimiter;
-  }
-  ss << kNewLine;
-  for (size_t i = 0; i < smallest_sample_size; ++i) {
-    for (MapIt it = samples.begin(); it != samples.end(); ++it) {
-      if (total_cpu_memory_it == it) {
-        continue;
-      }
-      const int64 n_allocs = it->second.number_allocations_[i];
-      ss << n_allocs << kDelimiter;
-    }
-    ss << kNewLine;
-  }
-  std::string output = ss.str();
-  return output;
-}
-
-const char* PrintCSVTool::UntrackedMemoryKey() { return "Untracked Memory"; }
-
-void PrintCSVTool::Run(Params* params) {
-  params->logger()->Output("\nMemoryTrackerPrintCSVThread is sampling...\n");
-  int sample_count = 0;
-  MapAllocationSamples map_samples;
-
-  while (!TimeExpiredYet(*params) && !params->finished()) {
-    // Sample total memory used by the system.
-    nb::analytics::MemoryStats mem_stats =
-        nb::analytics::GetProcessMemoryStats();
-    int64 untracked_used_memory =
-        mem_stats.used_cpu_memory + mem_stats.used_gpu_memory;
-
-    std::vector<const nb::analytics::AllocationGroup*> vector_output;
-    params->memory_tracker()->GetAllocationGroups(&vector_output);
-
-    // Sample all known memory scopes.
-    for (size_t i = 0; i < vector_output.size(); ++i) {
-      const nb::analytics::AllocationGroup* group = vector_output[i];
-      const std::string& name = group->name();
-
-      const bool first_creation =
-          map_samples.find(group->name()) == map_samples.end();
-
-      AllocationSamples* new_entry = &(map_samples[name]);
-
-      // Didn't see it before so create new entry.
-      if (first_creation) {
-        // Make up for lost samples...
-        new_entry->allocated_bytes_.resize(sample_count, 0);
-        new_entry->number_allocations_.resize(sample_count, 0);
-      }
-
-      int32 num_allocs = -1;
-      int64 allocation_bytes = -1;
-      group->GetAggregateStats(&num_allocs, &allocation_bytes);
-
-      new_entry->allocated_bytes_.push_back(allocation_bytes);
-      new_entry->number_allocations_.push_back(num_allocs);
-
-      untracked_used_memory -= allocation_bytes;
-    }
-
-    // Now push in remaining total.
-    AllocationSamples* process_sample = &(map_samples[UntrackedMemoryKey()]);
-    if (untracked_used_memory < 0) {
-      // On some platforms, total GPU memory may not be correctly reported.
-      // However the allocations from the GPU memory may be reported. In this
-      // case untracked_used_memory will go negative. To protect the memory
-      // reporting the untracked_used_memory is set to 0 so that it doesn't
-      // cause an error in reporting.
-      untracked_used_memory = 0;
-    }
-    process_sample->allocated_bytes_.push_back(untracked_used_memory);
-    process_sample->number_allocations_.push_back(-1);
-
-    ++sample_count;
-    base::PlatformThread::Sleep(
-        base::TimeDelta::FromMilliseconds(sample_interval_ms_));
-  }
-
-  std::stringstream ss;
-  ss.precision(2);
-  ss << "Time now: " << params->TimeInMinutesString() << ",\n";
-  ss << ToCsvString(map_samples);
-  params->logger()->Output(ss.str().c_str());
-  params->logger()->Flush();
-  // Prevents the "thread exited code 0" from being interleaved into the
-  // output. This happens if flush is not implemented correctly in the system.
-  base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1));
-}
-
-bool PrintCSVTool::TimeExpiredYet(const Params& params) {
-  base::TimeDelta dt = params.time_since_start();
-  int64 dt_ms = dt.InMilliseconds();
-  const bool expired_time = dt_ms > sampling_time_ms_;
-  return expired_time;
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/print_csv_tool.h b/cobalt/browser/memory_tracker/tool/print_csv_tool.h
deleted file mode 100644
index 623334e..0000000
--- a/cobalt/browser/memory_tracker/tool/print_csv_tool.h
+++ /dev/null
@@ -1,61 +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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_PRINT_CSV_TOOL_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_PRINT_CSV_TOOL_H_
-
-#include <map>
-#include <string>
-
-#include "base/compiler_specific.h"
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-// Generates CSV values of the engine.
-// There are three sections of data including:
-//   1. average bytes / alloc
-//   2. # Bytes allocated per memory scope.
-//   3. # Allocations per memory scope.
-// This data can be pasted directly into a Google spreadsheet and visualized.
-// Note that this thread will implicitly call Start() is called during
-// construction and Cancel() & Join() during destruction.
-class PrintCSVTool : public AbstractTool {
- public:
-  // This tool will only produce on CSV dump of the engine. This is useful
-  // for profiling startup memory consumption.
-  PrintCSVTool(int sampling_interval_ms, int sampling_time_ms);
-
-  // Overridden so that the thread can exit gracefully.
-  void Run(Params* params) override;
-  std::string tool_name() const override { return "MemoryTrackerPrintCSV"; }
-
- private:
-  typedef std::map<std::string, AllocationSamples> MapAllocationSamples;
-  static std::string ToCsvString(const MapAllocationSamples& samples);
-  static const char* UntrackedMemoryKey();
-  bool TimeExpiredYet(const Params& params);
-
-  const int sample_interval_ms_;
-  const int sampling_time_ms_;
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_PRINT_CSV_TOOL_H_
diff --git a/cobalt/browser/memory_tracker/tool/print_tool.cc b/cobalt/browser/memory_tracker/tool/print_tool.cc
deleted file mode 100644
index 6344974..0000000
--- a/cobalt/browser/memory_tracker/tool/print_tool.cc
+++ /dev/null
@@ -1,187 +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 "cobalt/browser/memory_tracker/tool/print_tool.h"
-
-#include <map>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/threading/platform_thread.h"
-#include "cobalt/base/c_val.h"
-#include "cobalt/browser/memory_tracker/tool/util.h"
-#include "nb/analytics/memory_tracker.h"
-#include "nb/analytics/memory_tracker_helpers.h"
-#include "starboard/common/log.h"
-#include "starboard/types.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-using nb::analytics::AllocationGroup;
-
-class PrintTool::CvalsMap {
- public:
-  typedef base::CVal<base::cval::SizeInBytes> CValType;
-
-  ~CvalsMap() {
-    while (!map_.empty()) {
-      MapCvals::iterator it = map_.begin();
-      delete it->second;
-      map_.erase(it);
-    }
-  }
-
-  void Update(const std::string& name, size_t value) {
-    std::string cval_name = GetCvalName(name);
-    CValType*& val = map_[cval_name];
-    if (!val) {
-      // Create if not found.
-      val = new CValType(cval_name, 0,
-                         "Automatically generated by the "
-                         "browser::memory_tracker system.");
-    }
-    (*val) = value;
-  }
-
-  static std::string GetCvalName(const std::string& name) {
-    std::stringstream ss;
-    ss << "Memory.Scope." << name;
-    return ss.str();
-  }
-
- private:
-  typedef std::map<std::string, CValType*> MapCvals;
-  MapCvals map_;
-};
-
-PrintTool::PrintTool() : cvals_map_(new CvalsMap) {}
-
-PrintTool::~PrintTool() {}
-
-void PrintTool::Run(Params* params) {
-  const std::string kSeparator =
-      "--------------------------------------------------";
-
-  while (!params->finished()) {
-    std::vector<const AllocationGroup*> vector_output;
-    params->memory_tracker()->GetAllocationGroups(&vector_output);
-
-    typedef std::map<std::string, const AllocationGroup*> Map;
-    typedef Map::const_iterator MapIt;
-
-    Map output;
-    for (size_t i = 0; i < vector_output.size(); ++i) {
-      const AllocationGroup* group = vector_output[i];
-      output[group->name()] = group;
-    }
-
-    int32 num_allocs = 0;
-    int64 total_bytes = 0;
-
-    struct F {
-      static void PrintRow(std::stringstream* ss, const std::string& v1,
-                           const std::string& v2, const std::string& v3) {
-        ss->width(25);
-        *ss << std::left << v1;
-        ss->width(13);
-        *ss << std::right << v2 << "  ";
-        ss->width(10);
-        *ss << std::right << v3 << "\n";
-      }
-    };
-
-    if (params->memory_tracker()->IsMemoryTrackingEnabled()) {
-      // If this isn't true then it would cause an infinite loop. The
-      // following will likely crash.
-      SB_DCHECK(false) << "Unexpected, memory tracking should be disabled.";
-    }
-
-    std::stringstream ss;
-
-    ss << kNewLine;
-    ss << "TimeNow " << params->TimeInMinutesString()
-       << " (minutes):" << kNewLine << kNewLine;
-
-    ss << kSeparator << kNewLine;
-    nb::analytics::MemoryStats memstats =
-        nb::analytics::GetProcessMemoryStats();
-
-    F::PrintRow(&ss, "MALLOC STAT", "IN USE BYTES", "");
-    ss << kSeparator << kNewLine;
-    F::PrintRow(&ss, "Total CPU Reserved",
-                NumberFormatWithCommas(memstats.total_cpu_memory), "");
-
-    F::PrintRow(&ss, "Total CPU Used",
-                NumberFormatWithCommas(memstats.used_cpu_memory), "");
-
-    F::PrintRow(&ss, "Total GPU Reserved",
-                NumberFormatWithCommas(memstats.total_gpu_memory), "");
-
-    F::PrintRow(&ss, "Total GPU Used",
-                NumberFormatWithCommas(memstats.used_gpu_memory), "");
-
-    ss << kSeparator << kNewLine << kNewLine;
-
-    ss << kSeparator << kNewLine;
-    F::PrintRow(&ss, "MEMORY REGION", "IN USE BYTES", "NUM ALLOCS");
-    ss << kSeparator << kNewLine;
-
-    for (MapIt it = output.begin(); it != output.end(); ++it) {
-      const AllocationGroup* group = it->second;
-      if (!group) {
-        continue;
-      }
-
-      int32 num_group_allocs = -1;
-      int64 total_group_bytes = -1;
-
-      group->GetAggregateStats(&num_group_allocs, &total_group_bytes);
-      SB_DCHECK(-1 != num_group_allocs);
-      SB_DCHECK(-1 != total_group_bytes);
-
-      cvals_map_->Update(group->name(), static_cast<size_t>(total_group_bytes));
-
-      num_allocs += num_group_allocs;
-      total_bytes += total_group_bytes;
-
-      F::PrintRow(&ss, it->first, NumberFormatWithCommas(total_group_bytes),
-                  NumberFormatWithCommas(num_group_allocs));
-    }
-
-    cvals_map_->Update("Total", static_cast<size_t>(total_bytes));
-
-    ss << kNewLine;
-
-    F::PrintRow(&ss, "Total (in groups above)",
-                NumberFormatWithCommas(total_bytes),
-                NumberFormatWithCommas(num_allocs));
-
-    ss << kSeparator << kNewLine;
-    ss << kNewLine << kNewLine;
-
-    params->logger()->Output(ss.str().c_str());
-    // Output once every 5 seconds.
-    base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(5));
-  }
-}
-
-std::string PrintTool::tool_name() const { return "MemoryTrackerPrintThread"; }
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/print_tool.h b/cobalt/browser/memory_tracker/tool/print_tool.h
deleted file mode 100644
index f50b249..0000000
--- a/cobalt/browser/memory_tracker/tool/print_tool.h
+++ /dev/null
@@ -1,49 +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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_PRINT_TOOL_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_PRINT_TOOL_H_
-
-#include <memory>
-#include <string>
-
-#include "base/compiler_specific.h"
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-// Start() is called when this object is created, and Cancel() & Join() are
-// called during destruction.
-class PrintTool : public AbstractTool {
- public:
-  PrintTool();
-  ~PrintTool() override;
-
-  // Overridden so that the thread can exit gracefully.
-  void Run(Params* params) override;
-  std::string tool_name() const override;
-
- private:
-  class CvalsMap;
-  std::unique_ptr<CvalsMap> cvals_map_;
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_PRINT_TOOL_H_
diff --git a/cobalt/browser/memory_tracker/tool/tool_impl.cc b/cobalt/browser/memory_tracker/tool/tool_impl.cc
deleted file mode 100644
index 4b4580f..0000000
--- a/cobalt/browser/memory_tracker/tool/tool_impl.cc
+++ /dev/null
@@ -1,236 +0,0 @@
-// Copyright 2016 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 "cobalt/browser/memory_tracker/tool/tool_impl.h"
-
-#include <algorithm>
-#include <cstring>
-#include <iomanip>
-#include <iterator>
-#include <map>
-#include <set>
-#include <sstream>
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "base/time/time.h"
-#include "cobalt/base/c_val_collection_entry_stats.h"
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "cobalt/browser/memory_tracker/tool/tool_thread.h"
-#include "cobalt/browser/memory_tracker/tool/util.h"
-#include "nb/analytics/memory_tracker.h"
-#include "nb/analytics/memory_tracker_helpers.h"
-#include "nb/concurrent_map.h"
-#include "nb/memory_scope.h"
-#include "starboard/common/semaphore.h"
-#include "starboard/common/string.h"
-#include "starboard/configuration.h"
-#include "starboard/file.h"
-#include "starboard/system.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-using nb::analytics::AllocationGroup;
-using nb::analytics::AllocationRecord;
-using nb::analytics::AllocationVisitor;
-using nb::analytics::GetProcessMemoryStats;
-using nb::analytics::MemoryStats;
-using nb::analytics::MemoryTracker;
-
-size_t AllocationSizeBinner::GetBucketIndexForAllocationSize(size_t size) {
-  for (int i = 0; i < 32; ++i) {
-    size_t val = static_cast<size_t>(0x1) << i;
-    if (val > size) {
-      return i;
-    }
-  }
-  SB_NOTREACHED();
-  return 32;
-}
-
-void AllocationSizeBinner::GetSizeRange(size_t size, size_t* min_value,
-                                        size_t* max_value) {
-  size_t idx = GetBucketIndexForAllocationSize(size);
-  IndexToSizeRange(idx, min_value, max_value);
-}
-
-void AllocationSizeBinner::IndexToSizeRange(size_t idx, size_t* min_value,
-                                            size_t* max_value) {
-  if (idx == 0) {
-    *min_value = 0;
-    *max_value = 0;
-    return;
-  }
-  *min_value = static_cast<size_t>(0x1) << (idx - 1);
-  *max_value = (*min_value << 1) - 1;
-  return;
-}
-
-size_t AllocationSizeBinner::GetIndexRepresentingMostMemoryConsumption() const {
-  int64 largest_allocation_total = 0;
-  size_t largest_allocation_total_idx = 0;
-
-  for (size_t i = 0; i < allocation_histogram_.size(); ++i) {
-    size_t alloc_size = static_cast<size_t>(0x1) << i;
-    size_t count = allocation_histogram_[i];
-    int64 allocation_total =
-        static_cast<int64>(alloc_size) * static_cast<int64>(count);
-
-    if (largest_allocation_total < allocation_total) {
-      largest_allocation_total = allocation_total;
-      largest_allocation_total_idx = i;
-    }
-  }
-  return largest_allocation_total_idx;
-}
-
-void AllocationSizeBinner::GetLargestSizeRange(size_t* min_value,
-                                               size_t* max_value) const {
-  size_t index = GetIndexRepresentingMostMemoryConsumption();
-  IndexToSizeRange(index, min_value, max_value);
-}
-
-AllocationSizeBinner::AllocationSizeBinner(const AllocationGroup* group_filter)
-    : group_filter_(group_filter) {
-  allocation_histogram_.resize(33);
-}
-
-bool AllocationSizeBinner::PassesFilter(
-    const AllocationRecord& alloc_record) const {
-  if (group_filter_ == NULL) {
-    return true;
-  }
-
-  return alloc_record.allocation_group == group_filter_;
-}
-
-bool AllocationSizeBinner::Visit(const void* memory,
-                                 const AllocationRecord& alloc_record) {
-  if (PassesFilter(alloc_record)) {
-    const size_t idx = GetBucketIndexForAllocationSize(alloc_record.size);
-    allocation_histogram_[idx]++;
-  }
-  return true;
-}
-
-std::string AllocationSizeBinner::ToCSVString() const {
-  size_t first_idx = 0;
-  size_t end_idx = allocation_histogram_.size();
-
-  // Determine the start index by skipping all consecutive head entries
-  // that are 0.
-  while (first_idx < allocation_histogram_.size()) {
-    const size_t num_allocs = allocation_histogram_[first_idx];
-    if (num_allocs > 0) {
-      break;
-    }
-    first_idx++;
-  }
-
-  // Determine the end index by skipping all consecutive tail entries
-  // that are 0.
-  while (end_idx > 0) {
-    if (end_idx < allocation_histogram_.size()) {
-      const size_t num_allocs = allocation_histogram_[end_idx];
-      if (num_allocs > 0) {
-        ++end_idx;
-        break;
-      }
-    }
-    end_idx--;
-  }
-
-  std::stringstream ss;
-  for (size_t i = first_idx; i < end_idx; ++i) {
-    size_t min = 0;
-    size_t max = 0;
-    IndexToSizeRange(i, &min, &max);
-    std::stringstream name_ss;
-    name_ss << kQuote << min << "..." << max << kQuote;
-    ss << name_ss.str() << kDelimiter;
-  }
-  ss << kNewLine;
-
-  for (size_t i = first_idx; i < end_idx; ++i) {
-    const size_t num_allocs = allocation_histogram_[i];
-    ss << num_allocs << kDelimiter;
-  }
-  ss << kNewLine;
-  return ss.str();
-}
-
-FindTopSizes::FindTopSizes(size_t minimum_size, size_t maximum_size,
-                           const AllocationGroup* group)
-    : minimum_size_(minimum_size),
-      maximum_size_(maximum_size),
-      group_filter_(group) {}
-
-bool FindTopSizes::Visit(const void* memory,
-                         const AllocationRecord& alloc_record) {
-  if (PassesFilter(alloc_record)) {
-    size_counter_[alloc_record.size]++;
-  }
-  return true;
-}
-
-std::string FindTopSizes::ToString(size_t max_elements_to_print) const {
-  std::vector<GroupAllocation> group_allocs = GetTopAllocations();
-  const size_t n = std::min(max_elements_to_print, group_allocs.size());
-
-  if (!group_allocs.empty()) {
-    std::stringstream ss;
-
-    for (size_t i = 0; i < n; ++i) {
-      GroupAllocation g = group_allocs[i];
-      size_t total_size = g.allocation_count * g.allocation_size;
-      ss << "    " << total_size
-         << " bytes allocated with object size: " << g.allocation_size
-         << " bytes in " << g.allocation_count << " instances " << kNewLine;
-    }
-    return ss.str();
-  } else {
-    return std::string();
-  }
-}
-
-std::vector<FindTopSizes::GroupAllocation> FindTopSizes::GetTopAllocations()
-    const {
-  std::vector<GroupAllocation> group_allocs;
-  // Push objects to a vector.
-  for (SizeCounterMap::const_iterator it = size_counter_.begin();
-       it != size_counter_.end(); ++it) {
-    GroupAllocation alloc = {it->first, it->second};
-    group_allocs.push_back(alloc);
-  }
-
-  std::sort(group_allocs.begin(), group_allocs.end(),
-            GroupAllocation::LessAllocationSize);
-  // Biggest first.
-  std::reverse(group_allocs.begin(), group_allocs.end());
-  return group_allocs;
-}
-
-bool FindTopSizes::PassesFilter(const AllocationRecord& alloc_record) const {
-  if (alloc_record.size < minimum_size_) return false;
-  if (alloc_record.size > maximum_size_) return false;
-  if (!group_filter_) return true;  // No group filter when null.
-  return group_filter_ == alloc_record.allocation_group;
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/tool_impl.h b/cobalt/browser/memory_tracker/tool/tool_impl.h
deleted file mode 100644
index 8551002..0000000
--- a/cobalt/browser/memory_tracker/tool/tool_impl.h
+++ /dev/null
@@ -1,162 +0,0 @@
-// Copyright 2016 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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_TOOL_IMPL_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_TOOL_IMPL_H_
-
-#include <deque>
-#include <map>
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "base/compiler_specific.h"
-#include "base/debug/stack_trace.h"
-#include "base/memory/ref_counted.h"
-#include "base/threading/simple_thread.h"
-#include "base/time/time.h"
-#include "cobalt/browser/memory_tracker/tool/buffered_file_writer.h"
-#include "cobalt/browser/memory_tracker/tool/util.h"
-#include "nb/analytics/memory_tracker.h"
-#include "nb/analytics/memory_tracker_helpers.h"
-#include "nb/concurrent_map.h"
-#include "nb/string_interner.h"
-#include "nb/thread_local_object.h"
-#include "starboard/memory_reporter.h"
-
-namespace starboard {
-class ScopedFile;
-}  // namespace starboard
-
-namespace nb {
-namespace analytics {
-class AllocationGroup;
-class AllocationRecord;
-class MemoryTracker;
-}  // namespace analytics
-}  // namespace nb
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-// Interface for logging. This allows dependency inject to override in the case
-// of future tests.
-class AbstractLogger {
- public:
-  virtual ~AbstractLogger() {}
-  virtual void Output(const char* str) = 0;
-  void Output(const std::string& str) { Output(str.c_str()); }
-  virtual void Flush() = 0;
-};
-
-// Params holds important data needed by the MemoryTracker tools during
-// their run cycle.
-class Params;
-
-// Base class for all tools.
-class AbstractTool {
- public:
-  virtual ~AbstractTool() {}
-  virtual std::string tool_name() const = 0;
-  virtual void Run(Params* params) = 0;
-};
-
-// Bins the size according from all the encountered allocations.
-// If AllocationGroup* is non-null, then this is used as a filter such that
-// ONLY allocations belonging to that AllocationGroup are considered.
-class AllocationSizeBinner : public nb::analytics::AllocationVisitor {
- public:
-  typedef std::vector<int> AllocationHistogram;
-  // Maps the input size to a bin number. This function performs a 2^n
-  // mapping. Here is a table of some size mappings:
-  // Example:
-  //   GetIndex(0) == 0;
-  //   GetIndex(1) == 1;
-  //   GetIndex(2) == 2;
-  //   GetIndex(3) == 2;
-  //   GetIndex(4) == 3;
-  //   ...
-  //   GetIndex(15) == 4;
-  //   GetIndex(16) == 5;
-  static size_t GetBucketIndexForAllocationSize(size_t size);
-  static void GetSizeRange(size_t size, size_t* min_value, size_t* max_value);
-  static void IndexToSizeRange(size_t size, size_t* min_value,
-                               size_t* max_value);
-
-  explicit AllocationSizeBinner(
-      const nb::analytics::AllocationGroup* group_filter);
-  bool Visit(const void* memory,
-             const nb::analytics::AllocationRecord& alloc_record) override;
-
-  size_t GetIndexRepresentingMostMemoryConsumption() const;
-  void GetLargestSizeRange(size_t* min_value, size_t* max_value) const;
-  bool PassesFilter(const nb::analytics::AllocationRecord& alloc_record) const;
-  // Outputs CSV formatted string of the data values.
-  // The header containing the binning range is printed first, then the
-  // the number of allocations in that bin.
-  // Example:
-  //   "16...32","32...64","64...128","128...256",...
-  //   831,3726,3432,10285,...
-  //
-  // In this example there are 831 allocations of size 16-32 bytes.
-  std::string ToCSVString() const;
-  const AllocationHistogram& allocation_histogram() const {
-    return allocation_histogram_;
-  }
-
- private:
-  AllocationHistogram allocation_histogram_;
-  // Only these allocations are tracked.
-  const nb::analytics::AllocationGroup* group_filter_;
-};
-
-// Finds the top allocations by size.
-class FindTopSizes : public nb::analytics::AllocationVisitor {
- public:
-  FindTopSizes(size_t minimum_size, size_t maximum_size,
-               const nb::analytics::AllocationGroup* group);
-
-  bool Visit(const void* memory,
-             const nb::analytics::AllocationRecord& alloc_record) override;
-
-  struct GroupAllocation {
-    size_t allocation_size;
-    size_t allocation_count;
-
-    static bool LessAllocationSize(GroupAllocation a, GroupAllocation b) {
-      size_t total_size_a = a.allocation_size * a.allocation_count;
-      size_t total_size_b = b.allocation_size * b.allocation_count;
-      return total_size_a < total_size_b;
-    }
-  };
-
-  std::string ToString(size_t max_elements_to_print) const;
-  std::vector<GroupAllocation> GetTopAllocations() const;
-
- private:
-  typedef std::map<size_t, size_t> SizeCounterMap;
-
-  bool PassesFilter(const nb::analytics::AllocationRecord& alloc_record) const;
-  size_t minimum_size_;
-  size_t maximum_size_;
-  const nb::analytics::AllocationGroup* group_filter_;
-  SizeCounterMap size_counter_;
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_TOOL_IMPL_H_
diff --git a/cobalt/browser/memory_tracker/tool/tool_impl_test.cc b/cobalt/browser/memory_tracker/tool/tool_impl_test.cc
deleted file mode 100644
index 96f44ee..0000000
--- a/cobalt/browser/memory_tracker/tool/tool_impl_test.cc
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright 2016 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 "cobalt/browser/memory_tracker/tool/tool_impl.h"
-#include "build/build_config.h"
-
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-using ::nb::analytics::AllocationGroup;
-using ::nb::analytics::AllocationRecord;
-using ::nb::analytics::AllocationVisitor;
-
-// Tests the expectation that AllocationSizeBinner will correctly bin
-// allocations.
-TEST(MemoryTrackerToolTest, AllocationSizeBinner) {
-  const size_t index =
-      AllocationSizeBinner::GetBucketIndexForAllocationSize(24);
-  EXPECT_EQ(5, static_cast<int>(index));
-
-  const size_t kAllocSize = 24;
-
-  AllocationSizeBinner binner(NULL);
-  void* dummy_memory = SbMemoryAllocate(kAllocSize);
-
-  AllocationRecord allocation_record(kAllocSize, NULL);
-  binner.Visit(dummy_memory, allocation_record);
-
-  size_t min_val = 0;
-  size_t max_val = 0;
-  AllocationSizeBinner::GetSizeRange(kAllocSize, &min_val, &max_val);
-  EXPECT_EQ(16, static_cast<int>(min_val));
-  EXPECT_EQ(31, static_cast<int>(max_val));
-
-  // 0 -> [0,0]
-  // 1 -> [1,1]
-  // 2 -> [2,3]
-  // 3 -> [4,7]
-  // 4 -> [8,15]
-  // 5 -> [16,31] ...
-  EXPECT_EQ(1, binner.allocation_histogram()[5]);
-
-  allocation_record.size = 15;
-  binner.Visit(NULL, allocation_record);
-  binner.Visit(NULL, allocation_record);
-
-  size_t min_value = 0;
-  size_t max_value = 0;
-  binner.GetLargestSizeRange(&min_value, &max_value);
-  EXPECT_EQ(min_value, static_cast<int>(8));
-  EXPECT_EQ(max_value, static_cast<int>(15));
-
-  std::string csv_string = binner.ToCSVString();
-
-  // Expect header.
-  bool found = (csv_string.find("\"8...15\",\"16...31\"") != std::string::npos);
-  EXPECT_TRUE(found);
-
-  // Expect data.
-  found = (csv_string.find("2,1") != std::string::npos);
-  SbMemoryDeallocate(dummy_memory);
-}
-
-// Tests the expectation that AllocationSizeBinner will correctly bin
-// allocations.
-TEST(MemoryTrackerToolTest, FindTopSizes) {
-  const size_t min_size = 21;
-  const size_t max_size = 23;
-  AllocationGroup* group = NULL;  // signals "accept any group".
-
-  FindTopSizes top_sizes_visitor(min_size, max_size, group);
-
-  AllocationRecord record_a(21, group);
-  AllocationRecord record_b(22, group);
-  AllocationRecord record_c(22, group);
-  AllocationRecord record_d(24, group);
-
-  const void* dummy_alloc = NULL;
-  top_sizes_visitor.Visit(dummy_alloc, record_a);
-  top_sizes_visitor.Visit(dummy_alloc, record_b);
-  top_sizes_visitor.Visit(dummy_alloc, record_c);
-  top_sizes_visitor.Visit(dummy_alloc, record_d);
-
-  std::vector<FindTopSizes::GroupAllocation> top_allocations =
-      top_sizes_visitor.GetTopAllocations();
-
-  // Expect element 24 to be filtered out, leaving only 22 and 24.
-  EXPECT_EQ(top_allocations.size(), 2);
-  // Expect that allocation size 22 is the top allocation.
-  EXPECT_EQ(top_allocations[0].allocation_size, 22);
-  EXPECT_EQ(top_allocations[0].allocation_count, 2);
-  // And then the 21 byte allocation.
-  EXPECT_EQ(top_allocations[1].allocation_size, 21);
-  EXPECT_EQ(top_allocations[1].allocation_count, 1);
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/tool_thread.cc b/cobalt/browser/memory_tracker/tool/tool_thread.cc
deleted file mode 100644
index 7f5858b..0000000
--- a/cobalt/browser/memory_tracker/tool/tool_thread.cc
+++ /dev/null
@@ -1,90 +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 "cobalt/browser/memory_tracker/tool/tool_thread.h"
-
-#include "base/time/time.h"
-#include "cobalt/browser/memory_tracker/tool/params.h"
-#include "cobalt/browser/memory_tracker/tool/tool_impl.h"
-#include "nb/analytics/memory_tracker.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-namespace {
-// NoMemoryTracking will disable memory tracking while in the current scope of
-// execution. When the object is destroyed it will reset the previous state
-// of allocation tracking.
-// Example:
-//   void Foo() {
-//     NoMemoryTracking no_memory_tracking_in_scope;
-//     int* ptr = new int();  // ptr is not tracked.
-//     delete ptr;
-//     return;    // Previous memory tracking state is restored.
-//   }
-class NoMemoryTracking {
- public:
-  explicit NoMemoryTracking(nb::analytics::MemoryTracker* owner)
-      : prev_val_(false), owner_(owner) {
-    if (owner_) {
-      prev_val_ = owner_->IsMemoryTrackingEnabled();
-      owner_->SetMemoryTrackingEnabled(false);
-    }
-  }
-  ~NoMemoryTracking() {
-    if (owner_) {
-      owner_->SetMemoryTrackingEnabled(prev_val_);
-    }
-  }
-
- private:
-  bool prev_val_;
-  nb::analytics::MemoryTracker* owner_;
-};
-
-}  // namespace.
-
-ToolThread::ToolThread(nb::analytics::MemoryTracker* memory_tracker,
-                       AbstractTool* tool, AbstractLogger* logger)
-    : Super(tool->tool_name()),
-      params_(
-          new Params(memory_tracker, logger, base::Time::NowFromSystemTime())),
-      tool_(tool) {
-  Start();
-}
-
-ToolThread::~ToolThread() {
-  nb::analytics::MemoryTracker* memory_tracker = params_->memory_tracker();
-  if (memory_tracker) {
-    memory_tracker->SetMemoryTrackerDebugCallback(nullptr);
-  }
-  Join();
-  tool_.reset();
-  params_.reset();
-}
-
-void ToolThread::Join() {
-  params_->set_finished(true);
-  Super::Join();
-}
-
-void ToolThread::Run() {
-  NoMemoryTracking no_mem_tracking_in_this_scope(params_->memory_tracker());
-  // This tool will run until the finished_ if flipped to false.
-  tool_->Run(params_.get());
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/tool_thread.h b/cobalt/browser/memory_tracker/tool/tool_thread.h
deleted file mode 100644
index 7f6108c..0000000
--- a/cobalt/browser/memory_tracker/tool/tool_thread.h
+++ /dev/null
@@ -1,57 +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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_TOOL_THREAD_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_TOOL_THREAD_H_
-
-#include <memory>
-
-#include "base/compiler_specific.h"
-#include "base/threading/simple_thread.h"
-
-namespace nb {
-namespace analytics {
-class MemoryTracker;
-}  // namespace analytics
-}  // namespace nb
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-class AbstractLogger;
-class AbstractTool;
-class Params;
-
-// ToolThread sets up the the thread environment to run an AbstractTool.
-class ToolThread : public base::SimpleThread {
- public:
-  typedef base::SimpleThread Super;
-  ToolThread(nb::analytics::MemoryTracker* memory_tracker, AbstractTool* tool,
-             AbstractLogger* logger);
-  virtual ~ToolThread();
-
-  void Join();
-  void Run();
-
- private:
-  std::unique_ptr<Params> params_;
-  std::unique_ptr<AbstractTool> tool_;
-};
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_TOOL_THREAD_H_
diff --git a/cobalt/browser/memory_tracker/tool/util.cc b/cobalt/browser/memory_tracker/tool/util.cc
deleted file mode 100644
index e865670..0000000
--- a/cobalt/browser/memory_tracker/tool/util.cc
+++ /dev/null
@@ -1,221 +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 "cobalt/browser/memory_tracker/tool/util.h"
-
-#include <algorithm>
-#include <iterator>
-#include <string>
-#include <vector>
-
-#include "base/time/time.h"
-#include "nb/bit_cast.h"
-#include "starboard/common/string.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-const char kQuote[] = "\"";
-const char kDelimiter[] = ",";
-const char kNewLine[] = "\n";
-
-std::string RemoveString(const std::string& haystack, const char* needle) {
-  const size_t kNotFound = std::string::npos;
-
-  // Base case. No modification needed.
-  size_t pos = haystack.find(needle);
-  if (pos == kNotFound) {
-    return haystack;
-  }
-  const size_t n = strlen(needle);
-  std::string output;
-  output.reserve(haystack.size());
-
-  // Copy string, omitting the portion containing the "needle".
-  std::copy(haystack.begin(), haystack.begin() + pos,
-            std::back_inserter(output));
-  std::copy(haystack.begin() + pos + n, haystack.end(),
-            std::back_inserter(output));
-
-  // Recursively remove same needle in haystack.
-  return RemoveString(output, needle);
-}
-
-std::string SanitizeCSVKey(std::string key) {
-  key = RemoveString(key, kQuote);
-  key = RemoveString(key, kDelimiter);
-  key = RemoveString(key, kNewLine);
-  return key;
-}
-
-std::string InsertCommasIntoNumberString(const std::string& input) {
-  typedef std::vector<char> CharVector;
-  typedef CharVector::iterator CharIt;
-
-  CharVector chars(input.begin(), input.end());
-  std::reverse(chars.begin(), chars.end());
-
-  CharIt curr_it = chars.begin();
-  CharIt mid = std::find(chars.begin(), chars.end(), '.');
-  if (mid == chars.end()) {
-    mid = curr_it;
-  }
-
-  CharVector out(curr_it, mid);
-
-  int counter = 0;
-  for (CharIt it = mid; it != chars.end(); ++it) {
-    if (counter != 0 && (counter % 3 == 0)) {
-      out.push_back(',');
-    }
-    if (*it != '.') {
-      counter++;
-    }
-    out.push_back(*it);
-  }
-
-  std::reverse(out.begin(), out.end());
-  std::stringstream ss;
-  for (size_t i = 0; i < out.size(); ++i) {
-    ss << out[i];
-  }
-  return ss.str();
-}
-
-Timer::Timer(base::TimeDelta delta_time) {
-  start_time_ = Now();
-  time_before_expiration_ = delta_time;
-}
-
-Timer::Timer(base::TimeDelta delta_time, Timer::TimeFunctor time_functor) {
-  time_function_override_ = time_functor;
-  start_time_ = Now();
-  time_before_expiration_ = delta_time;
-}
-
-void Timer::Restart() { start_time_ = Now(); }
-
-bool Timer::UpdateAndIsExpired() {
-  base::TimeTicks now_time = Now();
-  base::TimeDelta delta_time = now_time - start_time_;
-  if (delta_time >= time_before_expiration_) {
-    start_time_ = now_time;
-    return true;
-  } else {
-    return false;
-  }
-}
-
-base::TimeTicks Timer::Now() {
-  if (time_function_override_.is_null()) {
-    return base::TimeTicks::Now();
-  } else {
-    return time_function_override_.Run();
-  }
-}
-
-void Timer::ScaleTriggerTime(double scale) {
-  int64_t old_dt = time_before_expiration_.InMicroseconds();
-  int64_t new_dt = static_cast<int64_t>(static_cast<double>(old_dt) * scale);
-  time_before_expiration_ = base::TimeDelta::FromMicroseconds(new_dt);
-}
-
-Segment::Segment(const std::string* name, const char* start_address,
-                 const char* end_address)
-    : name_(name), begin_(start_address), end_(end_address) {}
-
-void Segment::SplitAcrossPageBoundaries(size_t page_size,
-                                        std::vector<Segment>* segments) const {
-  if (size() == 0) {
-    segments->push_back(*this);
-    return;
-  }
-
-  uintptr_t page_start = nb::bit_cast<uintptr_t>(begin_) / page_size;
-  uintptr_t page_end = nb::bit_cast<uintptr_t>(end_ - 1) / page_size;
-
-  if (page_start == page_end) {
-    segments->push_back(*this);
-    return;
-  }
-
-  for (uintptr_t p = page_start; p <= page_end; ++p) {
-    uintptr_t start_addr;
-    if (p == page_start) {
-      start_addr = nb::bit_cast<uintptr_t>(begin_);
-    } else {
-      start_addr = p * page_size;
-    }
-
-    uintptr_t end_addr;
-    if (p == page_end) {
-      end_addr = nb::bit_cast<uintptr_t>(end_);
-    } else {
-      end_addr = (p + 1) * page_size;
-    }
-
-    const char* start = nb::bit_cast<const char*>(start_addr);
-    const char* end = nb::bit_cast<const char*>(end_addr);
-    segments->push_back(Segment(name_, start, end));
-  }
-}
-
-bool Segment::Intersects(const Segment& other) const {
-  size_t total_span = std::distance(std::min(begin_, other.begin()),
-                                    std::max(end_, other.end()));
-
-  bool intersects = (size() + other.size()) > total_span;
-  return intersects;
-}
-
-bool Segment::operator<(const Segment& other) const {
-  return begin_ < other.begin();
-}
-
-bool Segment::operator==(const Segment& other) const {
-  if (begin_ == other.begin() && end_ == other.end()) {
-    DCHECK(name_ == other.name_);
-    return true;
-  }
-  return false;
-}
-
-size_t Segment::size() const { return std::distance(begin_, end_); }
-
-const char* BaseNameFast(const char* file_name) {
-  // Case: Linux.
-  const char* end_pos = file_name + strlen(file_name);
-  const char* last_forward_slash = strrchr(file_name, '/');
-  if (last_forward_slash) {
-    if (end_pos != last_forward_slash) {
-      ++last_forward_slash;
-    }
-    return last_forward_slash;
-  }
-
-  // Case: Windows.
-  const char* last_backward_slash = strrchr(file_name, '\\');
-  if (last_backward_slash) {
-    if (end_pos != last_backward_slash) {
-      ++last_backward_slash;
-    }
-    return last_backward_slash;
-  }
-  return file_name;
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/memory_tracker/tool/util.h b/cobalt/browser/memory_tracker/tool/util.h
deleted file mode 100644
index a6ef651..0000000
--- a/cobalt/browser/memory_tracker/tool/util.h
+++ /dev/null
@@ -1,209 +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 COBALT_BROWSER_MEMORY_TRACKER_TOOL_UTIL_H_
-#define COBALT_BROWSER_MEMORY_TRACKER_TOOL_UTIL_H_
-
-#include <map>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "base/callback.h"
-#include "base/logging.h"
-#include "base/time/time.h"
-#include "starboard/common/string.h"
-#include "starboard/types.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-
-// Used for CSV generation.
-extern const char kQuote[];
-extern const char kDelimiter[];
-extern const char kNewLine[];
-
-// This is a simple algorithm to remove the "needle" from the haystack. Note
-// that this function is simple and not well optimized.
-std::string RemoveString(const std::string& haystack, const char* needle);
-
-// Not optimized but works ok for a tool that dumps out in user time.
-std::string SanitizeCSVKey(std::string key);
-
-// Converts "2345.54" => "2,345.54".
-std::string InsertCommasIntoNumberString(const std::string& input);
-
-template <typename T>
-std::string NumberFormatWithCommas(T val) {
-  // Convert value to string.
-  std::stringstream ss;
-  ss << val;
-  std::string s = InsertCommasIntoNumberString(ss.str());
-  return s;
-}
-
-// Removes odd elements and resizes vector.
-template <typename VectorType>
-void RemoveOddElements(VectorType* v) {
-  typedef typename VectorType::iterator iterator;
-
-  iterator read_it = v->end();
-  iterator write_it = v->end();
-  for (size_t i = 0; i * 2 < v->size(); ++i) {
-    write_it = v->begin() + i;
-    read_it = v->begin() + (i * 2);
-    *write_it = *read_it;
-  }
-  if (write_it != v->end()) {
-    write_it++;
-  }
-  v->erase(write_it, v->end());
-}
-
-// Simple timer class that fires periodically after time has elapsed.
-class Timer {
- public:
-  typedef base::Callback<base::TimeTicks(void)> TimeFunctor;
-
-  explicit Timer(base::TimeDelta delta_time);
-  Timer(base::TimeDelta delta_time, TimeFunctor f);
-
-  void Restart();
-  bool UpdateAndIsExpired();  // Returns true if the expiration was triggered.
-  void ScaleTriggerTime(double scale);
-
- private:
-  base::TimeTicks Now();
-  base::TimeTicks start_time_;
-  base::TimeDelta time_before_expiration_;
-  TimeFunctor time_function_override_;
-};
-
-struct AllocationSamples {
-  std::vector<int32_t> number_allocations_;
-  std::vector<int64_t> allocated_bytes_;
-};
-typedef std::map<std::string, AllocationSamples> MapAllocationSamples;
-typedef std::vector<base::TimeDelta> TimeStamps;
-
-struct TimeSeries {
-  MapAllocationSamples samples_;
-  TimeStamps time_stamps_;
-};
-
-// Generates a linear fit in the form of slope / y-intercept form.
-// Returns true if linear fit was calculated. False otherwise. Reasons for
-// returning false include passing in an empty range, such that
-// begin_it == end_it, or all x-values being the same.
-//
-// Algorithm adapted from:
-// https://en.wikipedia.org/wiki/Simple_linear_regression#Fitting_the_regression_line
-// Example:
-//    std::vector<std::pair<int, int> > data;
-//    for (int i = 0; i < 10; ++i) {
-//      data.push_back(std::pair<int, int>(i+1, 2*i));
-//    }
-//    double slope = 0;
-//    double y_intercept = 0;
-//    GetLinearFit(data.begin(), data.end(), &slope, &y_intercept);
-//    std::cout << "slope: " << slope << "\n";
-//    std::cout << "y_intercept: " << y_intercept<< "\n";
-template <typename PairIterator>
-bool GetLinearFit(PairIterator begin_it, PairIterator end_it, double* out_slope,
-                  double* out_yintercept) {
-  if (begin_it == end_it) {
-    return false;
-  }
-
-  size_t n = 0;
-  double x_avg = 0;
-  double y_avg = 0;
-
-  for (PairIterator it = begin_it; it != end_it; ++it) {
-    x_avg += it->first;
-    y_avg += it->second;
-    n++;
-  }
-
-  x_avg /= n;
-  y_avg /= n;
-
-  double numerator = 0;
-  double denominator = 0;
-
-  for (PairIterator it = begin_it; it != end_it; ++it) {
-    double x_variance = it->first - x_avg;
-    double y_variance = it->second - y_avg;
-    numerator += (x_variance * y_variance);
-    denominator += (x_variance * x_variance);
-  }
-
-  if (denominator == 0.0) {
-    return false;  // Failed to generate any value.
-  }
-
-  double slope = numerator / denominator;
-  double yintercept = y_avg - slope * x_avg;
-
-  *out_slope = slope;
-  *out_yintercept = yintercept;
-  return true;
-}
-
-// Segment represents a named memory segment of allocated memory.
-// The name is optional and can be null.
-class Segment {
- public:
-  // Equal name string values must have equal pointers.
-  Segment(const std::string* name, const char* start_address,
-          const char* end_address);
-
-  // Using the page_size, split this Segment into one Segment
-  // per page. Each of the sub_segments will copy the name
-  // pointer from this.
-  void SplitAcrossPageBoundaries(size_t page_size,
-                                 std::vector<Segment>* sub_segments) const;
-
-  bool Intersects(const Segment& other) const;
-
-  bool operator<(const Segment& other) const;
-  bool operator==(const Segment& other) const;
-
-  size_t size() const;
-  const std::string* name() const { return name_; }
-
-  const char* begin() const { return begin_; }
-  const char* end() const { return end_; }
-
- private:
-  const std::string* name_;
-  const char* begin_;
-  const char* end_;
-};
-
-// Returns a substring with the directory path removed from the filename.
-// Example:
-//   F::BaseNameFast("directory/filename.cc") => "filename.cc"
-//   F::BaseNameFast("directory\filename.cc") => "filename.cc"
-//
-// Note that base::FilePath::BaseName() isn't used because of performance
-// reasons.
-const char* BaseNameFast(const char* file_name);
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
-
-#endif  // COBALT_BROWSER_MEMORY_TRACKER_TOOL_UTIL_H_
diff --git a/cobalt/browser/memory_tracker/tool/util_test.cc b/cobalt/browser/memory_tracker/tool/util_test.cc
deleted file mode 100644
index b49d0ad..0000000
--- a/cobalt/browser/memory_tracker/tool/util_test.cc
+++ /dev/null
@@ -1,229 +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 "cobalt/browser/memory_tracker/tool/util.h"
-
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "base/bind.h"
-#include "nb/bit_cast.h"
-#include "starboard/types.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace cobalt {
-namespace browser {
-namespace memory_tracker {
-namespace {
-
-const char* ToAddress(uintptr_t val) { return nb::bit_cast<const char*>(val); }
-
-// 4k page size.
-static const uintptr_t kPageSize = 4096;
-
-class FakeTimeSource {
- public:
-  explicit FakeTimeSource(base::TimeTicks value) : static_time_(value) {}
-  void set_static_time(base::TimeTicks value) { static_time_ = value; }
-  base::TimeTicks GetTime() { return static_time_; }
-
- private:
-  base::TimeTicks static_time_;
-};
-
-}  // namespace.
-
-// Tests the expectation that AllocationSizeBinner will correctly bin
-// allocations.
-TEST(UtilTest, RemoveString) {
-  std::string value = "abba";
-  value = RemoveString(value, "bb");
-  EXPECT_STREQ("aa", value.c_str());
-}
-
-// Tests the expectation that AllocationSizeBinner will correctly bin
-// allocations.
-TEST(UtilTest, InsertCommasIntoNumberString) {
-  std::string value = "2345.54";
-  std::string value_with_commas = InsertCommasIntoNumberString(value);
-
-  EXPECT_STREQ("2,345.54", value_with_commas.c_str());
-}
-
-TEST(UtilTest, NumberFormatWithCommas) {
-  int value = 1000;
-  std::string value_with_commas = NumberFormatWithCommas<int>(value);
-
-  EXPECT_STREQ("1,000", value_with_commas.c_str());
-}
-
-// Tests the expectation that RemoveOddElements() removes the odd elements of
-// a vector and resizes it.
-TEST(UtilTest, RemoveOddElements) {
-  std::vector<int> values;
-
-  // EVEN TEST.
-  values.push_back(0);
-  values.push_back(1);
-  values.push_back(2);
-  values.push_back(3);
-
-  RemoveOddElements(&values);
-
-  ASSERT_EQ(2, values.size());
-  EXPECT_EQ(0, values[0]);
-  EXPECT_EQ(2, values[1]);
-
-  values.clear();
-
-  // ODD TEST
-  values.push_back(0);
-  values.push_back(1);
-  values.push_back(2);
-  values.push_back(3);
-  values.push_back(4);
-  RemoveOddElements(&values);
-
-  ASSERT_EQ(3, values.size());
-  EXPECT_EQ(0, values[0]);
-  EXPECT_EQ(2, values[1]);
-  EXPECT_EQ(4, values[2]);
-}
-
-// Tests the expectation that GetLinearFit() generates the expected linear
-// regression values.
-TEST(UtilTest, GetLinearFit) {
-  std::vector<std::pair<int, int> > data;
-  for (int i = 0; i < 10; ++i) {
-    data.push_back(std::pair<int, int>(i + 1, 2 * i));
-  }
-  double slope = 0;
-  double y_intercept = 0;
-  GetLinearFit(data.begin(), data.end(), &slope, &y_intercept);
-
-  EXPECT_DOUBLE_EQ(2.0f, slope);
-  EXPECT_DOUBLE_EQ(-2.0f, y_intercept);
-}
-
-// Test the expectation that BaseNameFast() works correctly for both windows
-// and linux path types.
-TEST(UtilTest, BaseNameFast) {
-  const char* linux_path = "directory/filename.cc";
-  const char* win_path = "directory\\filename.cc";
-
-  EXPECT_STREQ("filename.cc", BaseNameFast(linux_path));
-  EXPECT_STREQ("filename.cc", BaseNameFast(win_path));
-}
-
-TEST(UtilTest, TimerUse) {
-  base::TimeTicks initial_time = base::TimeTicks::Now();
-  FakeTimeSource time_source(initial_time);
-
-  Timer::TimeFunctor time_functor =
-      base::Bind(&FakeTimeSource::GetTime, base::Unretained(&time_source));
-
-  Timer test_timer(base::TimeDelta::FromSeconds(30), time_functor);
-  EXPECT_FALSE(test_timer.UpdateAndIsExpired());  // 0 time has elapsed.
-
-  time_source.set_static_time(initial_time + base::TimeDelta::FromSeconds(29));
-  // 29 seconds has elapsed, which is less than the 30 seconds required for
-  // the timer to fire.
-  EXPECT_FALSE(test_timer.UpdateAndIsExpired());
-  time_source.set_static_time(initial_time + base::TimeDelta::FromSeconds(30));
-  // 31 seconds has elapsed, which means that the next call to
-  // UpdateAndIsExpired() should succeed.
-  EXPECT_TRUE(test_timer.UpdateAndIsExpired());
-  // Now that the value fired, expect that it won't fire again (until the next
-  // 30 seconds has passed).
-  EXPECT_FALSE(test_timer.UpdateAndIsExpired());
-  time_source.set_static_time(initial_time + base::TimeDelta::FromSeconds(60));
-  EXPECT_TRUE(test_timer.UpdateAndIsExpired());
-  EXPECT_FALSE(test_timer.UpdateAndIsExpired());
-}
-
-TEST(Segment, SplitAcrossPageBoundaries_Simple) {
-  std::string name("AllocName");
-  const char* start_addr = ToAddress(0);
-  const char* end_addr = ToAddress(1);
-
-  Segment memory_segment(&name, start_addr, end_addr);
-
-  std::vector<Segment> segments;
-  memory_segment.SplitAcrossPageBoundaries(kPageSize, &segments);
-  ASSERT_EQ(1, segments.size());
-
-  ASSERT_EQ(memory_segment, segments[0]);
-}
-
-TEST(Segment, SplitAcrossPageBoundaries_WholePage) {
-  std::string name("AllocName");
-  const char* start_addr = ToAddress(0);
-  const char* end_addr = ToAddress(kPageSize);
-
-  Segment memory_segment(&name, start_addr, end_addr);
-
-  std::vector<Segment> segments;
-  memory_segment.SplitAcrossPageBoundaries(kPageSize, &segments);
-  ASSERT_EQ(1, segments.size());
-
-  ASSERT_EQ(memory_segment, segments[0]);
-}
-
-TEST(Segment, SplitAcrossPageBoundaries_Across) {
-  std::string name("AllocName");
-  const char* start_addr = ToAddress(kPageSize / 2);
-  const char* mid_addr = ToAddress(kPageSize);
-  const char* end_addr = ToAddress(kPageSize + kPageSize / 2);
-
-  Segment memory_segment(&name, start_addr, end_addr);
-
-  std::vector<Segment> segments;
-  memory_segment.SplitAcrossPageBoundaries(kPageSize, &segments);
-
-  ASSERT_EQ(2, segments.size());
-
-  Segment s1(&name, start_addr, mid_addr);
-  Segment s2(&name, mid_addr, end_addr);
-
-  ASSERT_EQ(s1, segments[0]);
-  ASSERT_EQ(s2, segments[1]);
-}
-
-TEST(Segment, SplitAcrossPageBoundaries_Many) {
-  std::string name("AllocName");
-  const char* start_addr = ToAddress(kPageSize / 2);
-  const char* mid_0_addr = ToAddress(kPageSize);
-  const char* mid_1_addr = ToAddress(kPageSize * 2);
-  const char* end_addr = ToAddress(2 * kPageSize + kPageSize / 2);
-
-  Segment memory_segment(&name, start_addr, end_addr);
-
-  std::vector<Segment> segments;
-  memory_segment.SplitAcrossPageBoundaries(4096, &segments);
-  ASSERT_EQ(3, segments.size());
-
-  Segment s1(&name, start_addr, mid_0_addr);
-  Segment s2(&name, mid_0_addr, mid_1_addr);
-  Segment s3(&name, mid_1_addr, end_addr);
-
-  ASSERT_EQ(s1, segments[0]);
-  ASSERT_EQ(s2, segments[1]);
-  ASSERT_EQ(s3, segments[2]);
-}
-
-}  // namespace memory_tracker
-}  // namespace browser
-}  // namespace cobalt
diff --git a/cobalt/browser/metrics/cobalt_metrics_log_uploader.cc b/cobalt/browser/metrics/cobalt_metrics_log_uploader.cc
index 2076f6b..49f1c81 100644
--- a/cobalt/browser/metrics/cobalt_metrics_log_uploader.cc
+++ b/cobalt/browser/metrics/cobalt_metrics_log_uploader.cc
@@ -14,18 +14,32 @@
 
 #include "cobalt/browser/metrics/cobalt_metrics_log_uploader.h"
 
+#include "base/base64url.h"
 #include "base/logging.h"
 #include "cobalt/browser/metrics/cobalt_metrics_uploader_callback.h"
 #include "cobalt/h5vcc/h5vcc_metric_type.h"
 #include "components/metrics/log_decoder.h"
 #include "components/metrics/metrics_log_uploader.h"
 #include "third_party/metrics_proto/chrome_user_metrics_extension.pb.h"
+#include "third_party/metrics_proto/cobalt_uma_event.pb.h"
 #include "third_party/metrics_proto/reporting_info.pb.h"
 
 namespace cobalt {
 namespace browser {
 namespace metrics {
 
+// Helper method to create a trimmed down and sanitized version of the UMA
+// proto for Cobalt
+void PopulateCobaltUmaEvent(
+    const ::metrics::ChromeUserMetricsExtension& uma_proto,
+    const ::metrics::ReportingInfo reporting_info_proto,
+    CobaltUMAEvent& cobalt_proto) {
+  cobalt_proto.mutable_histogram_event()->CopyFrom(uma_proto.histogram_event());
+  cobalt_proto.mutable_user_action_event()->CopyFrom(
+      uma_proto.user_action_event());
+  cobalt_proto.mutable_reporting_info()->CopyFrom(reporting_info_proto);
+}
+
 CobaltMetricsLogUploader::CobaltMetricsLogUploader(
     ::metrics::MetricsLogUploader::MetricServiceType service_type,
     const ::metrics::MetricsLogUploader::UploadCallback& on_upload_complete)
@@ -35,12 +49,26 @@
     const std::string& compressed_log_data, const std::string& log_hash,
     const ::metrics::ReportingInfo& reporting_info) {
   if (service_type_ == ::metrics::MetricsLogUploader::UMA) {
-    std::string uncompressed_serialized_proto;
-    ::metrics::DecodeLogData(compressed_log_data,
-                             &uncompressed_serialized_proto);
     if (upload_handler_ != nullptr) {
-      upload_handler_->Run(h5vcc::H5vccMetricType::kH5vccMetricTypeUma,
-                           uncompressed_serialized_proto);
+      std::string uncompressed_serialized_proto;
+      ::metrics::DecodeLogData(compressed_log_data,
+                               &uncompressed_serialized_proto);
+
+      ::metrics::ChromeUserMetricsExtension uma_event;
+      uma_event.ParseFromString(uncompressed_serialized_proto);
+      CobaltUMAEvent cobalt_uma_event;
+      PopulateCobaltUmaEvent(uma_event, reporting_info, cobalt_uma_event);
+      LOG(INFO) << "Publishing Cobalt metrics upload event. Type: "
+                << h5vcc::H5vccMetricType::kH5vccMetricTypeCobaltUma;
+      std::string base64_encoded_proto;
+      // Base64 encode the payload as web client's can't consume it without
+      // corrupting the data (see b/293431381). Also, use a URL/web safe
+      // encoding so it can be safely included in any web network request.
+      base::Base64UrlEncode(cobalt_uma_event.SerializeAsString(),
+                            base::Base64UrlEncodePolicy::INCLUDE_PADDING,
+                            &base64_encoded_proto);
+      upload_handler_->Run(h5vcc::H5vccMetricType::kH5vccMetricTypeCobaltUma,
+                           base64_encoded_proto);
     }
   }
 
diff --git a/cobalt/browser/metrics/cobalt_metrics_log_uploader_test.cc b/cobalt/browser/metrics/cobalt_metrics_log_uploader_test.cc
index 21f2770..78e7d18 100644
--- a/cobalt/browser/metrics/cobalt_metrics_log_uploader_test.cc
+++ b/cobalt/browser/metrics/cobalt_metrics_log_uploader_test.cc
@@ -16,12 +16,14 @@
 
 #include <memory>
 
+#include "base/base64url.h"
 #include "base/test/mock_callback.h"
 #include "cobalt/browser/metrics/cobalt_metrics_uploader_callback.h"
 #include "cobalt/h5vcc/h5vcc_metrics.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/metrics_proto/chrome_user_metrics_extension.pb.h"
+#include "third_party/metrics_proto/cobalt_uma_event.pb.h"
 #include "third_party/metrics_proto/reporting_info.pb.h"
 #include "third_party/zlib/google/compression_utils.h"
 
@@ -64,14 +66,30 @@
   const auto cb = mock_upload_handler.Get();
   uploader_->SetOnUploadHandler(&cb);
   ::metrics::ReportingInfo dummy_reporting_info;
+  dummy_reporting_info.set_attempt_count(33);
   ::metrics::ChromeUserMetricsExtension uma_log;
   uma_log.set_session_id(1234);
   uma_log.set_client_id(1234);
+  auto histogram_event = uma_log.add_histogram_event();
+  histogram_event->set_name_hash(1234);
+  auto user_event = uma_log.add_user_action_event();
+  user_event->set_name_hash(42);
+
+  CobaltUMAEvent cobalt_event;
+  cobalt_event.mutable_histogram_event()->CopyFrom(uma_log.histogram_event());
+  cobalt_event.mutable_user_action_event()->CopyFrom(
+      uma_log.user_action_event());
+  cobalt_event.mutable_reporting_info()->CopyFrom(dummy_reporting_info);
+
   std::string compressed_message;
   compression::GzipCompress(uma_log.SerializeAsString(), &compressed_message);
+  std::string base64_encoded_proto;
+  base::Base64UrlEncode(cobalt_event.SerializeAsString(),
+                        base::Base64UrlEncodePolicy::INCLUDE_PADDING,
+                        &base64_encoded_proto);
   EXPECT_CALL(mock_upload_handler,
-              Run(Eq(h5vcc::H5vccMetricType::kH5vccMetricTypeUma),
-                  StrEq(uma_log.SerializeAsString())))
+              Run(Eq(h5vcc::H5vccMetricType::kH5vccMetricTypeCobaltUma),
+                  StrEq(base64_encoded_proto)))
       .Times(1);
   uploader_->UploadLog(compressed_message, "fake_hash", dummy_reporting_info);
   ASSERT_EQ(callback_count_, 1);
@@ -79,11 +97,20 @@
   ::metrics::ChromeUserMetricsExtension uma_log2;
   uma_log2.set_session_id(456);
   uma_log2.set_client_id(567);
+  CobaltUMAEvent cobalt_event2;
+  cobalt_event2.mutable_histogram_event()->CopyFrom(uma_log2.histogram_event());
+  cobalt_event2.mutable_user_action_event()->CopyFrom(
+      uma_log2.user_action_event());
+  cobalt_event2.mutable_reporting_info()->CopyFrom(dummy_reporting_info);
   std::string compressed_message2;
   compression::GzipCompress(uma_log2.SerializeAsString(), &compressed_message2);
+  std::string base64_encoded_proto2;
+  base::Base64UrlEncode(cobalt_event2.SerializeAsString(),
+                        base::Base64UrlEncodePolicy::INCLUDE_PADDING,
+                        &base64_encoded_proto2);
   EXPECT_CALL(mock_upload_handler,
-              Run(Eq(h5vcc::H5vccMetricType::kH5vccMetricTypeUma),
-                  StrEq(uma_log2.SerializeAsString())))
+              Run(Eq(h5vcc::H5vccMetricType::kH5vccMetricTypeCobaltUma),
+                  StrEq(base64_encoded_proto2)))
       .Times(1);
   uploader_->UploadLog(compressed_message2, "fake_hash", dummy_reporting_info);
   ASSERT_EQ(callback_count_, 2);
diff --git a/cobalt/browser/metrics/cobalt_metrics_services_manager.cc b/cobalt/browser/metrics/cobalt_metrics_services_manager.cc
index 3874d08..acb5d8b 100644
--- a/cobalt/browser/metrics/cobalt_metrics_services_manager.cc
+++ b/cobalt/browser/metrics/cobalt_metrics_services_manager.cc
@@ -16,6 +16,7 @@
 
 #include <memory>
 
+#include "base/logging.h"
 #include "cobalt/browser/metrics/cobalt_metrics_service_client.h"
 #include "cobalt/browser/metrics/cobalt_metrics_services_manager_client.h"
 #include "components/metrics_services_manager/metrics_services_manager.h"
@@ -56,6 +57,7 @@
       static_cast<CobaltMetricsServiceClient*>(GetMetricsServiceClient());
   DCHECK(client);
   client->SetOnUploadHandler(uploader_callback);
+  LOG(INFO) << "New Cobalt Telemetry metric upload handler bound.";
 }
 
 void CobaltMetricsServicesManager::ToggleMetricsEnabled(bool is_enabled) {
@@ -73,6 +75,7 @@
   client->GetEnabledStateProvider()->SetConsentGiven(is_enabled);
   client->GetEnabledStateProvider()->SetReportingEnabled(is_enabled);
   UpdateUploadPermissions(is_enabled);
+  LOG(INFO) << "Cobalt Telemetry enabled state toggled to: " << is_enabled;
 }
 
 void CobaltMetricsServicesManager::SetUploadInterval(
@@ -90,6 +93,8 @@
           GetMetricsServiceClient());
   DCHECK(client);
   client->SetUploadInterval(interval_seconds);
+  LOG(INFO) << "Cobalt Telemetry metric upload interval changed to: "
+            << interval_seconds;
 }
 
 
diff --git a/cobalt/browser/metrics/cobalt_metrics_services_manager_client.cc b/cobalt/browser/metrics/cobalt_metrics_services_manager_client.cc
index 224490c..36002ca 100644
--- a/cobalt/browser/metrics/cobalt_metrics_services_manager_client.cc
+++ b/cobalt/browser/metrics/cobalt_metrics_services_manager_client.cc
@@ -17,12 +17,14 @@
 #include <memory>
 
 #include "base/callback_forward.h"
+#include "base/command_line.h"
 #include "base/metrics/field_trial.h"
 #include "cobalt/browser/metrics/cobalt_metrics_service_client.h"
 #include "components/metrics/client_info.h"
 #include "components/metrics/metrics_service.h"
 #include "components/metrics/metrics_service_client.h"
 #include "components/metrics/metrics_state_manager.h"
+#include "components/metrics/metrics_switches.h"
 #include "components/metrics_services_manager/metrics_services_manager_client.h"
 #include "components/prefs/in_memory_pref_store.h"
 #include "components/prefs/pref_registry_simple.h"
@@ -57,13 +59,14 @@
   return enabled_state_provider_->IsConsentGiven();
 }
 
-// If the user has forced metrics collection on via the override flag.
+// If the user has forced metrics collection on via the override flag. This
+// switch being set trumps/overrides any other mechanism to enable telemetry
+// (e.g., through the h5vcc_metrics API).
 bool CobaltMetricsServicesManagerClient::IsMetricsReportingForceEnabled() {
-  // TODO(b/286091096): Add support for metrics logging forcing.
-  return false;
+  return base::CommandLine::ForCurrentProcess()->HasSwitch(
+      ::metrics::switches::kForceEnableMetricsReporting);
 }
 
-
 void StoreMetricsClientInfo(const ::metrics::ClientInfo& client_info) {
   // ClientInfo is a way to get data into the metrics component, but goes unused
   // in Cobalt. Do nothing with it for now.
diff --git a/cobalt/browser/metrics/cobalt_metrics_services_manager_client_test.cc b/cobalt/browser/metrics/cobalt_metrics_services_manager_client_test.cc
index c6bf848..fd1fcd2 100644
--- a/cobalt/browser/metrics/cobalt_metrics_services_manager_client_test.cc
+++ b/cobalt/browser/metrics/cobalt_metrics_services_manager_client_test.cc
@@ -16,10 +16,12 @@
 
 #include <memory>
 
+#include "base/command_line.h"
 #include "base/memory/scoped_refptr.h"
 #include "base/metrics/user_metrics.h"
 #include "base/test/test_simple_task_runner.h"
 #include "components/metrics/metrics_service_client.h"
+#include "components/metrics/metrics_switches.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace cobalt {
@@ -58,12 +60,19 @@
   EXPECT_FALSE(client_->IsMetricsReportingEnabled());
 }
 
-TEST_F(CobaltMetricsServicesManagerClientTest, ForceEnabledStateIsCorrect) {
-  // TODO(b/286091096): Add tests for force enabling on the command-line.
+TEST_F(CobaltMetricsServicesManagerClientTest,
+       ForceEnabledStateIsCorrectWithoutFlag) {
   EXPECT_FALSE(client_->IsMetricsReportingForceEnabled());
 }
 
 TEST_F(CobaltMetricsServicesManagerClientTest,
+       ForceEnabledStateIsCorrectWithFlag) {
+  base::CommandLine::ForCurrentProcess()->AppendSwitch(
+      ::metrics::switches::kForceEnableMetricsReporting);
+  EXPECT_TRUE(client_->IsMetricsReportingForceEnabled());
+}
+
+TEST_F(CobaltMetricsServicesManagerClientTest,
        MetricsServiceClientAndStateManagerAreConstructedProperly) {
   auto metrics_client = client_->CreateMetricsServiceClient();
   ASSERT_NE(metrics_client, nullptr);
diff --git a/cobalt/browser/on_screen_keyboard_starboard_bridge.cc b/cobalt/browser/on_screen_keyboard_starboard_bridge.cc
index ccd818e..f534caa 100644
--- a/cobalt/browser/on_screen_keyboard_starboard_bridge.cc
+++ b/cobalt/browser/on_screen_keyboard_starboard_bridge.cc
@@ -18,7 +18,6 @@
 
 #include "base/bind.h"
 #include "base/callback.h"
-
 #include "starboard/event.h"
 
 namespace cobalt {
@@ -50,7 +49,7 @@
 
 void OnScreenKeyboardStarboardBridge::UpdateSuggestions(
     const script::Sequence<std::string>& suggestions, int ticket) {
-  std::unique_ptr<const char* []> suggestions_data(
+  std::unique_ptr<const char*[]> suggestions_data(
       new const char*[suggestions.size()]);
   for (script::Sequence<std::string>::size_type i = 0; i < suggestions.size();
        ++i) {
diff --git a/cobalt/browser/screen_shot_writer.cc b/cobalt/browser/screen_shot_writer.cc
index 8b27ca4..5e639c3 100644
--- a/cobalt/browser/screen_shot_writer.cc
+++ b/cobalt/browser/screen_shot_writer.cc
@@ -12,10 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/browser/screen_shot_writer.h"
 
+#include <memory>
+#include <utility>
+
 #include "base/basictypes.h"
 #include "base/bind.h"
 #include "base/files/file_util.h"
diff --git a/cobalt/browser/service_worker_registry.cc b/cobalt/browser/service_worker_registry.cc
index f5dd468..bbfdf0f 100644
--- a/cobalt/browser/service_worker_registry.cc
+++ b/cobalt/browser/service_worker_registry.cc
@@ -22,6 +22,7 @@
 #include "base/threading/thread.h"
 #include "base/trace_event/trace_event.h"
 #include "cobalt/network/network_module.h"
+#include "cobalt/watchdog/watchdog.h"
 
 namespace cobalt {
 namespace browser {
@@ -29,6 +30,18 @@
 namespace {
 // Signals the given WaitableEvent.
 void SignalWaitableEvent(base::WaitableEvent* event) { event->Signal(); }
+
+// The watchdog client name used to represent service worker registry thread.
+const char kWatchdogName[] = "service worker registry";
+// The watchdog time interval in microseconds allowed between pings before
+// triggering violations.
+const int64_t kWatchdogTimeInterval = 15000000;
+// The watchdog time wait in microseconds to initially wait before triggering
+// violations.
+const int64_t kWatchdogTimeWait = 15000000;
+// The watchdog time interval in milliseconds between pings.
+const int64_t kWatchdogTimePing = 5000;
+
 }  // namespace
 
 void ServiceWorkerRegistry::WillDestroyCurrentMessageLoop() {
@@ -43,6 +56,21 @@
   if (!thread_.Start()) return;
   DCHECK(message_loop());
 
+  watchdog::Watchdog* watchdog = watchdog::Watchdog::GetInstance();
+
+  // Registers service worker thread as a watchdog client.
+  if (watchdog) {
+    watchdog_registered_ = true;
+    watchdog->Register(kWatchdogName, kWatchdogName,
+                       base::kApplicationStateStarted, kWatchdogTimeInterval,
+                       kWatchdogTimeWait, watchdog::PING);
+    message_loop()->task_runner()->PostDelayedTask(
+        FROM_HERE,
+        base::Bind(&ServiceWorkerRegistry::PingWatchdog,
+                   base::Unretained(this)),
+        base::TimeDelta::FromMilliseconds(kWatchdogTimePing));
+  }
+
   message_loop()->task_runner()->PostTask(
       FROM_HERE,
       base::Bind(&ServiceWorkerRegistry::Initialize, base::Unretained(this),
@@ -69,6 +97,13 @@
   DCHECK(message_loop());
   DCHECK(thread_.IsRunning());
 
+  // Unregisters service worker thread as a watchdog client.
+  watchdog::Watchdog* watchdog = watchdog::Watchdog::GetInstance();
+  if (watchdog) {
+    watchdog_registered_ = false;
+    watchdog->Unregister(kWatchdogName);
+  }
+
   // Ensure that the destruction observer got added before stopping the thread.
   // Stop the thread. This will cause the destruction observer to be notified.
   destruction_observer_added_.Wait();
@@ -77,6 +112,21 @@
   DCHECK(!service_worker_context_);
 }
 
+// Ping watchdog every 5 second, otherwise a violation will be triggered.
+void ServiceWorkerRegistry::PingWatchdog() {
+  DCHECK_EQ(base::MessageLoop::current(), message_loop());
+
+  watchdog::Watchdog* watchdog = watchdog::Watchdog::GetInstance();
+  // If watchdog is already unregistered or shut down, stop ping watchdog.
+  if (!watchdog_registered_ || !watchdog) return;
+
+  watchdog->Ping(kWatchdogName);
+  message_loop()->task_runner()->PostDelayedTask(
+      FROM_HERE,
+      base::Bind(&ServiceWorkerRegistry::PingWatchdog, base::Unretained(this)),
+      base::TimeDelta::FromMilliseconds(kWatchdogTimePing));
+}
+
 void ServiceWorkerRegistry::EnsureServiceWorkerStarted(
     const url::Origin& storage_key, const GURL& client_url,
     base::WaitableEvent* done_event) {
diff --git a/cobalt/browser/service_worker_registry.h b/cobalt/browser/service_worker_registry.h
index 5b57118..4880d6a 100644
--- a/cobalt/browser/service_worker_registry.h
+++ b/cobalt/browser/service_worker_registry.h
@@ -21,6 +21,7 @@
 #include "base/synchronization/waitable_event.h"
 #include "base/threading/thread.h"
 #include "cobalt/network/network_module.h"
+#include "cobalt/watchdog/watchdog.h"
 #include "cobalt/web/web_settings.h"
 #include "cobalt/worker/service_worker_context.h"
 
@@ -57,6 +58,10 @@
                   network::NetworkModule* network_module,
                   web::UserAgentPlatformInfo* platform_info, const GURL& url);
 
+  void PingWatchdog();
+
+  bool watchdog_registered_ = false;
+
   // The thread created and owned by the Service Worker Registry.
   // All registry mutations occur on this thread. The thread has to outlive all
   // web Agents that use service workers.,
diff --git a/cobalt/browser/splash_screen_cache.cc b/cobalt/browser/splash_screen_cache.cc
index a139f6f..3e27fdf 100644
--- a/cobalt/browser/splash_screen_cache.cc
+++ b/cobalt/browser/splash_screen_cache.cc
@@ -19,12 +19,13 @@
 #include <vector>
 
 #include "base/base64.h"
+#include "base/files/file_path.h"
+#include "base/files/file_util.h"
 #include "base/hash.h"
 #include "base/optional.h"
 #include "base/strings/string_util.h"
 #include "base/synchronization/lock.h"
 #include "cobalt/base/get_application_key.h"
-#include "starboard/common/file.h"
 #include "starboard/common/string.h"
 #include "starboard/configuration_constants.h"
 #include "starboard/directory.h"
@@ -85,13 +86,8 @@
   if (!CreateDirsForKey(key.value())) {
     return false;
   }
-  std::string full_path =
-      std::string(path.data()) + kSbFileSepString + key.value();
-  starboard::ScopedFile cache_file(
-      full_path.c_str(), kSbFileCreateAlways | kSbFileWrite, NULL, NULL);
-
-  return cache_file.WriteAll(content.c_str(),
-                             static_cast<int>(content.size())) > 0;
+  base::FilePath file_path = base::FilePath(path.data()).Append(key.value());
+  return base::WriteFile(file_path, content.c_str(), content.size()) > 0;
 }
 
 bool SplashScreenCache::IsSplashScreenCached() const {
@@ -120,18 +116,18 @@
     result->reset();
     return 0;
   }
-  std::string full_path = std::string(path.data()) + kSbFileSepString + key;
-  starboard::ScopedFile cache_file(full_path.c_str(),
-                                   kSbFileOpenOnly | kSbFileRead, NULL, NULL);
-  SbFileInfo info;
-  bool success = SbFileGetPathInfo(full_path.c_str(), &info);
-  if (!success) {
+  base::FilePath file_path = base::FilePath(path.data()).Append(key);
+  int64_t file_size;
+  if (!base::GetFileSize(file_path, &file_size)) {
     result->reset();
     return 0;
   }
-  const int kFileSize = static_cast<int>(info.size);
-  result->reset(new char[kFileSize]);
-  int result_size = cache_file.ReadAll(result->get(), kFileSize);
+  result->reset(new char[file_size]);
+  int result_size = base::ReadFile(file_path, result->get(), file_size);
+  if (result_size <= 0) {
+    result->reset();
+    return 0;
+  }
   last_page_hash_ = base::Hash(result->get(), result_size);
   return result_size;
 }
diff --git a/cobalt/browser/switches.cc b/cobalt/browser/switches.cc
index e455eeb..70bb756 100644
--- a/cobalt/browser/switches.cc
+++ b/cobalt/browser/switches.cc
@@ -36,6 +36,9 @@
     "IPv4), and to listen to LOOPBACK use \"::1\" (\"127.0.0.1\" for IPv4)";
 
 #if defined(ENABLE_DEBUGGER)
+const char kDisableWebDebugger[] = "disable_web_debugger";
+const char kDisableWebDebuggerHelp[] = "Disable support for the web debugger";
+
 const char kRemoteDebuggingPort[] = "remote_debugging_port";
 const char kRemoteDebuggingPortHelp[] =
     "Remote web debugger is served from the specified port. If 0, then the "
@@ -121,11 +124,6 @@
     "If this flag is set, input will be continuously generated randomly "
     "instead of taken from an external input device (like a controller).";
 
-const char kMemoryTracker[] = "memory_tracker";
-const char kMemoryTrackerHelp[] =
-    "Enables memory tracking by installing the memory tracker on startup. Run "
-    "--memory_tracker=help for more info.";
-
 const char kMinCompatibilityVersion[] = "min_compatibility_version";
 const char kMinCompatibilityVersionHelp[] =
     "The minimum version of Cobalt that will be checked during compatibility "
@@ -444,8 +442,9 @@
     {kDebugConsoleMode, kDebugConsoleModeHelp},
         {kDevServersListenIp, kDevServersListenIpHelp},
 #if defined(ENABLE_DEBUGGER)
-        {kWaitForWebDebugger, kWaitForWebDebuggerHelp},
+        {kDisableWebDebugger, kDisableWebDebuggerHelp},
         {kRemoteDebuggingPort, kRemoteDebuggingPortHelp},
+        {kWaitForWebDebugger, kWaitForWebDebuggerHelp},
 #endif  // ENABLE_DEBUGGER
         {kDisableImageAnimations, kDisableImageAnimationsHelp},
         {kForceDeterministicRendering, kForceDeterministicRenderingHelp},
@@ -459,7 +458,7 @@
         {kExtraWebFileDir, kExtraWebFileDirHelp},
         {kFakeMicrophone, kFakeMicrophoneHelp},
         {kIgnoreCertificateErrors, kIgnoreCertificateErrorsHelp},
-        {kInputFuzzer, kInputFuzzerHelp}, {kMemoryTracker, kMemoryTrackerHelp},
+        {kInputFuzzer, kInputFuzzerHelp},
         {kMinCompatibilityVersion, kMinCompatibilityVersionHelp},
         {kNullSavegame, kNullSavegameHelp}, {kProd, kProdHelp},
         {kRequireCSP, kRequireCSPHelp},
diff --git a/cobalt/browser/switches.h b/cobalt/browser/switches.h
index c1401d7..8cef3d8 100644
--- a/cobalt/browser/switches.h
+++ b/cobalt/browser/switches.h
@@ -30,6 +30,8 @@
 extern const char kDevServersListenIpHelp[];
 
 #if defined(ENABLE_DEBUGGER)
+extern const char kDisableWebDebugger[];
+extern const char kDisableWebDebuggerHelp[];
 extern const char kRemoteDebuggingPort[];
 extern const char kRemoteDebuggingPortHelp[];
 extern const char kWaitForWebDebugger[];
@@ -62,8 +64,6 @@
 extern const char kIgnoreCertificateErrorsHelp[];
 extern const char kInputFuzzer[];
 extern const char kInputFuzzerHelp[];
-extern const char kMemoryTracker[];
-extern const char kMemoryTrackerHelp[];
 extern const char kMinCompatibilityVersion[];
 extern const char kMinCompatibilityVersionHelp[];
 extern const char kNullSavegame[];
diff --git a/cobalt/browser/system_platform_error_handler.cc b/cobalt/browser/system_platform_error_handler.cc
index b16feca..71e03d3 100644
--- a/cobalt/browser/system_platform_error_handler.cc
+++ b/cobalt/browser/system_platform_error_handler.cc
@@ -23,7 +23,7 @@
     const SystemPlatformErrorOptions& options) {
   DCHECK(!options.callback.is_null());
 
-  CallbackData* callback_data = new CallbackData{ &mutex_, options.callback };
+  CallbackData* callback_data = new CallbackData{&mutex_, options.callback};
 
   if (!SbSystemRaisePlatformError(
           options.error_type,
diff --git a/cobalt/browser/web_module.cc b/cobalt/browser/web_module.cc
index 33ca0be..c955f83 100644
--- a/cobalt/browser/web_module.cc
+++ b/cobalt/browser/web_module.cc
@@ -142,8 +142,7 @@
 
 #if defined(ENABLE_DEBUGGER)
   debug::backend::DebugDispatcher* debug_dispatcher() {
-    DCHECK(debug_module_);
-    return debug_module_->debug_dispatcher();
+    return debug_module_ ? debug_module_->debug_dispatcher() : nullptr;
   }
 #endif  // ENABLE_DEBUGGER
 
@@ -229,7 +228,13 @@
 
   void FreezeDebugger(
       std::unique_ptr<debug::backend::DebuggerState>* debugger_state) {
-    if (debugger_state) *debugger_state = debug_module_->Freeze();
+    if (debugger_state) {
+      if (debug_module_) {
+        *debugger_state = debug_module_->Freeze();
+      } else {
+        debugger_state->reset();
+      }
+    }
   }
 #endif  // defined(ENABLE_DEBUGGER)
 
@@ -537,6 +542,7 @@
       data.options.loader_thread_priority));
 
   animated_image_tracker_.reset(new loader::image::AnimatedImageTracker(
+      web_context_->name().c_str(),
       data.options.animated_image_decode_thread_priority));
 
   DCHECK_LE(0, data.options.image_cache_capacity);
@@ -612,7 +618,7 @@
   web_context_->global_environment()->AddRoot(media_source_registry_.get());
 
 #if defined(ENABLE_DEBUGGER)
-  if (data.options.wait_for_web_debugger) {
+  if (data.options.enable_debugger && data.options.wait_for_web_debugger) {
     // Post a task that blocks the message loop and waits for the web debugger.
     // This must be posted before the the window's task to load the document.
     waiting_for_web_debugger_->store(true);
@@ -717,13 +723,15 @@
   }
 
 #if defined(ENABLE_DEBUGGER)
-  debug_overlay_.reset(
-      new debug::backend::RenderOverlay(render_tree_produced_callback_));
+  if (data.options.enable_debugger) {
+    debug_overlay_.reset(
+        new debug::backend::RenderOverlay(render_tree_produced_callback_));
 
-  debug_module_.reset(new debug::backend::DebugModule(
-      &debugger_hooks_, web_context_->global_environment(),
-      debug_overlay_.get(), resource_provider_, window_,
-      data.options.debugger_state));
+    debug_module_.reset(new debug::backend::DebugModule(
+        &debugger_hooks_, web_context_->global_environment(),
+        debug_overlay_.get(), resource_provider_, window_,
+        data.options.debugger_state));
+  }
 #endif  // ENABLE_DEBUGGER
 
   report_unload_timing_info_callback_ =
@@ -954,7 +962,11 @@
                  last_render_tree_produced_time_));
 
 #if defined(ENABLE_DEBUGGER)
-  debug_overlay_->OnRenderTreeProduced(layout_results_with_callback);
+  if (debug_overlay_) {
+    debug_overlay_->OnRenderTreeProduced(layout_results_with_callback);
+  } else {
+    render_tree_produced_callback_.Run(layout_results_with_callback);
+  }
 #else   // ENABLE_DEBUGGER
   render_tree_produced_callback_.Run(layout_results_with_callback);
 #endif  // ENABLE_DEBUGGER
@@ -975,6 +987,7 @@
   DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   web_module_stat_tracker_->OnRenderTreeRasterized(produced_time,
                                                    rasterized_time);
+  animated_image_tracker_->OnRenderTreeRasterized();
   if (produced_time >= last_render_tree_produced_time_) {
     is_render_tree_rasterization_pending_ = false;
   }
@@ -1034,12 +1047,13 @@
 #if defined(ENABLE_DEBUGGER)
 void WebModule::Impl::WaitForWebDebugger() {
   DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
-  DCHECK(debug_module_);
-  LOG(WARNING) << "\n-------------------------------------"
-                  "\n Waiting for web debugger to connect "
-                  "\n-------------------------------------";
-  // This blocks until the web debugger connects.
-  debug_module_->debug_dispatcher()->SetPaused(true);
+  if (debug_module_) {
+    LOG(WARNING) << "\n-------------------------------------"
+                    "\n Waiting for web debugger to connect "
+                    "\n-------------------------------------";
+    // This blocks until the web debugger connects.
+    debug_module_->debug_dispatcher()->SetPaused(true);
+  }
   waiting_for_web_debugger_->store(false);
 }
 #endif  // defined(ENABLE_DEBUGGER)
@@ -1130,7 +1144,7 @@
 
 #if defined(ENABLE_DEBUGGER)
   // The debug overlay may be holding onto a render tree, clear that out.
-  debug_overlay_->ClearInput();
+  if (debug_overlay_) debug_overlay_->ClearInput();
 #endif
 
   // Force garbage collection in |javascript_engine|.
diff --git a/cobalt/browser/web_module.h b/cobalt/browser/web_module.h
index 8c28dce..28fa714 100644
--- a/cobalt/browser/web_module.h
+++ b/cobalt/browser/web_module.h
@@ -229,6 +229,8 @@
     bool limit_performance_timer_resolution = true;
 
 #if defined(ENABLE_DEBUGGER)
+    // Whether a debugger should be started for this WebModule.
+    bool enable_debugger = false;
     // Whether the debugger should block until remote devtools connects.
     bool wait_for_web_debugger = false;
 
diff --git a/cobalt/build/build_info.py b/cobalt/build/build_info.py
index 2edcc52..aed2646 100755
--- a/cobalt/build/build_info.py
+++ b/cobalt/build/build_info.py
@@ -26,6 +26,7 @@
 
 _BUILD_ID_PATTERN = '^BUILD_NUMBER=([1-9][0-9]{6,})$'
 _GIT_REV_PATTERN = '^GitOrigin-RevId: ([0-9a-f]{40})$'
+_COBALT_VERSION_PATTERN = '^#define COBALT_VERSION "(.*)"$'
 
 
 def get_build_id_and_git_rev_from_commits(cwd):
@@ -77,6 +78,16 @@
   return _get_last_commit_with_format(r'%s', cwd=cwd)
 
 
+def _get_cobalt_version():
+  version_header_path = os.path.join(os.path.dirname(FILE_DIR), 'version.h')
+  contents = ''
+  with open(version_header_path, 'r', encoding='utf-8') as f:
+    contents = f.read()
+  compiled_cobalt_version_pattern = re.compile(
+      _COBALT_VERSION_PATTERN, flags=re.MULTILINE)
+  return compiled_cobalt_version_pattern.search(contents).group(1)
+
+
 def main(output_path, cwd=FILE_DIR):
   """Writes a Cobalt build_info json file."""
   build_rev = _get_hash_from_last_commit(cwd=cwd)
@@ -84,6 +95,7 @@
   if build_id is None:
     build_id = get_build_id_from_commit_count(cwd=cwd)
     git_rev = build_rev
+  cobalt_version = _get_cobalt_version()
   build_time = datetime.datetime.now().ctime()
   author = _get_author_from_last_commit(cwd=cwd)
   commit = _get_subject_from_last_commit(cwd=cwd)
@@ -92,6 +104,7 @@
       'build_id': build_id,
       'build_rev': build_rev,
       'git_rev': git_rev,
+      'cobalt_version': cobalt_version,
       'build_time': build_time,
       'author': author,
       'commit': commit
@@ -108,6 +121,7 @@
 Build ID: {build_id}
 Build Rev: {build_rev}
 Git Rev: {git_rev}
+Cobalt Version: {cobalt_version}
 Build Time: {build_time}
 Author: {author}
 Commit: {commit}
diff --git a/cobalt/build/cobalt_configuration.py b/cobalt/build/cobalt_configuration.py
index 91b90a6..e1320ab 100644
--- a/cobalt/build/cobalt_configuration.py
+++ b/cobalt/build/cobalt_configuration.py
@@ -105,6 +105,7 @@
     ]
     return filters
 
+  # TODO(b/292007482): Replace static list with gn query.
   def GetTestTargets(self):
     return [
         'audio_test',
@@ -112,38 +113,48 @@
         'base_unittests',
         'bindings_test',
         'browser_test',
+        'components_metrics_tests',
+        'crypto_impl_test',
         'crypto_unittests',
         'csp_test',
-        'css_parser_test',
         'cssom_test',
+        'css_parser_test',
+        'cwrappers_test',
         'dom_parser_test',
         'dom_test',
         'extension_test',
+        # TODO(b/292127297): This target is not built for all platforms.
+        # 'ffmpeg_demuxer_test',
         'graphics_system_test',
         'layout_test',
         'layout_tests',
-        'cwrappers_test',
         'loader_test',
         'math_test',
         'media_capture_test',
         'media_session_test',
         'media_stream_test',
+        # TODO(b/292030213): Crashes on evergreen
+        # 'media_test',
         'memory_store_test',
         'metrics_test',
         'nb_test',
         'net_unittests',
         'network_test',
+        'overlay_info_test',
         'persistent_settings_test',
+        'png_utils_test',
         'poem_unittests',
-        'render_tree_test',
         'renderer_test',
+        'render_tree_test',
         'scroll_engine_tests',
+        'speech_test',
         'storage_test',
         'text_encoding_test',
-        'web_test',
+        'watchdog_test',
         'web_animations_test',
         'webdriver_test',
         'websocket_test',
+        'web_test',
         'worker_test',
         'xhr_test',
         'zip_unittests',
diff --git a/cobalt/build/gn.py b/cobalt/build/gn.py
index 7ff3bc4..e8c4472 100755
--- a/cobalt/build/gn.py
+++ b/cobalt/build/gn.py
@@ -68,7 +68,7 @@
   parser.add_argument(
       '-p',
       '--platform',
-      required=True,
+      default='linux-x64x11',
       choices=list(PLATFORMS),
       help='The platform to build.')
   parser.add_argument(
diff --git a/cobalt/codereview.settings b/cobalt/codereview.settings
deleted file mode 100644
index a4b341a..0000000
--- a/cobalt/codereview.settings
+++ /dev/null
@@ -1,4 +0,0 @@
-# This file is used by gcl to get repository specific information.
-GERRIT_HOST: lbshell-internal-review.googlesource.com
-GERRIT_AUTODETECT_BRANCH: true
-CODE_REVIEW_SERVER: lbshell-internal-review.googlesource.com
diff --git a/cobalt/csp/content_security_policy_test.cc b/cobalt/csp/content_security_policy_test.cc
index 8ef00fd..880ff4e 100644
--- a/cobalt/csp/content_security_policy_test.cc
+++ b/cobalt/csp/content_security_policy_test.cc
@@ -12,9 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "cobalt/csp/content_security_policy.h"
+
 #include <memory>
 
-#include "cobalt/csp/content_security_policy.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
 
diff --git a/cobalt/css_parser/BUILD.gn b/cobalt/css_parser/BUILD.gn
index d6a668c..bff1cfa 100644
--- a/cobalt/css_parser/BUILD.gn
+++ b/cobalt/css_parser/BUILD.gn
@@ -94,7 +94,6 @@
     ":css_grammar",
     "//cobalt/base",
     "//cobalt/cssom",
-    "//nb",
     "//starboard/common",
   ]
 
diff --git a/cobalt/css_parser/border_shorthand_property_parse_structures.cc b/cobalt/css_parser/border_shorthand_property_parse_structures.cc
index cb259db..b18735d 100644
--- a/cobalt/css_parser/border_shorthand_property_parse_structures.cc
+++ b/cobalt/css_parser/border_shorthand_property_parse_structures.cc
@@ -40,7 +40,7 @@
       break;
     }
     case 2: {
-      // If left is mising, it is the same as right; If bottom is missing, it is
+      // If left is missing, it is the same as right; If bottom is missing, it's
       // the same as top.
       border_top = list->value()[0];
       border_right = list->value()[1];
diff --git a/cobalt/css_parser/margin_or_padding_shorthand.cc b/cobalt/css_parser/margin_or_padding_shorthand.cc
index 2067923..5260e2d 100644
--- a/cobalt/css_parser/margin_or_padding_shorthand.cc
+++ b/cobalt/css_parser/margin_or_padding_shorthand.cc
@@ -12,10 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/css_parser/margin_or_padding_shorthand.h"
 
+#include <memory>
+
 namespace cobalt {
 namespace css_parser {
 
diff --git a/cobalt/css_parser/parser.cc b/cobalt/css_parser/parser.cc
index 49a1e2d..ccc9b42 100644
--- a/cobalt/css_parser/parser.cc
+++ b/cobalt/css_parser/parser.cc
@@ -88,7 +88,6 @@
 #include "cobalt/cssom/unicode_range_value.h"
 #include "cobalt/cssom/universal_selector.h"
 #include "cobalt/cssom/url_value.h"
-#include "nb/memory_scope.h"
 
 namespace cobalt {
 namespace css_parser {
@@ -271,21 +270,18 @@
           supports_map_to_mesh == Parser::kSupportsMapToMeshRectangular) {}
 
 scoped_refptr<cssom::CSSStyleSheet> ParserImpl::ParseStyleSheet() {
-  TRACK_MEMORY_SCOPE("CSS");
   scanner_.PrependToken(kStyleSheetEntryPointToken);
   return Parse() ? style_sheet_
                  : base::WrapRefCounted(new cssom::CSSStyleSheet(css_parser_));
 }
 
 scoped_refptr<cssom::CSSRule> ParserImpl::ParseRule() {
-  TRACK_MEMORY_SCOPE("CSS");
   scanner_.PrependToken(kRuleEntryPointToken);
   return Parse() ? rule_ : NULL;
 }
 
 scoped_refptr<cssom::CSSDeclaredStyleData>
 ParserImpl::ParseStyleDeclarationList() {
-  TRACK_MEMORY_SCOPE("CSS");
   scanner_.PrependToken(kStyleDeclarationListEntryPointToken);
   return Parse() ? style_declaration_data_
                  : base::WrapRefCounted(new cssom::CSSDeclaredStyleData());
@@ -293,7 +289,6 @@
 
 scoped_refptr<cssom::CSSFontFaceDeclarationData>
 ParserImpl::ParseFontFaceDeclarationList() {
-  TRACK_MEMORY_SCOPE("CSS");
   scanner_.PrependToken(kFontFaceDeclarationListEntryPointToken);
   return Parse()
              ? font_face_declaration_data_
@@ -312,7 +307,6 @@
 
 scoped_refptr<cssom::PropertyValue> ParserImpl::ParsePropertyValue(
     const std::string& property_name) {
-  TRACK_MEMORY_SCOPE("CSS");
   Token property_name_token;
   bool is_property_name_known =
       scanner_.DetectPropertyNameToken(property_name, &property_name_token);
@@ -335,7 +329,6 @@
 void ParserImpl::ParsePropertyIntoDeclarationData(
     const std::string& property_name,
     cssom::CSSDeclarationData* declaration_data) {
-  TRACK_MEMORY_SCOPE("CSS");
   Token property_name_token;
   bool is_property_name_known =
       scanner_.DetectPropertyNameToken(property_name, &property_name_token);
@@ -364,13 +357,11 @@
 }
 
 scoped_refptr<cssom::MediaList> ParserImpl::ParseMediaList() {
-  TRACK_MEMORY_SCOPE("CSS");
   scanner_.PrependToken(kMediaListEntryPointToken);
   return Parse() ? media_list_ : base::WrapRefCounted(new cssom::MediaList());
 }
 
 scoped_refptr<cssom::MediaQuery> ParserImpl::ParseMediaQuery() {
-  TRACK_MEMORY_SCOPE("CSS");
   scanner_.PrependToken(kMediaQueryEntryPointToken);
   return Parse() ? media_query_ : base::WrapRefCounted(new cssom::MediaQuery());
 }
@@ -390,7 +381,6 @@
 }
 
 bool ParserImpl::Parse() {
-  TRACK_MEMORY_SCOPE("CSS");
   // For more information on error codes
   // see http://www.gnu.org/software/bison/manual/html_node/Parser-Function.html
   TRACE_EVENT0("cobalt::css_parser", "ParseImpl::Parse");
diff --git a/cobalt/css_parser/parser_test.cc b/cobalt/css_parser/parser_test.cc
index 3c1d879..d65c464 100644
--- a/cobalt/css_parser/parser_test.cc
+++ b/cobalt/css_parser/parser_test.cc
@@ -1405,7 +1405,9 @@
 // for the expanded properties for values 'inherit' and 'initial'.
 TEST_F(ParserTest, ParsesShorthandPropertyInitialAndInherit) {
   const char* shorthand_property_keywords[] = {
-      "inherit", "initial", nullptr,
+      "inherit",
+      "initial",
+      nullptr,
   };
 
   // Helper class to check if a PropertyValue is a KeywordValue.
diff --git a/cobalt/css_parser/scanner_test.cc b/cobalt/css_parser/scanner_test.cc
index 3bd87ac..e5e9a7d 100644
--- a/cobalt/css_parser/scanner_test.cc
+++ b/cobalt/css_parser/scanner_test.cc
@@ -27,9 +27,9 @@
 // below, this DISABLED test should be enabled.
 
 const char* kNumericLocales[] = {
-  "",       // default locale
-  "C",      // dot radix separator
-  "de_DE",  // comma radix separator
+    "",       // default locale
+    "C",      // dot radix separator
+    "de_DE",  // comma radix separator
 };
 
 class ScannerTest : public ::testing::Test,
@@ -42,14 +42,14 @@
       return;
     }
 
-#if SB_IS(EVERGREEN)
+#if SB_IS(MODULAR)
     // We don't support changing locale for Evergreen so run only
     // if the default/empty local is passed in the param.
     locale_okay_ = (GetParam()[0] == 0);
 #else
     // Save the old locale.
     char* old_locale_cstr = setlocale(LC_NUMERIC, nullptr);
-    EXPECT_TRUE(old_locale_cstr != nullptr) << "Cant' save original locale";
+    EXPECT_TRUE(old_locale_cstr != nullptr) << "Can't save original locale";
     old_locale_ = old_locale_cstr;
 
     // Keep the default locale when the param is empty, and for other param
@@ -60,7 +60,7 @@
   }
 
   virtual void TearDown() {
-#if !SB_IS(EVERGREEN)
+#if !SB_IS(MODULAR)
     if (!old_locale_.empty()) setlocale(LC_NUMERIC, old_locale_.c_str());
 #endif
   }
@@ -764,10 +764,10 @@
   const char* text;
   int token;
 } known_dash_functions[] = {
-  { "-cobalt-mtm", kCobaltMtmFunctionToken },
-  { "-cobalt-ui-nav-focus-transform", kCobaltUiNavFocusTransformFunctionToken },
-  { "-cobalt-ui-nav-spotlight-transform",
-    kCobaltUiNavSpotlightTransformFunctionToken },
+    {"-cobalt-mtm", kCobaltMtmFunctionToken},
+    {"-cobalt-ui-nav-focus-transform", kCobaltUiNavFocusTransformFunctionToken},
+    {"-cobalt-ui-nav-spotlight-transform",
+     kCobaltUiNavSpotlightTransformFunctionToken},
 };
 }  // namespace
 
@@ -778,10 +778,11 @@
 
     Scanner scanner(text.c_str(), &string_pool_);
     ASSERT_EQ(known_dash_functions[i].token,
-              yylex(&token_value_, &token_location_, &scanner)) << text;
+              yylex(&token_value_, &token_location_, &scanner))
+        << text;
     ASSERT_EQ(')', yylex(&token_value_, &token_location_, &scanner)) << text;
-    ASSERT_EQ(kEndOfFileToken,
-              yylex(&token_value_, &token_location_, &scanner)) << text;
+    ASSERT_EQ(kEndOfFileToken, yylex(&token_value_, &token_location_, &scanner))
+        << text;
   }
 }
 
@@ -792,10 +793,11 @@
 
     Scanner scanner(text.c_str(), &string_pool_);
     ASSERT_EQ(known_dash_functions[i].token,
-              yylex(&token_value_, &token_location_, &scanner)) << text;
+              yylex(&token_value_, &token_location_, &scanner))
+        << text;
     ASSERT_EQ(')', yylex(&token_value_, &token_location_, &scanner)) << text;
-    ASSERT_EQ(kEndOfFileToken,
-              yylex(&token_value_, &token_location_, &scanner)) << text;
+    ASSERT_EQ(kEndOfFileToken, yylex(&token_value_, &token_location_, &scanner))
+        << text;
   }
 }
 
diff --git a/cobalt/css_parser/string_pool.h b/cobalt/css_parser/string_pool.h
index b94f72d..1383b91 100644
--- a/cobalt/css_parser/string_pool.h
+++ b/cobalt/css_parser/string_pool.h
@@ -17,6 +17,7 @@
 
 #include <memory>
 #include <string>
+#include <vector>
 
 
 namespace cobalt {
diff --git a/cobalt/css_parser/trivial_string_piece.h b/cobalt/css_parser/trivial_string_piece.h
index 4c5be8f..eb491eb 100644
--- a/cobalt/css_parser/trivial_string_piece.h
+++ b/cobalt/css_parser/trivial_string_piece.h
@@ -54,8 +54,7 @@
 
 // Used by tests.
 inline bool operator==(const TrivialStringPiece& lhs, const char* rhs) {
-  return strncmp(lhs.begin, rhs, lhs.size()) == 0 &&
-         rhs[lhs.size()] == '\0';
+  return strncmp(lhs.begin, rhs, lhs.size()) == 0 && rhs[lhs.size()] == '\0';
 }
 
 // Used by tests.
diff --git a/cobalt/cssom/animation_set.cc b/cobalt/cssom/animation_set.cc
index 751b72a..1432030 100644
--- a/cobalt/cssom/animation_set.cc
+++ b/cobalt/cssom/animation_set.cc
@@ -160,19 +160,21 @@
 
     // Create the animation and insert it into our map of currently active
     // animations.
-    InternalAnimationMap::iterator inserted = animations_.insert(
-        std::make_pair(
-            name_string,
-            AnimationEntry(Animation(name_string, keyframes, current_time,
-                GetTimeValue(i, style.animation_delay().get()),
-                GetTimeValue(i, style.animation_duration().get()),
-                GetFillMode(i, style.animation_fill_mode().get()),
-                GetIterationCount(
-                    i, style.animation_iteration_count().get()),
-                GetDirection(i, style.animation_direction().get()),
-                GetTimingFunction(
-                    i, style.animation_timing_function().get())))))
-        .first;
+    InternalAnimationMap::iterator inserted =
+        animations_
+            .insert(std::make_pair(
+                name_string,
+                AnimationEntry(Animation(
+                    name_string, keyframes, current_time,
+                    GetTimeValue(i, style.animation_delay().get()),
+                    GetTimeValue(i, style.animation_duration().get()),
+                    GetFillMode(i, style.animation_fill_mode().get()),
+                    GetIterationCount(i,
+                                      style.animation_iteration_count().get()),
+                    GetDirection(i, style.animation_direction().get()),
+                    GetTimingFunction(
+                        i, style.animation_timing_function().get())))))
+            .first;
     if (event_handler_) {
       event_handler_->OnAnimationStarted(inserted->second.animation, this);
     }
@@ -187,8 +189,8 @@
     // If the animation is playing, but the current time is past the end time,
     // then we should signal to the event handler that it has ended.
     bool animation_has_ended =
-        current_time >= iter->second.animation.start_time() +
-                        iter->second.animation.duration();
+        current_time >=
+        iter->second.animation.start_time() + iter->second.animation.duration();
     if (animation_has_ended && !iter->second.ended) {
       iter->second.ended = true;
       if (event_handler_) {
diff --git a/cobalt/cssom/animation_set.h b/cobalt/cssom/animation_set.h
index 081ab95..5504f59 100644
--- a/cobalt/cssom/animation_set.h
+++ b/cobalt/cssom/animation_set.h
@@ -17,6 +17,7 @@
 
 #include <map>
 #include <string>
+#include <utility>
 
 #include "cobalt/cssom/animation.h"
 #include "cobalt/cssom/css_computed_style_data.h"
diff --git a/cobalt/cssom/cascade_precedence.h b/cobalt/cssom/cascade_precedence.h
index 60f978e..ffb72b2 100644
--- a/cobalt/cssom/cascade_precedence.h
+++ b/cobalt/cssom/cascade_precedence.h
@@ -79,7 +79,7 @@
  public:
   explicit CascadePrecedence(Origin origin) : origin_(origin) {}
   CascadePrecedence(Origin origin, const Specificity& specificity,
-                  const Appearance& appearance)
+                    const Appearance& appearance)
       : origin_(origin), specificity_(specificity), appearance_(appearance) {}
 
   Origin origin() const { return origin_; }
diff --git a/cobalt/cssom/cascaded_style_test.cc b/cobalt/cssom/cascaded_style_test.cc
index da6cb14..644b611 100644
--- a/cobalt/cssom/cascaded_style_test.cc
+++ b/cobalt/cssom/cascaded_style_test.cc
@@ -12,10 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/cssom/cascaded_style.h"
 
+#include <memory>
+#include <utility>
+
 #include "cobalt/css_parser/parser.h"
 #include "cobalt/cssom/cascade_precedence.h"
 #include "cobalt/cssom/css_computed_style_data.h"
@@ -46,44 +47,47 @@
   // rule 2 > rule 3 > rule 1.
 
   scoped_refptr<CSSStyleRule> css_style_rule_1 =
-      css_parser->ParseRule(
-                    "div {"
-                    "  left: 100px !important;"
-                    "  right: 100px;"
-                    "  width: 100px;"
-                    "  height: 100px;"
-                    "}",
-                    base::SourceLocation("[object CascadedStyleTest]", 1, 1))
+      css_parser
+          ->ParseRule(
+              "div {"
+              "  left: 100px !important;"
+              "  right: 100px;"
+              "  width: 100px;"
+              "  height: 100px;"
+              "}",
+              base::SourceLocation("[object CascadedStyleTest]", 1, 1))
           ->AsCSSStyleRule();
   CascadePrecedence cascade_precedence_1(kNormalUserAgent);
   rules_with_cascade_precedence.push_back(
       std::make_pair(css_style_rule_1, cascade_precedence_1));
 
   scoped_refptr<CSSStyleRule> css_style_rule_2 =
-      css_parser->ParseRule(
-                    "div {"
-                    "  left: 200px;"
-                    "  right: 200px !important;"
-                    "  width: 200px;"
-                    "  height: 200px;"
-                    "  vertical-align: top !important;"
-                    "  text-align: center !important;"
-                    "}",
-                    base::SourceLocation("[object CascadedStyleTest]", 1, 1))
+      css_parser
+          ->ParseRule(
+              "div {"
+              "  left: 200px;"
+              "  right: 200px !important;"
+              "  width: 200px;"
+              "  height: 200px;"
+              "  vertical-align: top !important;"
+              "  text-align: center !important;"
+              "}",
+              base::SourceLocation("[object CascadedStyleTest]", 1, 1))
           ->AsCSSStyleRule();
   CascadePrecedence cascade_precedence_2(kNormalOverride);
   rules_with_cascade_precedence.push_back(
       std::make_pair(css_style_rule_2, cascade_precedence_2));
 
   scoped_refptr<CSSStyleRule> css_style_rule_3 =
-      css_parser->ParseRule(
-                    "div {"
-                    "  left: 300px;"
-                    "  right: 300px;"
-                    "  width: 300px !important;"
-                    "  height: 300px;"
-                    "}",
-                    base::SourceLocation("[object CascadedStyleTest]", 1, 1))
+      css_parser
+          ->ParseRule(
+              "div {"
+              "  left: 300px;"
+              "  right: 300px;"
+              "  width: 300px !important;"
+              "  height: 300px;"
+              "}",
+              base::SourceLocation("[object CascadedStyleTest]", 1, 1))
           ->AsCSSStyleRule();
   CascadePrecedence cascade_precedence_3(kNormalAuthor);
   rules_with_cascade_precedence.push_back(
@@ -121,25 +125,27 @@
   // rule 2 > rule 1.
 
   scoped_refptr<CSSStyleRule> css_style_rule_1 =
-      css_parser->ParseRule(
-                    "div {"
-                    "  left: 100px !important;"
-                    "  right: 100px;"
-                    "}",
-                    base::SourceLocation("[object CascadedStyleTest]", 1, 1))
+      css_parser
+          ->ParseRule(
+              "div {"
+              "  left: 100px !important;"
+              "  right: 100px;"
+              "}",
+              base::SourceLocation("[object CascadedStyleTest]", 1, 1))
           ->AsCSSStyleRule();
   CascadePrecedence cascade_precedence_1(kNormalUserAgent);
   rules_with_cascade_precedence.push_back(
       std::make_pair(css_style_rule_1, cascade_precedence_1));
 
   scoped_refptr<CSSStyleRule> css_style_rule_2 =
-      css_parser->ParseRule(
-                    "div {"
-                    "  left: 200px;"
-                    "  right: 200px !important;"
-                    "  background-image: url(foo.png);"
-                    "}",
-                    base::SourceLocation("[object CascadedStyleTest]", 1, 1))
+      css_parser
+          ->ParseRule(
+              "div {"
+              "  left: 200px;"
+              "  right: 200px !important;"
+              "  background-image: url(foo.png);"
+              "}",
+              base::SourceLocation("[object CascadedStyleTest]", 1, 1))
           ->AsCSSStyleRule();
   CascadePrecedence cascade_precedence_2(kNormalOverride);
   rules_with_cascade_precedence.push_back(
@@ -177,13 +183,14 @@
       GURL("https://www.youtube.com/tv/img");
 
   scoped_refptr<CSSStyleRule> css_style_rule =
-      css_parser->ParseRule(
-                    "div {"
-                    "  left: 200px;"
-                    "  right: 200px !important;"
-                    "  background-image: url(foo.png);"
-                    "}",
-                    base::SourceLocation("[object CascadedStyleTest]", 1, 1))
+      css_parser
+          ->ParseRule(
+              "div {"
+              "  left: 200px;"
+              "  right: 200px !important;"
+              "  background-image: url(foo.png);"
+              "}",
+              base::SourceLocation("[object CascadedStyleTest]", 1, 1))
           ->AsCSSStyleRule();
   CascadePrecedence cascade_precedence(kNormalOverride);
   rules_with_cascade_precedence.push_back(
@@ -221,12 +228,13 @@
   // rule 2 > rule 1.
 
   scoped_refptr<CSSStyleRule> css_style_rule_1 =
-      css_parser->ParseRule(
-                    "div {"
-                    "  right: 100px;"
-                    "  background-image: url(bar.png) !important;"
-                    "}",
-                    base::SourceLocation("[object CascadedStyleTest]", 1, 1))
+      css_parser
+          ->ParseRule(
+              "div {"
+              "  right: 100px;"
+              "  background-image: url(bar.png) !important;"
+              "}",
+              base::SourceLocation("[object CascadedStyleTest]", 1, 1))
           ->AsCSSStyleRule();
   CascadePrecedence cascade_precedence_1(kNormalUserAgent);
   rules_with_cascade_precedence.push_back(
@@ -238,12 +246,13 @@
   css_style_rule_1->set_parent_style_sheet(parent_style_sheet_1.get());
 
   scoped_refptr<CSSStyleRule> css_style_rule_2 =
-      css_parser->ParseRule(
-                    "div {"
-                    "  right: 200px !important;"
-                    "  background-image: url(foo.png);"
-                    "}",
-                    base::SourceLocation("[object CascadedStyleTest]", 1, 1))
+      css_parser
+          ->ParseRule(
+              "div {"
+              "  right: 200px !important;"
+              "  background-image: url(foo.png);"
+              "}",
+              base::SourceLocation("[object CascadedStyleTest]", 1, 1))
           ->AsCSSStyleRule();
   CascadePrecedence cascade_precedence_2(kNormalOverride);
   rules_with_cascade_precedence.push_back(
diff --git a/cobalt/cssom/color_stop.h b/cobalt/cssom/color_stop.h
index cdbd4d0..367a079 100644
--- a/cobalt/cssom/color_stop.h
+++ b/cobalt/cssom/color_stop.h
@@ -17,6 +17,7 @@
 
 #include <memory>
 #include <string>
+#include <vector>
 
 #include "base/memory/ref_counted.h"
 #include "cobalt/cssom/length_value.h"
diff --git a/cobalt/cssom/combinator.cc b/cobalt/cssom/combinator.cc
index 88e485f..e266360 100644
--- a/cobalt/cssom/combinator.cc
+++ b/cobalt/cssom/combinator.cc
@@ -12,10 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/cssom/combinator.h"
 
+#include <memory>
+#include <utility>
+
 #include "cobalt/cssom/compound_selector.h"
 
 namespace cobalt {
diff --git a/cobalt/cssom/complex_selector.cc b/cobalt/cssom/complex_selector.cc
index e62cc7e..2bf8abd 100644
--- a/cobalt/cssom/complex_selector.cc
+++ b/cobalt/cssom/complex_selector.cc
@@ -12,10 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/cssom/complex_selector.h"
 
+#include <memory>
+#include <utility>
+
 #include "base/logging.h"
 #include "cobalt/cssom/combinator.h"
 #include "cobalt/cssom/compound_selector.h"
diff --git a/cobalt/cssom/complex_selector.h b/cobalt/cssom/complex_selector.h
index 93405e6..037a2ed 100644
--- a/cobalt/cssom/complex_selector.h
+++ b/cobalt/cssom/complex_selector.h
@@ -52,9 +52,7 @@
   CompoundSelector* first_selector() { return first_selector_.get(); }
   CompoundSelector* last_selector() { return last_selector_; }
 
-  int combinator_count() {
-    return combinator_count_;
-  }
+  int combinator_count() { return combinator_count_; }
 
   // For a chain of compound selectors separated by combinators, AppendSelector
   // should be first called with the left most compound selector, then
diff --git a/cobalt/cssom/compound_selector.h b/cobalt/cssom/compound_selector.h
index 54a79fb..3369215 100644
--- a/cobalt/cssom/compound_selector.h
+++ b/cobalt/cssom/compound_selector.h
@@ -17,6 +17,7 @@
 
 #include <memory>
 #include <string>
+#include <vector>
 
 #include "base/basictypes.h"
 #include "base/compiler_specific.h"
diff --git a/cobalt/cssom/computed_style_test.cc b/cobalt/cssom/computed_style_test.cc
index dc1bfe1..7088a10 100644
--- a/cobalt/cssom/computed_style_test.cc
+++ b/cobalt/cssom/computed_style_test.cc
@@ -15,6 +15,7 @@
 #include "cobalt/cssom/computed_style.h"
 
 #include <memory>
+#include <utility>
 #include <vector>
 
 #include "cobalt/base/polymorphic_downcast.h"
@@ -1172,7 +1173,8 @@
   DCHECK_EQ(2u, box_shadow_list->value().size());
 
   float expected_length_value[2][3] = {
-      {100.0f, 30.0f, 150.0f}, {100.0f, 40.0f, 0.0f},
+      {100.0f, 30.0f, 150.0f},
+      {100.0f, 40.0f, 0.0f},
   };
   float expected_color[2] = {0x0047ABFF, 0x000080FF};
   bool expected_has_inset[2] = {true, false};
@@ -1829,7 +1831,8 @@
   DCHECK_EQ(2u, text_shadow_list->value().size());
 
   float expected_length_value[2][3] = {
-      {100.0f, 30.0f, 150.0f}, {100.0f, 40.0f, 0.0f},
+      {100.0f, 30.0f, 150.0f},
+      {100.0f, 40.0f, 0.0f},
   };
   float expected_color[2] = {0x0047ABFF, 0x000080FF};
 
diff --git a/cobalt/cssom/css.idl b/cobalt/cssom/css.idl
index 2569462..100dc48 100644
--- a/cobalt/cssom/css.idl
+++ b/cobalt/cssom/css.idl
@@ -17,4 +17,4 @@
 interface CSS {
   [CallWith=EnvironmentSettings] static boolean supports(DOMString property,
                                                          DOMString value);
-};
\ No newline at end of file
+};
diff --git a/cobalt/cssom/css_computed_style_data_property_set_matcher_test.cc b/cobalt/cssom/css_computed_style_data_property_set_matcher_test.cc
index 6ecb327..115ab22 100644
--- a/cobalt/cssom/css_computed_style_data_property_set_matcher_test.cc
+++ b/cobalt/cssom/css_computed_style_data_property_set_matcher_test.cc
@@ -13,11 +13,9 @@
 // limitations under the License.
 
 #include "cobalt/cssom/css_computed_style_data.h"
-
 #include "cobalt/cssom/font_style_value.h"
 #include "cobalt/cssom/font_weight_value.h"
 #include "cobalt/cssom/keyword_value.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace cobalt {
diff --git a/cobalt/cssom/css_computed_style_data_test.cc b/cobalt/cssom/css_computed_style_data_test.cc
index edc4722..7195282 100644
--- a/cobalt/cssom/css_computed_style_data_test.cc
+++ b/cobalt/cssom/css_computed_style_data_test.cc
@@ -13,6 +13,7 @@
 // limitations under the License.
 
 #include "cobalt/cssom/css_computed_style_data.h"
+
 #include "cobalt/cssom/css_style_sheet.h"
 #include "cobalt/cssom/font_weight_value.h"
 #include "cobalt/cssom/integer_value.h"
@@ -20,7 +21,6 @@
 #include "cobalt/cssom/length_value.h"
 #include "cobalt/cssom/property_definitions.h"
 #include "cobalt/cssom/rgba_color_value.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace cobalt {
diff --git a/cobalt/cssom/css_computed_style_declaration_test.cc b/cobalt/cssom/css_computed_style_declaration_test.cc
index ac53074..8ba0f2d 100644
--- a/cobalt/cssom/css_computed_style_declaration_test.cc
+++ b/cobalt/cssom/css_computed_style_declaration_test.cc
@@ -26,9 +26,9 @@
 namespace cobalt {
 namespace cssom {
 
+using dom::testing::FakeExceptionState;
 using ::testing::_;
 using ::testing::Return;
-using dom::testing::FakeExceptionState;
 
 TEST(CSSComputedStyleDeclarationTest, CSSTextSetterRaisesException) {
   scoped_refptr<CSSComputedStyleDeclaration> style =
diff --git a/cobalt/cssom/css_condition_rule.h b/cobalt/cssom/css_condition_rule.h
index dd78bb7..197bebe 100644
--- a/cobalt/cssom/css_condition_rule.h
+++ b/cobalt/cssom/css_condition_rule.h
@@ -41,9 +41,7 @@
   // Custom, not in any spec.
   //
   // From CSSRule.
-  void Accept(CSSRuleVisitor* visitor) override {
-    NOTREACHED();
-  }
+  void Accept(CSSRuleVisitor* visitor) override { NOTREACHED(); }
 
   // Returns the cached result of evaluating the condition.
   bool condition_value() { return cached_condition_value_; }
diff --git a/cobalt/cssom/css_declared_style_data.cc b/cobalt/cssom/css_declared_style_data.cc
index b5eae46..1f0e8b4 100644
--- a/cobalt/cssom/css_declared_style_data.cc
+++ b/cobalt/cssom/css_declared_style_data.cc
@@ -152,7 +152,8 @@
        property_value_iterator != declared_property_values_.end();
        ++property_value_iterator) {
     if (!property_value_iterator->second->Equals(
-            *that.declared_property_values_.find(property_value_iterator->first)
+            *that.declared_property_values_
+                 .find(property_value_iterator->first)
                  ->second)) {
       return false;
     }
diff --git a/cobalt/cssom/css_declared_style_data_test.cc b/cobalt/cssom/css_declared_style_data_test.cc
index a3f8cef..c3afa40 100644
--- a/cobalt/cssom/css_declared_style_data_test.cc
+++ b/cobalt/cssom/css_declared_style_data_test.cc
@@ -20,7 +20,6 @@
 #include "cobalt/cssom/length_value.h"
 #include "cobalt/cssom/property_definitions.h"
 #include "cobalt/cssom/rgba_color_value.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace cobalt {
diff --git a/cobalt/cssom/css_declared_style_declaration_test.cc b/cobalt/cssom/css_declared_style_declaration_test.cc
index 5e3b92b..abd0322 100644
--- a/cobalt/cssom/css_declared_style_declaration_test.cc
+++ b/cobalt/cssom/css_declared_style_declaration_test.cc
@@ -13,6 +13,7 @@
 // limitations under the License.
 
 #include "cobalt/cssom/css_declared_style_declaration.h"
+
 #include "cobalt/cssom/css_declared_style_data.h"
 #include "cobalt/cssom/css_parser.h"
 #include "cobalt/cssom/css_style_rule.h"
diff --git a/cobalt/cssom/css_font_face_declaration_data.cc b/cobalt/cssom/css_font_face_declaration_data.cc
index 1b5efd3..552c65b 100644
--- a/cobalt/cssom/css_font_face_declaration_data.cc
+++ b/cobalt/cssom/css_font_face_declaration_data.cc
@@ -47,8 +47,8 @@
 scoped_refptr<PropertyValue> CSSFontFaceDeclarationData::GetPropertyValue(
     PropertyKey key) const {
   scoped_refptr<PropertyValue>* property_value_reference =
-      const_cast<CSSFontFaceDeclarationData*>(this)
-          ->GetPropertyValueReference(key);
+      const_cast<CSSFontFaceDeclarationData*>(this)->GetPropertyValueReference(
+          key);
   return property_value_reference ? *property_value_reference : NULL;
 }
 
diff --git a/cobalt/cssom/css_font_face_declaration_data_test.cc b/cobalt/cssom/css_font_face_declaration_data_test.cc
index a7287fa..6eabfd4 100644
--- a/cobalt/cssom/css_font_face_declaration_data_test.cc
+++ b/cobalt/cssom/css_font_face_declaration_data_test.cc
@@ -16,7 +16,6 @@
 
 #include "cobalt/cssom/keyword_value.h"
 #include "cobalt/cssom/property_definitions.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace cobalt {
diff --git a/cobalt/cssom/css_font_face_rule_test.cc b/cobalt/cssom/css_font_face_rule_test.cc
index 9245801..7338325 100644
--- a/cobalt/cssom/css_font_face_rule_test.cc
+++ b/cobalt/cssom/css_font_face_rule_test.cc
@@ -12,10 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/cssom/css_font_face_rule.h"
 
+#include <memory>
+#include <utility>
+
 #include "cobalt/cssom/css_font_face_declaration_data.h"
 #include "cobalt/cssom/css_style_sheet.h"
 #include "cobalt/cssom/font_style_value.h"
diff --git a/cobalt/cssom/css_grouping_rule.h b/cobalt/cssom/css_grouping_rule.h
index 4d364f2..55d7e0e 100644
--- a/cobalt/cssom/css_grouping_rule.h
+++ b/cobalt/cssom/css_grouping_rule.h
@@ -49,9 +49,7 @@
   // Custom, not in any spec.
   //
   // From CSSRule.
-  void Accept(CSSRuleVisitor* visitor) override {
-    NOTREACHED();
-  }
+  void Accept(CSSRuleVisitor* visitor) override { NOTREACHED(); }
 
   void SetIndex(int index) override;
   int IndexWidth() const override;
diff --git a/cobalt/cssom/css_property_definitions_test.cc b/cobalt/cssom/css_property_definitions_test.cc
index 20d3009..cd528a1 100644
--- a/cobalt/cssom/css_property_definitions_test.cc
+++ b/cobalt/cssom/css_property_definitions_test.cc
@@ -13,7 +13,6 @@
 // limitations under the License.
 
 #include "cobalt/cssom/property_definitions.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace cobalt {
diff --git a/cobalt/cssom/css_style_sheet_test.cc b/cobalt/cssom/css_style_sheet_test.cc
index edd0825..5c17d59 100644
--- a/cobalt/cssom/css_style_sheet_test.cc
+++ b/cobalt/cssom/css_style_sheet_test.cc
@@ -12,16 +12,17 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
+#include "cobalt/cssom/css_style_sheet.h"
 
-#include "cobalt/cssom/css_rule_list.h"
+#include <memory>
+#include <utility>
 
 #include "cobalt/cssom/css_media_rule.h"
 #include "cobalt/cssom/css_parser.h"
+#include "cobalt/cssom/css_rule_list.h"
 #include "cobalt/cssom/css_rule_style_declaration.h"
 #include "cobalt/cssom/css_style_declaration.h"
 #include "cobalt/cssom/css_style_rule.h"
-#include "cobalt/cssom/css_style_sheet.h"
 #include "cobalt/cssom/length_value.h"
 #include "cobalt/cssom/media_feature.h"
 #include "cobalt/cssom/media_feature_keyword_value.h"
diff --git a/cobalt/cssom/css_transition_set.cc b/cobalt/cssom/css_transition_set.cc
index 8a6787d..a310e1c 100644
--- a/cobalt/cssom/css_transition_set.cc
+++ b/cobalt/cssom/css_transition_set.cc
@@ -16,6 +16,7 @@
 
 #include <algorithm>
 #include <cmath>
+#include <utility>
 
 #include "base/lazy_instance.h"
 #include "cobalt/base/polymorphic_downcast.h"
@@ -139,7 +140,7 @@
   scoped_refptr<PropertyValue> current_value_within_old_transition =
       old_transition.Evaluate(current_time);
 
-  // If the new transition is a reversal fo the old transition, we need to
+  // If the new transition is a reversal of the old transition, we need to
   // setup reversing_adjusted_start_value and reversing_shortening_factor so
   // that they can be used to reduce the new transition's duration.
   scoped_refptr<PropertyValue> new_reversing_adjusted_start_value;
diff --git a/cobalt/cssom/css_transition_set_test.cc b/cobalt/cssom/css_transition_set_test.cc
index d94a45a..b789693 100644
--- a/cobalt/cssom/css_transition_set_test.cc
+++ b/cobalt/cssom/css_transition_set_test.cc
@@ -12,12 +12,14 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "cobalt/cssom/css_transition_set.h"
+
 #include <memory>
+#include <utility>
 
 #include "base/time/time.h"
 #include "cobalt/cssom/css_computed_style_data.h"
 #include "cobalt/cssom/css_transition.h"
-#include "cobalt/cssom/css_transition_set.h"
 #include "cobalt/cssom/keyword_value.h"
 #include "cobalt/cssom/length_value.h"
 #include "cobalt/cssom/number_value.h"
@@ -28,7 +30,6 @@
 #include "cobalt/cssom/time_list_value.h"
 #include "cobalt/cssom/timing_function.h"
 #include "cobalt/cssom/timing_function_list_value.h"
-
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace cobalt {
diff --git a/cobalt/cssom/filter_function_list_value.h b/cobalt/cssom/filter_function_list_value.h
index 7bcbc0b..cb9cce6 100644
--- a/cobalt/cssom/filter_function_list_value.h
+++ b/cobalt/cssom/filter_function_list_value.h
@@ -16,6 +16,7 @@
 #define COBALT_CSSOM_FILTER_FUNCTION_LIST_VALUE_H_
 
 #include <string>
+#include <utility>
 
 #include "base/compiler_specific.h"
 #include "cobalt/base/polymorphic_equatable.h"
diff --git a/cobalt/cssom/font_weight_value.h b/cobalt/cssom/font_weight_value.h
index 0a6e33b..25f808e 100644
--- a/cobalt/cssom/font_weight_value.h
+++ b/cobalt/cssom/font_weight_value.h
@@ -39,10 +39,10 @@
     kLightAka300,
     kNormalAka400,
     kMediumAka500,
-    kSemiBoldAka600,    // same as Demi Bold
+    kSemiBoldAka600,  // same as Demi Bold
     kBoldAka700,
-    kExtraBoldAka800,   // same as Ultra Bold
-    kBlackAka900,       // same as Heavy
+    kExtraBoldAka800,  // same as Ultra Bold
+    kBlackAka900,      // same as Heavy
   };
 
   // For the sake of saving memory an explicit instantiation of this class
diff --git a/cobalt/cssom/interpolate_property_value_test.cc b/cobalt/cssom/interpolate_property_value_test.cc
index 548594a..cfc8805 100644
--- a/cobalt/cssom/interpolate_property_value_test.cc
+++ b/cobalt/cssom/interpolate_property_value_test.cc
@@ -12,14 +12,16 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "cobalt/cssom/interpolate_property_value.h"
+
 #include <cmath>
+#include <utility>
 
 #include "base/time/time.h"
 #include "cobalt/cssom/calc_value.h"
 #include "cobalt/cssom/cobalt_ui_nav_focus_transform_function.h"
 #include "cobalt/cssom/cobalt_ui_nav_spotlight_transform_function.h"
 #include "cobalt/cssom/css_transition.h"
-#include "cobalt/cssom/interpolate_property_value.h"
 #include "cobalt/cssom/interpolated_transform_property_value.h"
 #include "cobalt/cssom/keyword_value.h"
 #include "cobalt/cssom/length_value.h"
diff --git a/cobalt/cssom/interpolated_transform_property_value.cc b/cobalt/cssom/interpolated_transform_property_value.cc
index ea31222..0de8d3b 100644
--- a/cobalt/cssom/interpolated_transform_property_value.cc
+++ b/cobalt/cssom/interpolated_transform_property_value.cc
@@ -23,9 +23,7 @@
 InterpolatedTransformPropertyValue::InterpolatedTransformPropertyValue(
     TransformPropertyValue* start_value, TransformPropertyValue* end_value,
     float progress)
-    : start_value_(start_value),
-      end_value_(end_value),
-      progress_(progress) {
+    : start_value_(start_value), end_value_(end_value), progress_(progress) {
   DCHECK(start_value);
   DCHECK(end_value);
 }
@@ -44,8 +42,7 @@
     const scoped_refptr<ui_navigation::NavItem>& used_ui_nav_focus) const {
   return math::InterpolateMatrices(
       start_value_->ToMatrix(used_size, used_ui_nav_focus),
-      end_value_->ToMatrix(used_size, used_ui_nav_focus),
-      progress_);
+      end_value_->ToMatrix(used_size, used_ui_nav_focus), progress_);
 }
 
 }  // namespace cssom
diff --git a/cobalt/cssom/interpolated_transform_property_value.h b/cobalt/cssom/interpolated_transform_property_value.h
index ad271dd..cdff3fb 100644
--- a/cobalt/cssom/interpolated_transform_property_value.h
+++ b/cobalt/cssom/interpolated_transform_property_value.h
@@ -38,8 +38,8 @@
   }
 
   math::Matrix3F ToMatrix(const math::SizeF& used_size,
-      const scoped_refptr<ui_navigation::NavItem>& used_ui_nav_focus)
-      const override;
+                          const scoped_refptr<ui_navigation::NavItem>&
+                              used_ui_nav_focus) const override;
 
   bool operator==(const InterpolatedTransformPropertyValue& other) const {
     return progress_ == other.progress_ &&
diff --git a/cobalt/cssom/linear_gradient_value.h b/cobalt/cssom/linear_gradient_value.h
index bb50727..44a0e44 100644
--- a/cobalt/cssom/linear_gradient_value.h
+++ b/cobalt/cssom/linear_gradient_value.h
@@ -16,6 +16,7 @@
 #define COBALT_CSSOM_LINEAR_GRADIENT_VALUE_H_
 
 #include <string>
+#include <utility>
 #include <vector>
 
 #include "base/basictypes.h"
diff --git a/cobalt/cssom/list_value.h b/cobalt/cssom/list_value.h
index 8658928..f4be9f3 100644
--- a/cobalt/cssom/list_value.h
+++ b/cobalt/cssom/list_value.h
@@ -16,6 +16,7 @@
 #define COBALT_CSSOM_LIST_VALUE_H_
 
 #include <memory>
+#include <utility>
 #include <vector>
 
 #include "base/basictypes.h"
diff --git a/cobalt/cssom/map_to_mesh_function.h b/cobalt/cssom/map_to_mesh_function.h
index 3a888e7..09e495f 100644
--- a/cobalt/cssom/map_to_mesh_function.h
+++ b/cobalt/cssom/map_to_mesh_function.h
@@ -17,6 +17,8 @@
 
 #include <memory>
 #include <string>
+#include <utility>
+#include <vector>
 
 #include "base/basictypes.h"
 #include "base/compiler_specific.h"
diff --git a/cobalt/cssom/media_query.cc b/cobalt/cssom/media_query.cc
index 252f5ce..6b4cdbc 100644
--- a/cobalt/cssom/media_query.cc
+++ b/cobalt/cssom/media_query.cc
@@ -12,10 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/cssom/media_query.h"
 
+#include <memory>
+
 #include "base/memory/ref_counted.h"
 #include "cobalt/cssom/media_feature.h"
 #include "cobalt/cssom/viewport_size.h"
diff --git a/cobalt/cssom/media_query_test.cc b/cobalt/cssom/media_query_test.cc
index 6aba6b8..90938a8 100644
--- a/cobalt/cssom/media_query_test.cc
+++ b/cobalt/cssom/media_query_test.cc
@@ -12,10 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/cssom/media_query.h"
 
+#include <memory>
+#include <utility>
+
 #include "base/memory/ref_counted.h"
 #include "cobalt/cssom/length_value.h"
 #include "cobalt/cssom/media_feature.h"
diff --git a/cobalt/cssom/not_pseudo_class.cc b/cobalt/cssom/not_pseudo_class.cc
index a206a21..eb6d85d 100644
--- a/cobalt/cssom/not_pseudo_class.cc
+++ b/cobalt/cssom/not_pseudo_class.cc
@@ -12,10 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/cssom/not_pseudo_class.h"
 
+#include <memory>
+#include <utility>
+
 #include "cobalt/cssom/compound_selector.h"
 #include "cobalt/cssom/selector_visitor.h"
 
diff --git a/cobalt/cssom/not_pseudo_class.h b/cobalt/cssom/not_pseudo_class.h
index f028015..abb4da6 100644
--- a/cobalt/cssom/not_pseudo_class.h
+++ b/cobalt/cssom/not_pseudo_class.h
@@ -35,8 +35,7 @@
 //   https://www.w3.org/TR/selectors4/#negation-pseudo
 class NotPseudoClass : public PseudoClass {
  public:
-  NotPseudoClass()
-      : PseudoClass(base::Tokens::not_pseudo_class_selector()) {}
+  NotPseudoClass() : PseudoClass(base::Tokens::not_pseudo_class_selector()) {}
   ~NotPseudoClass() override {}
 
   // From Selector.
diff --git a/cobalt/cssom/property_definitions.cc b/cobalt/cssom/property_definitions.cc
index 6a4db89..382d936 100644
--- a/cobalt/cssom/property_definitions.cc
+++ b/cobalt/cssom/property_definitions.cc
@@ -16,6 +16,7 @@
 
 #include <algorithm>
 #include <memory>
+#include <utility>
 #include <vector>
 
 #include "base/bind.h"
diff --git a/cobalt/cssom/property_key_list_value.h b/cobalt/cssom/property_key_list_value.h
index 5dd0774..e275c2e 100644
--- a/cobalt/cssom/property_key_list_value.h
+++ b/cobalt/cssom/property_key_list_value.h
@@ -17,6 +17,7 @@
 
 #include <memory>
 #include <string>
+#include <utility>
 
 #include "base/basictypes.h"
 #include "base/compiler_specific.h"
diff --git a/cobalt/cssom/property_list_value.h b/cobalt/cssom/property_list_value.h
index d938d37..9056de2 100644
--- a/cobalt/cssom/property_list_value.h
+++ b/cobalt/cssom/property_list_value.h
@@ -17,6 +17,7 @@
 
 #include <memory>
 #include <string>
+#include <utility>
 
 #include "base/compiler_specific.h"
 #include "cobalt/base/polymorphic_equatable.h"
diff --git a/cobalt/cssom/property_value_to_string_test.cc b/cobalt/cssom/property_value_to_string_test.cc
index 609e2b2..9a1bc8d 100644
--- a/cobalt/cssom/property_value_to_string_test.cc
+++ b/cobalt/cssom/property_value_to_string_test.cc
@@ -14,8 +14,6 @@
 
 #include <memory>
 
-#include "cobalt/cssom/property_value.h"
-
 #include "base/memory/ptr_util.h"
 #include "base/time/time.h"
 #include "cobalt/cssom/absolute_url_value.h"
@@ -36,6 +34,7 @@
 #include "cobalt/cssom/property_definitions.h"
 #include "cobalt/cssom/property_key_list_value.h"
 #include "cobalt/cssom/property_list_value.h"
+#include "cobalt/cssom/property_value.h"
 #include "cobalt/cssom/radial_gradient_value.h"
 #include "cobalt/cssom/ratio_value.h"
 #include "cobalt/cssom/resolution_value.h"
diff --git a/cobalt/cssom/property_value_visitor.cc b/cobalt/cssom/property_value_visitor.cc
index 1156137..b94a999 100644
--- a/cobalt/cssom/property_value_visitor.cc
+++ b/cobalt/cssom/property_value_visitor.cc
@@ -70,8 +70,7 @@
   VisitDefault(font_weight_value);
 }
 
-void DefaultingPropertyValueVisitor::VisitInteger(
-    IntegerValue* integer_value) {
+void DefaultingPropertyValueVisitor::VisitInteger(IntegerValue* integer_value) {
   VisitDefault(integer_value);
 }
 
diff --git a/cobalt/cssom/property_value_visitor_test.cc b/cobalt/cssom/property_value_visitor_test.cc
index 11762be..27854ac 100644
--- a/cobalt/cssom/property_value_visitor_test.cc
+++ b/cobalt/cssom/property_value_visitor_test.cc
@@ -15,6 +15,7 @@
 #include "cobalt/cssom/property_value_visitor.h"
 
 #include <memory>
+#include <utility>
 #include <vector>
 
 #include "cobalt/cssom/absolute_url_value.h"
@@ -261,7 +262,7 @@
 
 TEST(PropertyValueVisitorTest, VisitsShadowValue) {
   scoped_refptr<ShadowValue> shadow_value =
-      new ShadowValue(std::vector<scoped_refptr<LengthValue> >(),
+      new ShadowValue(std::vector<scoped_refptr<LengthValue>>(),
                       new RGBAColorValue(0x0047abff), false);
   MockPropertyValueVisitor mock_visitor;
   EXPECT_CALL(mock_visitor, VisitShadow(shadow_value.get()));
@@ -322,8 +323,8 @@
   scoped_refptr<InterpolatedTransformPropertyValue> interpolated_value(
       new InterpolatedTransformPropertyValue(start_value, end_value, 0.5f));
   MockPropertyValueVisitor mock_visitor;
-  EXPECT_CALL(mock_visitor, VisitTransformPropertyValue(
-      interpolated_value.get()));
+  EXPECT_CALL(mock_visitor,
+              VisitTransformPropertyValue(interpolated_value.get()));
   interpolated_value->Accept(&mock_visitor);
 }
 
diff --git a/cobalt/cssom/radial_gradient_value.h b/cobalt/cssom/radial_gradient_value.h
index bcef848..87aa71a 100644
--- a/cobalt/cssom/radial_gradient_value.h
+++ b/cobalt/cssom/radial_gradient_value.h
@@ -16,6 +16,7 @@
 #define COBALT_CSSOM_RADIAL_GRADIENT_VALUE_H_
 
 #include <string>
+#include <utility>
 #include <vector>
 
 #include "base/basictypes.h"
@@ -80,9 +81,7 @@
 
   const scoped_refptr<PropertyListValue>& position() const { return position_; }
 
-  const ColorStopList& color_stop_list() const {
-    return color_stop_list_;
-  }
+  const ColorStopList& color_stop_list() const { return color_stop_list_; }
 
   std::string ToString() const override;
 
diff --git a/cobalt/cssom/resolution_value.cc b/cobalt/cssom/resolution_value.cc
index 9381048..a578f1a 100644
--- a/cobalt/cssom/resolution_value.cc
+++ b/cobalt/cssom/resolution_value.cc
@@ -35,9 +35,10 @@
 }
 
 std::string ResolutionValue::ToString() const {
-  return base::StringPrintf(
-      "%.7g%s", value_,
-      unit_ == kDPIUnit ? "dpi" : unit_ == kDPCMUnit ? "dpcm" : "");
+  return base::StringPrintf("%.7g%s", value_,
+                            unit_ == kDPIUnit    ? "dpi"
+                            : unit_ == kDPCMUnit ? "dpcm"
+                                                 : "");
 }
 
 }  // namespace cssom
diff --git a/cobalt/cssom/rotate_function.h b/cobalt/cssom/rotate_function.h
index ccfc11b..2b19e0f 100644
--- a/cobalt/cssom/rotate_function.h
+++ b/cobalt/cssom/rotate_function.h
@@ -47,8 +47,8 @@
   }
 
   math::Matrix3F ToMatrix(const math::SizeF& used_size,
-      const scoped_refptr<ui_navigation::NavItem>& used_ui_nav_focus)
-      const override;
+                          const scoped_refptr<ui_navigation::NavItem>&
+                              used_ui_nav_focus) const override;
 
   bool operator==(const RotateFunction& other) const {
     return clockwise_angle_in_radians_ == other.clockwise_angle_in_radians_;
diff --git a/cobalt/cssom/scale_function.h b/cobalt/cssom/scale_function.h
index 252a078..33a0333 100644
--- a/cobalt/cssom/scale_function.h
+++ b/cobalt/cssom/scale_function.h
@@ -50,8 +50,8 @@
   }
 
   math::Matrix3F ToMatrix(const math::SizeF& used_size,
-      const scoped_refptr<ui_navigation::NavItem>& used_ui_nav_focus)
-      const override;
+                          const scoped_refptr<ui_navigation::NavItem>&
+                              used_ui_nav_focus) const override;
 
   bool operator==(const ScaleFunction& other) const {
     return x_factor_ == other.x_factor_ && y_factor_ == other.y_factor_;
diff --git a/cobalt/cssom/scoped_list_value.h b/cobalt/cssom/scoped_list_value.h
index 0577930..0ec7fe3 100644
--- a/cobalt/cssom/scoped_list_value.h
+++ b/cobalt/cssom/scoped_list_value.h
@@ -16,6 +16,8 @@
 #define COBALT_CSSOM_SCOPED_LIST_VALUE_H_
 
 #include <memory>
+#include <utility>
+#include <vector>
 
 #include "base/basictypes.h"
 #include "base/compiler_specific.h"
diff --git a/cobalt/cssom/scoped_ref_list_value.h b/cobalt/cssom/scoped_ref_list_value.h
index fc7f8fb..0cd6ccf 100644
--- a/cobalt/cssom/scoped_ref_list_value.h
+++ b/cobalt/cssom/scoped_ref_list_value.h
@@ -16,6 +16,7 @@
 #define COBALT_CSSOM_SCOPED_REF_LIST_VALUE_H_
 
 #include <memory>
+#include <utility>
 #include <vector>
 
 #include "base/basictypes.h"
diff --git a/cobalt/cssom/selector.h b/cobalt/cssom/selector.h
index 7a12aa8..83a5405 100644
--- a/cobalt/cssom/selector.h
+++ b/cobalt/cssom/selector.h
@@ -16,6 +16,7 @@
 #define COBALT_CSSOM_SELECTOR_H_
 
 #include <memory>
+#include <vector>
 
 #include "cobalt/cssom/specificity.h"
 
diff --git a/cobalt/cssom/selector_test.cc b/cobalt/cssom/selector_test.cc
index 43381b7..e856823 100644
--- a/cobalt/cssom/selector_test.cc
+++ b/cobalt/cssom/selector_test.cc
@@ -12,10 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/cssom/selector.h"
 
+#include <memory>
+#include <utility>
+
 #include "cobalt/cssom/child_combinator.h"
 #include "cobalt/cssom/class_selector.h"
 #include "cobalt/cssom/complex_selector.h"
@@ -123,8 +124,7 @@
     complex_selector->AppendSelector(
         std::unique_ptr<CompoundSelector>(new CompoundSelector()));
 
-    for (int i = 0; i < ComplexSelector::kCombinatorLimit;
-         i++) {
+    for (int i = 0; i < ComplexSelector::kCombinatorLimit; i++) {
       std::unique_ptr<CompoundSelector> compound_selector(
           new CompoundSelector());
       std::unique_ptr<ChildCombinator> child_combinator(new ChildCombinator());
@@ -142,9 +142,7 @@
     complex_selector->AppendSelector(
         std::unique_ptr<CompoundSelector>(new CompoundSelector()));
 
-    for (int i = 0;
-         i < 2 * ComplexSelector::kCombinatorLimit + 1;
-         i++) {
+    for (int i = 0; i < 2 * ComplexSelector::kCombinatorLimit + 1; i++) {
       std::unique_ptr<CompoundSelector> compound_selector(
           new CompoundSelector());
       std::unique_ptr<ChildCombinator> child_combinator(new ChildCombinator());
diff --git a/cobalt/cssom/selector_tree.cc b/cobalt/cssom/selector_tree.cc
index 6dc91db..bd41332 100644
--- a/cobalt/cssom/selector_tree.cc
+++ b/cobalt/cssom/selector_tree.cc
@@ -16,9 +16,7 @@
 
 #include <set>
 
-#if defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
 #include "cobalt/base/version_compatibility.h"
-#endif  // defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
 #include "cobalt/cssom/complex_selector.h"
 #include "cobalt/cssom/compound_selector.h"
 #include "cobalt/cssom/css_style_rule.h"
@@ -76,7 +74,6 @@
   return owned_nodes_map_[std::make_pair(node, combinator)];
 }
 
-#if defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
 namespace {
 
 // This uses the old CompoundSelector compare logic that had a bug where 'not'
@@ -178,7 +175,6 @@
 bool SelectorTree::ValidateVersionCompatibility() const {
   return !HasNotPseudoClassCompatibilityViolations(owned_nodes_map_);
 }
-#endif  // defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
 
 SelectorTree::Node* SelectorTree::GetOrCreateNodeForComplexSelector(
     ComplexSelector* complex_selector) {
diff --git a/cobalt/cssom/selector_tree.h b/cobalt/cssom/selector_tree.h
index b02a176..a42d2ae 100644
--- a/cobalt/cssom/selector_tree.h
+++ b/cobalt/cssom/selector_tree.h
@@ -202,11 +202,9 @@
   // Used by unit tests only.
   const OwnedNodes& children(const Node* node, CombinatorType combinator);
 
-#if defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
   // Validates the selector tree's compatibility against pre-selected versions
   // of Cobalt. Returns true if there are no version compatibility violations.
   bool ValidateVersionCompatibility() const;
-#endif  // defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
 
  private:
   // Gets or creates node for complex selector, starting from root.
diff --git a/cobalt/cssom/selector_tree_test.cc b/cobalt/cssom/selector_tree_test.cc
index 38f7cac..42d9493 100644
--- a/cobalt/cssom/selector_tree_test.cc
+++ b/cobalt/cssom/selector_tree_test.cc
@@ -12,10 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <memory>
-
 #include "cobalt/cssom/selector_tree.h"
 
+#include <memory>
+
 #include "cobalt/base/version_compatibility.h"
 #include "cobalt/css_parser/parser.h"
 #include "cobalt/cssom/css_style_rule.h"
diff --git a/cobalt/cssom/serializer.cc b/cobalt/cssom/serializer.cc
index d7cf50f..c7f8ad2 100644
--- a/cobalt/cssom/serializer.cc
+++ b/cobalt/cssom/serializer.cc
@@ -13,6 +13,7 @@
 // limitations under the License.
 
 #include "cobalt/cssom/serializer.h"
+
 #include "cobalt/cssom/active_pseudo_class.h"
 #include "cobalt/cssom/after_pseudo_element.h"
 #include "cobalt/cssom/attribute_selector.h"
diff --git a/cobalt/cssom/serializer_test.cc b/cobalt/cssom/serializer_test.cc
index 3429edc..eb1a192 100644
--- a/cobalt/cssom/serializer_test.cc
+++ b/cobalt/cssom/serializer_test.cc
@@ -14,6 +14,9 @@
 
 #include "cobalt/cssom/serializer.h"
 
+#include <memory>
+#include <vector>
+
 #include "cobalt/base/token.h"
 #include "cobalt/css_parser/parser.h"
 #include "cobalt/cssom/css_style_rule.h"
diff --git a/cobalt/cssom/time_list_value.cc b/cobalt/cssom/time_list_value.cc
index 1dce453..edb7c7f 100644
--- a/cobalt/cssom/time_list_value.cc
+++ b/cobalt/cssom/time_list_value.cc
@@ -12,10 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include "cobalt/cssom/time_list_value.h"
+
 #include <inttypes.h>
 
 #include "base/strings/stringprintf.h"
-#include "cobalt/cssom/time_list_value.h"
 
 namespace cobalt {
 namespace cssom {
diff --git a/cobalt/cssom/time_list_value.h b/cobalt/cssom/time_list_value.h
index ba3eef0..4b8d8b1 100644
--- a/cobalt/cssom/time_list_value.h
+++ b/cobalt/cssom/time_list_value.h
@@ -17,6 +17,7 @@
 
 #include <memory>
 #include <string>
+#include <utility>
 
 #include "base/basictypes.h"
 #include "base/compiler_specific.h"
diff --git a/cobalt/cssom/timing_function_list_value.h b/cobalt/cssom/timing_function_list_value.h
index f1e97e3..e597f94 100644
--- a/cobalt/cssom/timing_function_list_value.h
+++ b/cobalt/cssom/timing_function_list_value.h
@@ -17,6 +17,7 @@
 
 #include <memory>
 #include <string>
+#include <utility>
 
 #include "base/compiler_specific.h"
 #include "cobalt/base/polymorphic_equatable.h"
diff --git a/cobalt/cssom/timing_function_test.cc b/cobalt/cssom/timing_function_test.cc
index c8f6872..d3aaf67 100644
--- a/cobalt/cssom/timing_function_test.cc
+++ b/cobalt/cssom/timing_function_test.cc
@@ -13,6 +13,7 @@
 // limitations under the License.
 
 #include "cobalt/cssom/timing_function.h"
+
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace cobalt {
diff --git a/cobalt/cssom/transform_function.h b/cobalt/cssom/transform_function.h
index 9e586c8..120d07d 100644
--- a/cobalt/cssom/transform_function.h
+++ b/cobalt/cssom/transform_function.h
@@ -51,7 +51,8 @@
 
   virtual std::string ToString() const = 0;
 
-  virtual math::Matrix3F ToMatrix(const math::SizeF& used_size,
+  virtual math::Matrix3F ToMatrix(
+      const math::SizeF& used_size,
       const scoped_refptr<ui_navigation::NavItem>& used_ui_nav_focus) const = 0;
 
   virtual ~TransformFunction() {}
diff --git a/cobalt/cssom/transform_function_list_value.cc b/cobalt/cssom/transform_function_list_value.cc
index 95f0d71..35e7a12 100644
--- a/cobalt/cssom/transform_function_list_value.cc
+++ b/cobalt/cssom/transform_function_list_value.cc
@@ -14,15 +14,15 @@
 
 #include "cobalt/cssom/transform_function_list_value.h"
 
+#include <utility>
+
 namespace cobalt {
 namespace cssom {
 
-TransformFunctionListValue::Builder::Builder()
-    : traits_(0) {}
+TransformFunctionListValue::Builder::Builder() : traits_(0) {}
 
 TransformFunctionListValue::Builder::Builder(Builder&& other)
-    : functions_(std::move(other.functions_)),
-      traits_(other.traits_) {}
+    : functions_(std::move(other.functions_)), traits_(other.traits_) {}
 
 void TransformFunctionListValue::Builder::emplace_back(
     TransformFunction* function) {
diff --git a/cobalt/cssom/transform_function_list_value.h b/cobalt/cssom/transform_function_list_value.h
index eccc723..9c39a01 100644
--- a/cobalt/cssom/transform_function_list_value.h
+++ b/cobalt/cssom/transform_function_list_value.h
@@ -17,6 +17,7 @@
 
 #include <memory>
 #include <string>
+#include <utility>
 #include <vector>
 
 #include "base/compiler_specific.h"
@@ -72,8 +73,8 @@
   }
 
   math::Matrix3F ToMatrix(const math::SizeF& used_size,
-      const scoped_refptr<ui_navigation::NavItem>& used_ui_nav_focus)
-      const override;
+                          const scoped_refptr<ui_navigation::NavItem>&
+                              used_ui_nav_focus) const override;
 
   bool operator==(const TransformFunctionListValue& other) const;
 
diff --git a/cobalt/cssom/transform_property_value.h b/cobalt/cssom/transform_property_value.h
index f707aaf..ceaa3be 100644
--- a/cobalt/cssom/transform_property_value.h
+++ b/cobalt/cssom/transform_property_value.h
@@ -37,7 +37,8 @@
   // Returns whether the transform has any functions with the specified trait.
   virtual bool HasTrait(TransformFunction::Trait trait) const = 0;
 
-  virtual math::Matrix3F ToMatrix(const math::SizeF& used_size,
+  virtual math::Matrix3F ToMatrix(
+      const math::SizeF& used_size,
       const scoped_refptr<ui_navigation::NavItem>& used_ui_nav_focus) const = 0;
 };
 
diff --git a/cobalt/cssom/translate_function.cc b/cobalt/cssom/translate_function.cc
index dae29cd..a018a9a 100644
--- a/cobalt/cssom/translate_function.cc
+++ b/cobalt/cssom/translate_function.cc
@@ -25,7 +25,7 @@
 namespace cssom {
 
 TranslateFunction::TranslateFunction(Axis axis,
-    const scoped_refptr<PropertyValue>& offset)
+                                     const scoped_refptr<PropertyValue>& offset)
     : axis_(axis), offset_(offset) {
   DCHECK(offset);
   if (offset_type() == kLength && offset_as_length()->IsUnitRelative()) {
@@ -124,16 +124,16 @@
     const scoped_refptr<ui_navigation::NavItem>& used_ui_nav_focus) const {
   switch (axis_) {
     case kXAxis:
-      return math::TranslateMatrix(length_component_in_pixels() +
-                                   percentage_component() * used_size.width(),
-                                   0.0f);
+      return math::TranslateMatrix(
+          length_component_in_pixels() +
+              percentage_component() * used_size.width(),
+          0.0f);
     case kYAxis:
-      return math::TranslateMatrix(0.0f,
-                                   length_component_in_pixels() +
-                                   percentage_component() * used_size.height());
+      return math::TranslateMatrix(
+          0.0f, length_component_in_pixels() +
+                    percentage_component() * used_size.height());
     case kZAxis:
-      if (length_component_in_pixels() != 0 ||
-          percentage_component() != 0) {
+      if (length_component_in_pixels() != 0 || percentage_component() != 0) {
         LOG(ERROR) << "translateZ is currently a noop in Cobalt.";
       }
       break;
diff --git a/cobalt/cssom/translate_function.h b/cobalt/cssom/translate_function.h
index 3a84ab1..70033f4 100644
--- a/cobalt/cssom/translate_function.h
+++ b/cobalt/cssom/translate_function.h
@@ -70,8 +70,8 @@
   std::string ToString() const override;
 
   math::Matrix3F ToMatrix(const math::SizeF& used_size,
-      const scoped_refptr<ui_navigation::NavItem>& used_ui_nav_focus)
-      const override;
+                          const scoped_refptr<ui_navigation::NavItem>&
+                              used_ui_nav_focus) const override;
 
   bool operator==(const TranslateFunction& other) const {
     return offset_->Equals(*other.offset_) && axis_ == other.axis_;
diff --git a/cobalt/debug/BUILD.gn b/cobalt/debug/BUILD.gn
index 2c48c85..0bdf9b5 100644
--- a/cobalt/debug/BUILD.gn
+++ b/cobalt/debug/BUILD.gn
@@ -92,6 +92,9 @@
       "console/command_manager.cc",
       "console/command_manager.h",
     ]
-    deps = [ "//cobalt/base" ]
+    deps = [
+      "//cobalt/base",
+      "//starboard:starboard_headers_only",
+    ]
   }
 }
diff --git a/cobalt/debug/backend/command_map.h b/cobalt/debug/backend/command_map.h
index 919fc36..40467eb 100644
--- a/cobalt/debug/backend/command_map.h
+++ b/cobalt/debug/backend/command_map.h
@@ -17,6 +17,7 @@
 
 #include <map>
 #include <string>
+#include <utility>
 
 #include "base/bind.h"
 #include "base/optional.h"
diff --git a/cobalt/debug/backend/log_agent.cc b/cobalt/debug/backend/log_agent.cc
index 9fc974a..593fb0a 100644
--- a/cobalt/debug/backend/log_agent.cc
+++ b/cobalt/debug/backend/log_agent.cc
@@ -14,13 +14,22 @@
 
 #include "cobalt/debug/backend/log_agent.h"
 
+#include "base/bind.h"
 #include "base/logging.h"
+#include "cobalt/debug/console/command_manager.h"
 
 namespace cobalt {
 namespace debug {
 namespace backend {
 
 namespace {
+const char kDebugLogCommand[] = "debug_log";
+const char kDebugLogCommandShortHelp[] =
+    "Turns browser debug logging on or off.";
+const char kDebugLogCommandLongHelp[] =
+    "When turned on, browser logs are sent in such a way that they are visible "
+    "in devtools.";
+
 // Error levels:
 constexpr char kInfoLevel[] = "info";
 constexpr char kWarningLevel[] = "warning";
@@ -42,7 +51,21 @@
 }
 }  // namespace
 
-LogAgent::LogAgent(DebugDispatcher* dispatcher) : AgentBase("Log", dispatcher) {
+void LogAgent::OnDebugLog(const std::string& message) {
+  SetDebugLog(console::ConsoleCommandManager::CommandHandler::IsOnEnableOrTrue(
+      message));
+}
+void LogAgent::SetDebugLog(bool enable) {
+  event_method_ = domain_ + (enable ? ".entryAdded" : ".browserEntryAdded");
+}
+
+LogAgent::LogAgent(DebugDispatcher* dispatcher)
+    : AgentBase("Log", dispatcher),
+      debug_log_command_handler_(
+          kDebugLogCommand,
+          base::Bind(&LogAgent::OnDebugLog, base::Unretained(this)),
+          kDebugLogCommandShortHelp, kDebugLogCommandLongHelp) {
+  SetDebugLog(false);
   // Get log output while still making it available elsewhere.
   log_message_handler_callback_id_ =
       base::LogMessageHandler::GetInstance()->AddCallback(
@@ -63,9 +86,10 @@
     // except it only shows up in the debug console and not in remote devtools.
     // TODO: Flesh out the rest of LogEntry properties (source, timestamp)
     JSONObject params(new base::DictionaryValue());
+    params->SetString("entry.source", "other");
     params->SetString("entry.text", str);
     params->SetString("entry.level", GetLogLevelFromSeverity(severity));
-    dispatcher_->SendEvent(domain_ + ".browserEntryAdded", params);
+    dispatcher_->SendEvent(event_method_, params);
   }
 
   // Don't suppress the log message.
diff --git a/cobalt/debug/backend/log_agent.h b/cobalt/debug/backend/log_agent.h
index 97e6fe0..5a6fb50 100644
--- a/cobalt/debug/backend/log_agent.h
+++ b/cobalt/debug/backend/log_agent.h
@@ -19,6 +19,7 @@
 #include "cobalt/base/log_message_handler.h"
 #include "cobalt/debug/backend/agent_base.h"
 #include "cobalt/debug/backend/debug_dispatcher.h"
+#include "cobalt/debug/console/command_manager.h"
 
 namespace cobalt {
 namespace debug {
@@ -33,6 +34,9 @@
   explicit LogAgent(DebugDispatcher* dispatcher);
   ~LogAgent();
 
+  void OnDebugLog(const std::string& message);
+  void SetDebugLog(bool enable);
+
  private:
   // Called by LogMessageHandler for each log message.
   // May be called from any thread.
@@ -46,6 +50,11 @@
 
   // The callback id of our recipient of log messages so we can unregister it.
   base::LogMessageHandler::CallbackId log_message_handler_callback_id_;
+
+  std::string event_method_;
+
+  debug::console::ConsoleCommandManager::CommandHandler
+      debug_log_command_handler_;
 };
 
 }  // namespace backend
diff --git a/cobalt/debug/backend/overlay_agent.cc b/cobalt/debug/backend/overlay_agent.cc
index a1686cd..05ceeca 100644
--- a/cobalt/debug/backend/overlay_agent.cc
+++ b/cobalt/debug/backend/overlay_agent.cc
@@ -14,6 +14,9 @@
 
 #include "cobalt/debug/backend/overlay_agent.h"
 
+#include <memory>
+#include <utility>
+
 #include "cobalt/math/clamp.h"
 #include "cobalt/math/rect_f.h"
 #include "cobalt/render_tree/brush.h"
diff --git a/cobalt/debug/backend/overlay_agent.h b/cobalt/debug/backend/overlay_agent.h
index b9186de..cbef52e 100644
--- a/cobalt/debug/backend/overlay_agent.h
+++ b/cobalt/debug/backend/overlay_agent.h
@@ -14,6 +14,8 @@
 #ifndef COBALT_DEBUG_BACKEND_OVERLAY_AGENT_H_
 #define COBALT_DEBUG_BACKEND_OVERLAY_AGENT_H_
 
+#include <memory>
+
 #include "cobalt/debug/backend/agent_base.h"
 #include "cobalt/debug/backend/debug_dispatcher.h"
 #include "cobalt/debug/backend/render_layer.h"
diff --git a/cobalt/debug/backend/page_agent.cc b/cobalt/debug/backend/page_agent.cc
index 8c96420..fdd1d2a 100644
--- a/cobalt/debug/backend/page_agent.cc
+++ b/cobalt/debug/backend/page_agent.cc
@@ -15,6 +15,7 @@
 #include "cobalt/debug/backend/page_agent.h"
 
 #include <string>
+#include <utility>
 
 #include "base/bind.h"
 #include "base/values.h"
diff --git a/cobalt/debug/backend/script_debugger_agent.cc b/cobalt/debug/backend/script_debugger_agent.cc
index d9f024a..a1b3f86 100644
--- a/cobalt/debug/backend/script_debugger_agent.cc
+++ b/cobalt/debug/backend/script_debugger_agent.cc
@@ -15,6 +15,7 @@
 #include "cobalt/debug/backend/script_debugger_agent.h"
 
 #include <string>
+#include <utility>
 
 #include "base/strings/stringprintf.h"
 #include "cobalt/debug/json_object.h"
diff --git a/cobalt/debug/backend/tracing_agent.cc b/cobalt/debug/backend/tracing_agent.cc
index 1e10129..3c26d29 100644
--- a/cobalt/debug/backend/tracing_agent.cc
+++ b/cobalt/debug/backend/tracing_agent.cc
@@ -14,6 +14,8 @@
 
 #include "cobalt/debug/backend/tracing_agent.h"
 
+#include <utility>
+
 #include "base/bind.h"
 #include "base/values.h"
 #include "cobalt/script/script_debugger.h"
diff --git a/cobalt/debug/backend/tracing_agent.h b/cobalt/debug/backend/tracing_agent.h
index a9c0bda..f2101fb 100644
--- a/cobalt/debug/backend/tracing_agent.h
+++ b/cobalt/debug/backend/tracing_agent.h
@@ -33,7 +33,7 @@
 // TracingAgent doesn't use AgentBase.
 //
 // https://chromedevtools.github.io/devtools-protocol/tot/Tracing
-class TracingAgent : public script::ScriptDebugger::TraceDelegate  {
+class TracingAgent : public script::ScriptDebugger::TraceDelegate {
  public:
   explicit TracingAgent(DebugDispatcher* dispatcher,
                         script::ScriptDebugger* script_debugger);
diff --git a/cobalt/debug/console/command_manager.cc b/cobalt/debug/console/command_manager.cc
index a25879a..3c30ae3 100644
--- a/cobalt/debug/console/command_manager.cc
+++ b/cobalt/debug/console/command_manager.cc
@@ -15,6 +15,7 @@
 #include "cobalt/debug/console/command_manager.h"
 
 #include "base/logging.h"
+#include "starboard/string.h"
 
 namespace cobalt {
 namespace debug {
@@ -45,6 +46,16 @@
   manager->UnregisterCommandHandler(this);
 }
 
+// Returns true if the message is 'on', 'enable', or 'true'.
+// static
+bool ConsoleCommandManager::CommandHandler::IsOnEnableOrTrue(
+    const std::string& message) {
+  return (SbStringCompareNoCase("on", message.c_str()) == 0) ||
+         (SbStringCompareNoCase("enable", message.c_str()) == 0) ||
+         (SbStringCompareNoCase("true", message.c_str()) == 0);
+}
+
+
 void ConsoleCommandManager::HandleCommand(const std::string& command,
                                           const std::string& message) const {
   DCHECK_GT(command.length(), size_t(0));
diff --git a/cobalt/debug/console/command_manager.h b/cobalt/debug/console/command_manager.h
index 66a5601..1ace46c 100644
--- a/cobalt/debug/console/command_manager.h
+++ b/cobalt/debug/console/command_manager.h
@@ -61,6 +61,9 @@
     const std::string& short_help() const { return short_help_; }
     const std::string& long_help() const { return long_help_; }
 
+    // Returns true if the message is 'on', 'enable', or 'true'.
+    static bool IsOnEnableOrTrue(const std::string& message);
+
    private:
     std::string command_;
     CommandCallback callback_;
diff --git a/cobalt/debug/console/content/debugger_client.js b/cobalt/debug/console/content/debugger_client.js
index 2ceb3e0..daaa47b 100644
--- a/cobalt/debug/console/content/debugger_client.js
+++ b/cobalt/debug/console/content/debugger_client.js
@@ -16,6 +16,7 @@
   this.DEBUGGER_DETACHED = 0;
   this.DEBUGGER_ATTACHING = 1;
   this.DEBUGGER_ATTACHED = 2;
+  this.DEBUGGER_DISABLED = 3;
   this.scripts = [];
   this.attachState = this.DEBUGGER_DETACHED;
   this.onAttachCallback = this.onAttach.bind(this);
@@ -25,11 +26,11 @@
 
 // Attaches to the debugger and listens for debug events.
 // Enables the domains we care about here.
-DebuggerClient.prototype.attach = function() {
+DebuggerClient.prototype.attach = function () {
   if (this.attachState == this.DEBUGGER_DETACHED) {
     this.attachState = this.DEBUGGER_ATTACHING;
     printToMessageLog(MessageLog.INTERACTIVE,
-                      'Attempting to attach to debugger...');
+      'Attempting to attach to debugger...');
     this.scripts = [];
     debugHub.onEvent.addListener(this.onEventCallback);
     debugHub.attach(this.onAttachCallback);
@@ -38,14 +39,14 @@
     this.sendCommand('Runtime.enable');
   } else if (this.attachState == this.DEBUGGER_ATTACHING) {
     printToMessageLog(MessageLog.INTERACTIVE,
-                      'Still attempting to attach to debugger...');
+      'Still attempting to attach to debugger...');
   }
 }
 
-// Local method to list the parsed scripts the client has been notifed of
+// Local method to list the parsed scripts the client has been notified of
 // via the |Debugger.scriptParsed| event. Maps the possibly very long script id
 // from the debug dispatcher to a more human-readable 0-based index.
-DebuggerClient.prototype.getScripts = function(scriptId) {
+DebuggerClient.prototype.getScripts = function (scriptId) {
   for (var i in this.scripts) {
     var index = this.pad(i, 3);
     var scriptUrl = this.scripts[i].url;
@@ -57,7 +58,7 @@
 
 // Each debugger command has an associated callback to get the result.
 
-DebuggerClient.prototype.getScriptSource = function(scriptId) {
+DebuggerClient.prototype.getScriptSource = function (scriptId) {
   // If the id looks like an index into the local script array, look it up there.
   if (scriptId >= 0 && scriptId < this.scripts.length) {
     scriptId = this.scripts[scriptId].scriptId;
@@ -69,7 +70,7 @@
   this.sendCommand(method, params, callback);
 }
 
-DebuggerClient.prototype.getScriptSourceCallback = function(result) {
+DebuggerClient.prototype.getScriptSourceCallback = function (result) {
   var scriptSource = result.scriptSource;
   var lines = scriptSource.split('\n');
   for (var i = 0; i < lines.length; i++) {
@@ -78,7 +79,7 @@
   }
 }
 
-DebuggerClient.prototype.evaluate = function(expression, callback) {
+DebuggerClient.prototype.evaluate = function (expression, callback) {
   var method = 'Runtime.evaluate';
   var params = {};
   params.contextId = this.executionContext;
@@ -92,8 +93,8 @@
 
 // All debugger commands are routed through this method. Converts the command
 // parameters into a JSON string to pass to the debug dispatcher.
-DebuggerClient.prototype.sendCommand = function(method, commandParams,
-                                                callback) {
+DebuggerClient.prototype.sendCommand = function (method, commandParams,
+  callback) {
   var jsonParams = JSON.stringify(commandParams);
   var responseCallback = this.responseCallback.bind(this, method, callback);
   debugHub.sendCommand(method, jsonParams, responseCallback);
@@ -102,15 +103,15 @@
 // All command responses are routed through this method. Parses the JSON
 // response from the debug dispatcher, checks for errors and passes on to the
 // command-specific callback to handle the result.
-DebuggerClient.prototype.responseCallback = function(method, callback,
-                                                     responseString) {
+DebuggerClient.prototype.responseCallback = function (method, callback,
+  responseString) {
   var response = JSON.parse(responseString);
 
   if (response && response.error) {
     printToMessageLog(
-        MessageLog.ERROR,
-        '[ERROR(' + response.error.code + '):' + method + '] ' +
-            response.error.message);
+      MessageLog.ERROR,
+      '[ERROR(' + response.error.code + '):' + method + '] ' +
+      response.error.message);
   } else if (callback) {
     if (response) {
       callback(response.result);
@@ -122,10 +123,10 @@
 
 //-- Events.
 
-DebuggerClient.prototype.onAttach = function() {
+DebuggerClient.prototype.onAttach = function () {
   if (debugHub.lastError) {
     printToMessageLog(MessageLog.WARNING, 'Could not attach to debugger.');
-    this.attachState = this.DEBUGGER_DETACHED;
+    this.attachState = this.DEBUGGER_DISABLED;
   } else {
     printToMessageLog(MessageLog.INTERACTIVE, 'Debugger attached.');
     this.attachState = this.DEBUGGER_ATTACHED;
@@ -135,7 +136,7 @@
 // All events generated by the debug dispatcher are routed through this method.
 // Parses the JSON string and passes on to the appropriate handler according to
 // the method name.
-DebuggerClient.prototype.onEvent = function(method, paramString) {
+DebuggerClient.prototype.onEvent = function (method, paramString) {
   var params = JSON.parse(paramString);
   if (method == 'Console.messageAdded') {
     this.onConsoleMessageAdded(params)
@@ -152,32 +153,32 @@
   }
 }
 
-DebuggerClient.prototype.onDetached = function() {
+DebuggerClient.prototype.onDetached = function () {
   printToMessageLog(MessageLog.INTERACTIVE, 'Debugger detached.');
   this.attachState = this.DEBUGGER_DETACHED;
 }
 
-DebuggerClient.prototype.onExecutionContextCreated = function(params) {
+DebuggerClient.prototype.onExecutionContextCreated = function (params) {
   this.executionContext = params.context.id;
   printToMessageLog(MessageLog.INFO,
-                    'Execution context created: ' + this.executionContext);
+    'Execution context created: ' + this.executionContext);
 }
 
-DebuggerClient.prototype.onLogEntryAdded = function(params) {
+DebuggerClient.prototype.onLogEntryAdded = function (params) {
   printToMessageLog(params.entry.level, params.entry.text);
 }
 
 
-DebuggerClient.prototype.onConsoleMessageAdded = function(params) {
+DebuggerClient.prototype.onConsoleMessageAdded = function (params) {
   // Translate Console.messageAdded params to Runtime.consoleAPICalled params.
   var consoleApiParams = {
     type: params.message.level,
-    args: [ { type: 'string', value: params.message.text } ]
+    args: [{ type: 'string', value: params.message.text }]
   };
   this.onConsoleApiCalled(consoleApiParams);
 }
 
-DebuggerClient.prototype.onConsoleApiCalled = function(params) {
+DebuggerClient.prototype.onConsoleApiCalled = function (params) {
   var severity = params.type;
   if (severity === "assert") {
     severity = MessageLog.ERROR;
@@ -200,13 +201,13 @@
   printToMessageLog(MessageLog.CONSOLE + severity, message);
 }
 
-DebuggerClient.prototype.onScriptParsed = function(params) {
+DebuggerClient.prototype.onScriptParsed = function (params) {
   this.scripts.push(params);
 }
 
 //--- Utils.
 
-DebuggerClient.prototype.pad = function(number, minLength) {
+DebuggerClient.prototype.pad = function (number, minLength) {
   var result = number.toString();
   while (result.length < minLength) {
     result = ' ' + result;
diff --git a/cobalt/debug/console/content/message_log.js b/cobalt/debug/console/content/message_log.js
index c22b510..dfa989f 100644
--- a/cobalt/debug/console/content/message_log.js
+++ b/cobalt/debug/console/content/message_log.js
@@ -224,4 +224,3 @@
   this.displayPos = 0;
   this.displayMessages();
 }
-
diff --git a/cobalt/demos/content/animated-webp-performance-demo/10_turtle.webp b/cobalt/demos/content/animated-webp-performance-demo/10_turtle.webp
new file mode 100644
index 0000000..800df18
--- /dev/null
+++ b/cobalt/demos/content/animated-webp-performance-demo/10_turtle.webp
Binary files differ
diff --git a/cobalt/demos/content/animated-webp-performance-demo/1_fan.webp b/cobalt/demos/content/animated-webp-performance-demo/1_fan.webp
new file mode 100644
index 0000000..f982fd8
--- /dev/null
+++ b/cobalt/demos/content/animated-webp-performance-demo/1_fan.webp
Binary files differ
diff --git a/cobalt/demos/content/animated-webp-performance-demo/2_heart.webp b/cobalt/demos/content/animated-webp-performance-demo/2_heart.webp
new file mode 100644
index 0000000..79cdd39
--- /dev/null
+++ b/cobalt/demos/content/animated-webp-performance-demo/2_heart.webp
Binary files differ
diff --git a/cobalt/demos/content/animated-webp-performance-demo/3_cry.webp b/cobalt/demos/content/animated-webp-performance-demo/3_cry.webp
new file mode 100644
index 0000000..c045e21
--- /dev/null
+++ b/cobalt/demos/content/animated-webp-performance-demo/3_cry.webp
Binary files differ
diff --git a/cobalt/demos/content/animated-webp-performance-demo/4_clap.webp b/cobalt/demos/content/animated-webp-performance-demo/4_clap.webp
new file mode 100644
index 0000000..194a34c
--- /dev/null
+++ b/cobalt/demos/content/animated-webp-performance-demo/4_clap.webp
Binary files differ
diff --git a/cobalt/demos/content/animated-webp-performance-demo/5_egg.webp b/cobalt/demos/content/animated-webp-performance-demo/5_egg.webp
new file mode 100644
index 0000000..995a4cb
--- /dev/null
+++ b/cobalt/demos/content/animated-webp-performance-demo/5_egg.webp
Binary files differ
diff --git a/cobalt/demos/content/animated-webp-performance-demo/6_party.webp b/cobalt/demos/content/animated-webp-performance-demo/6_party.webp
new file mode 100644
index 0000000..d5dfb16
--- /dev/null
+++ b/cobalt/demos/content/animated-webp-performance-demo/6_party.webp
Binary files differ
diff --git a/cobalt/demos/content/animated-webp-performance-demo/7_rofl.webp b/cobalt/demos/content/animated-webp-performance-demo/7_rofl.webp
new file mode 100644
index 0000000..4c6c375
--- /dev/null
+++ b/cobalt/demos/content/animated-webp-performance-demo/7_rofl.webp
Binary files differ
diff --git a/cobalt/demos/content/animated-webp-performance-demo/8_melt.webp b/cobalt/demos/content/animated-webp-performance-demo/8_melt.webp
new file mode 100644
index 0000000..3feba61
--- /dev/null
+++ b/cobalt/demos/content/animated-webp-performance-demo/8_melt.webp
Binary files differ
diff --git a/cobalt/demos/content/animated-webp-performance-demo/9_explode.webp b/cobalt/demos/content/animated-webp-performance-demo/9_explode.webp
new file mode 100644
index 0000000..3c548ce
--- /dev/null
+++ b/cobalt/demos/content/animated-webp-performance-demo/9_explode.webp
Binary files differ
diff --git a/cobalt/demos/content/animated-webp-performance-demo/index.html b/cobalt/demos/content/animated-webp-performance-demo/index.html
new file mode 100644
index 0000000..5613cc8
--- /dev/null
+++ b/cobalt/demos/content/animated-webp-performance-demo/index.html
@@ -0,0 +1,166 @@
+<!DOCTYPE html>
+<!--
+ | Demo to help test animated webp performance metrics.
+ | We set up decoding speed tracking on a regular interval, and make a
+ | customizeable page with varying number of decoded images.
+ -->
+<html>
+
+<head>
+  <title>WebP performance test</title>
+  <style type="text/css">
+
+    body {
+      background-color: white;
+    }
+    .image {
+      width: 100px;
+      height: 100px;
+      background-size: contain;
+      display: inline-block;
+    }
+    .highlight {
+      background-color: rgb(0, 255, 0);
+    }
+  </style>
+  <script type="text/javascript">
+    window.onload = () => {
+      var size = 100; // Default pixel size of rendered images
+      var search = window.location.search;
+      var num = 1; // Default number of decoded images
+
+      // Grab URL search args
+      var matches = search.matchAll(/num=([0-9]+)/gm);
+      for (const match of matches) {
+        num = match[1]
+      }
+      var matches = search.matchAll(/size=([0-9]+)/gm);
+      for (const match of matches) {
+        size = match[1]
+      }
+
+      // Insert images into DOM tree
+      var layer = document.getElementById('layer');
+      function addImage(img, size) {
+        var el = document.createElement('span');
+        console.log(`adding ${img}`);
+        el.classList.add('image');
+        el.style['backgroundImage'] = `url(${img}.webp)`;
+        el.style['width'] = `${size}px`;
+        el.style['height'] = `${size}px`;
+        layer.appendChild(el)
+        console.log("Added image");
+      }
+      var images = [
+        "1_fan","2_heart","3_cry","4_clap", "5_egg",
+        "6_party","7_rofl","8_melt","9_explode","10_turtle"
+      ]
+      for(i = 0; i< num; i++)  {
+        (function(i) {
+          var img = images[i % 10];
+          window.setTimeout( () => {  addImage(img,size) } , 1 + i*40);
+        })(i)
+      }
+
+      // Set up function retrieve CVals.
+      var getCVal = function(name) { return 0 }
+      if (typeof h5vcc != "undefined" && typeof h5vcc.cVal != "undefined") {
+        getCVal = function(name) {
+          return h5vcc.cVal.getValue(name);
+        }
+      }
+
+      // Set up periodic stats tracking loop.
+      var last_frames = 0;
+      var last_time = performance.now();
+      function updateStats() {
+        var current_time = performance.now();
+        var time_delta_milliseconds = current_time - last_time;
+        var decoded_frames =
+          getCVal('Count.MainWebModule.AnimatedImage.DecodedFrames');
+        var underruns = getCVal('Count.MainWebModule.AnimatedImage.DecodingUnderruns');
+        var overruns = getCVal('Count.MainWebModule.AnimatedImage.DecodingOverruns');
+        var newly_decoded_frames = decoded_frames - last_frames;