Remove Syzygy-related code from the Sawbuck repository.

Syzygy has now been moved to its own repository.

R=siggi@chromium.org

Review URL: https://codereview.appspot.com/133460044

git-svn-id: http://sawbuck.googlecode.com/svn/trunk@2290 15e8cca8-e42c-11de-a347-f34a4f72eb7d
diff --git a/DEPS b/DEPS
deleted file mode 100644
index 387becc..0000000
--- a/DEPS
+++ /dev/null
@@ -1,138 +0,0 @@
-# Copyright 2012 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Sawbuck builds on Chrome base, uses GYP, GTest, all of which requires
-# this build configuration.
-
-vars = {
-  "chrome_revision": "202420",
-  "gmock_revision": "453",
-  "gtest_revision": "664",
-  "googleurl_revision": "183",
-  "gyp_revision": "1719",
-
-  "chrome_base": "http://src.chromium.org/svn/trunk",
-}
-
-deps = {
-  "src/base":
-    Var("chrome_base") + "/src/base@" + Var("chrome_revision"),
-
-  "src/google_apis":
-    Var("chrome_base") + "/src/google_apis@" + Var("chrome_revision"),
-
-  "src/googleurl":
-    "http://google-url.googlecode.com/svn/trunk@" + Var("googleurl_revision"),
-
-  "src/third_party/wtl":
-    Var("chrome_base") + "/src/third_party/wtl@" +
-        Var("chrome_revision"),
-  "src/third_party/zlib":
-    Var("chrome_base") + "/src/third_party/zlib@" +
-        Var("chrome_revision"),
-  "src/third_party/libevent":
-    Var("chrome_base") + "/src/third_party/libevent@" +
-        Var("chrome_revision"),
-  "src/third_party/libjpeg":
-    Var("chrome_base") + "/src/third_party/libjpeg@" +
-        Var("chrome_revision"),
-  "src/third_party/icu":
-    Var("chrome_base") + "/deps/third_party/icu46@" +
-        Var("chrome_revision"),
-  "src/third_party/sqlite":
-    Var("chrome_base") + "/src/third_party/sqlite@" +
-        Var("chrome_revision"),
-  "src/third_party/modp_b64":
-    Var("chrome_base") + "/src/third_party/modp_b64@" +
-        Var("chrome_revision"),
-  "src/third_party/jemalloc":
-    Var("chrome_base") + "/src/third_party/jemalloc@" +
-        Var("chrome_revision"),
-  "src/third_party/tcmalloc":
-    Var("chrome_base") + "/src/third_party/tcmalloc@" +
-        Var("chrome_revision"),
-
-  "src/third_party/distorm/files":
-    "http://distorm.googlecode.com/svn/trunk@229",
-
-  "src/third_party/dromaeo/files":
-    Var("chrome_base") + "/src/chrome/test/data/dromaeo@" +
-        Var("chrome_revision"),
-
-  "src/third_party/python_26":
-    Var("chrome_base") + "/tools/third_party/python_26@" +
-        Var("chrome_revision"),
-
-  "src/third_party/psyco_win32":
-    Var("chrome_base") + "/deps/third_party/psyco_win32@" +
-        Var("chrome_revision"),
-
-  "src/third_party/googleappengine":
-    "http://googleappengine.googlecode.com/svn/trunk/python@241",
-
-  "src/build":
-    Var("chrome_base") + "/src/build@" + Var("chrome_revision"),
-  "src/tools/win":
-    Var("chrome_base") + "/src/tools/win@" + Var("chrome_revision"),
-
-  "src/testing":
-    Var("chrome_base") + "/src/testing@" + Var("chrome_revision"),
-  "src/testing/gmock":
-    "http://googlemock.googlecode.com/svn/trunk@" + Var("gmock_revision"),
-  "src/testing/gtest":
-    "http://googletest.googlecode.com/svn/trunk@" + Var("gtest_revision"),
-
-  "src/tools/gyp":
-    "http://gyp.googlecode.com/svn/trunk@" + Var("gyp_revision"),
-
-  "src/tools/code_coverage":
-    Var("chrome_base") + "/src/tools/code_coverage@" + Var("chrome_revision"),
-
-  "src/tools/sharding_supervisor":
-    Var("chrome_base") + "/src/tools/sharding_supervisor@" +
-        Var("chrome_revision"),
-}
-
-
-include_rules = [
-  # Everybody can use some things.
-  "+base",
-  "+build",
-  "+googleurl",
-]
-
-hooks = [
-  {
-    # A change to a .gyp, .gypi, or to GYP itself should run the generator.
-    "pattern": ".",
-    "action": ["python",
-               "src/build/gyp_chromium",
-               "src/sawbuck/sawbuck.gyp"],
-  },
-  {
-    # A change to a .gyp, .gypi, or to GYP itself should run the generator.
-    "pattern": ".",
-    "action": ["python",
-               "src/build/gyp_chromium",
-               "src/sawdust/sawdust.gyp"],
-  },
-  {
-    # A change to a .gyp, .gypi, or to GYP itself should run the generator.
-    "pattern": ".",
-    "action": ["python",
-               "src/build/gyp_chromium",
-               "--include=src/syzygy/syzygy.gypi",
-               "src/syzygy/build/all.gyp"],
-  },
-]
diff --git a/DEPS.syzygy b/DEPS.syzygy
deleted file mode 100644
index 7978be2..0000000
--- a/DEPS.syzygy
+++ /dev/null
@@ -1,119 +0,0 @@
-# Copyright 2014 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Sawbuck builds on Chrome base, uses GYP, GTest, all of which requires
-# this build configuration.
-
-vars = {
-  "chrome_revision": "271365",
-  "gmock_revision": "453",
-  "gtest_revision": "664",
-  "gyp_revision": "1919",
-  "py_etw_revision": "559",
-
-  "chrome_base": "http://src.chromium.org/svn/trunk",
-
-  # Paths to installed utilities used in hooks. These need to use
-  # Windows style paths.
-  "python_path": "src\\third_party\\python_26\\python.exe",
-  "gyp_path": "src\\syzygy\\build\\gyp_main.py",
-}
-
-deps = {
-  # Chromium's base library.
-  "src/base":
-    Var("chrome_base") + "/src/base@" + Var("chrome_revision"),
-
-  # Dependencies required to to build base.
-  "src/third_party/icu":
-    Var("chrome_base") + "/deps/third_party/icu46@" +
-        Var("chrome_revision"),
-  "src/third_party/libxml":
-    Var("chrome_base") + "/src/third_party/libxml@" +
-        Var("chrome_revision"),
-  "src/third_party/modp_b64":
-    Var("chrome_base") + "/src/third_party/modp_b64@" +
-        Var("chrome_revision"),
-  "src/third_party/tcmalloc":
-    Var("chrome_base") + "/src/third_party/tcmalloc@" +
-        Var("chrome_revision"),
-  "src/third_party/zlib":
-    Var("chrome_base") + "/src/third_party/zlib@" +
-        Var("chrome_revision"),
-
-  # A general purpose X86 disassembler.
-  "src/third_party/distorm/files":
-    "http://distorm.googlecode.com/svn/trunk@229",
-
-  # Used for benchmarking.
-  "src/third_party/dromaeo/files":
-    Var("chrome_base") + "/src/chrome/test/data/dromaeo@" +
-        Var("chrome_revision"),
-
-  # Used by our various ETW processing scripts.
-  "src/third_party/sawbuck/py/etw":
-    "http://sawbuck.googlecode.com/svn/trunk/sawbuck/py/etw@" +
-        Var("py_etw_revision"),
-
-  # A pinned version of Python to use with our scripts.
-  # TODO(chrisha): Upgrade to Python 2.7.6, like the rest of Chromium.
-  "src/third_party/python_26":
-    Var("chrome_base") + "/tools/third_party/python_26@" +
-        Var("chrome_revision"),
-
-  # This brings in build configuration required to build base.
-  "src/build":
-    Var("chrome_base") + "/src/build@" + Var("chrome_revision"),
-
-  # This brings in unittesting code.
-  "src/testing":
-    Var("chrome_base") + "/src/testing@" + Var("chrome_revision"),
-  "src/testing/gmock":
-    "http://googlemock.googlecode.com/svn/trunk@" + Var("gmock_revision"),
-  "src/testing/gtest":
-    "http://googletest.googlecode.com/svn/trunk@" + Var("gtest_revision"),
-
-  # This brings in GYP.
-  "src/tools/gyp":
-    "http://gyp.googlecode.com/svn/trunk@" + Var("gyp_revision"),
-
-  # This brings in code coverage tools, like croc. This is required for our
-  # coverage generation.
-  "src/tools/code_coverage":
-    Var("chrome_base") + "/src/tools/code_coverage@" + Var("chrome_revision"),
-
-  # This brings in protobuf, used by SyzyASan metadata.
-  "src/third_party/protobuf/src":
-    "http://protobuf.googlecode.com/svn/trunk/src@573",
-}
-
-
-include_rules = [
-  # Everybody can use some things.
-  "+base",
-  "+build",
-]
-
-hooks = [
-  {
-    # A change to a .gyp, .gypi, or to GYP itself should run the generator.
-    "pattern": ".",
-    "action": [Var("python_path"),
-               Var("gyp_path"),
-               "--include=src/build/common.gypi",
-               "--include=src/syzygy/syzygy.gypi",
-               "--no-circular-check",
-               "src/syzygy/build/all.gyp"],
-  },
-]
diff --git a/syzygy/PRESUBMIT.py b/syzygy/PRESUBMIT.py
deleted file mode 100644
index 79aad9b..0000000
--- a/syzygy/PRESUBMIT.py
+++ /dev/null
@@ -1,280 +0,0 @@
-#!python
-# Copyright 2012 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Presubmit script for Syzygy.
-
-import itertools
-import os
-import re
-import sys
-
-
-# Determine the root of the source tree. We use getcwd() instead of __file__
-# because gcl loads this script as text and runs it using eval(). In this
-# context the variable __file__ is undefined. However, gcl assures us that
-# the current working directory will be the directory containing this file.
-SYZYGY_ROOT_DIR = os.path.abspath(os.getcwd())
-
-
-# Bring in some presubmit tools.
-sys.path.insert(0, os.path.join(SYZYGY_ROOT_DIR, 'py'))
-import test_utils.presubmit as presubmit  # pylint: disable=F0401
-
-
-# Bring in internal-only presubmit checks. These live in a parallel
-# repository that is overlaid with the public version of syzygy. The
-# internal presubmit check is expected to live in the 'internal'
-# subdirectory off the syzygy root.
-try:
-  internal_dir = os.path.join(SYZYGY_ROOT_DIR, 'internal')
-  if os.path.isdir(internal_dir):
-    sys.path.insert(0, internal_dir)
-  import internal_presubmit  # pylint: disable=F0401
-except ImportError:
-  internal_presubmit = None
-
-
-_UNITTEST_MESSAGE = """\
-Your %%s unittests must succeed before submitting! To clear this error,
-  run: %s""" % os.path.join(SYZYGY_ROOT_DIR, 'run_all_tests.bat')
-
-
-# License header and copyright line taken from:
-# http://go/ossreleasing#Apache_License
-_LICENSE_HEADER = """\
-(#!python\n\
-)?.*? Copyright 20[0-9][0-9] Google Inc\. All Rights Reserved\.\n\
-.*?\n\
-.*? Licensed under the Apache License, Version 2\.0 \(the "License"\);\n\
-.*? you may not use this file except in compliance with the License\.\n\
-.*? You may obtain a copy of the License at\n\
-.*?\n\
-.*?     http://www\.apache\.org/licenses/LICENSE-2\.0\n\
-.*?
-.*? Unless required by applicable law or agreed to in writing, software\n\
-.*? distributed under the License is distributed on an "AS IS" BASIS,\n\
-.*? WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.\n\
-.*? See the License for the specific language governing permissions and\n\
-.*? limitations under the License\.\n\
-"""
-
-
-# Regular expressions to recognize source and header files.
-# These are lifted from presubmit_support.py in depot_tools and are
-# formulated as a list of regex strings so that they can be passed to
-# input_api.FilterSourceFile() as the white_list parameter.
-_CC_SOURCES = (r'.+\.c$', r'.+\.cc$', r'.+\.cpp$', r'.+\.rc$')
-_CC_HEADERS = (r'.+\.h$', r'.+\.inl$', r'.+\.hxx$', r'.+\.hpp$')
-_CC_FILES = _CC_SOURCES + _CC_HEADERS
-_CC_SOURCES_RE = re.compile('|'.join('(?:%s)' % x for x in _CC_SOURCES))
-
-# Ignore the headers present in the binaries directory, as they're a copy of
-# another header, making the header guard invalid.
-_CC_FILES_BLACKLIST = [r'syzygy\\binaries\\.+\.h$']
-
-# Regular expressions used to extract headers and recognize empty lines.
-_INCLUDE_RE = re.compile(r'^\s*#\s*include\s+(?P<header>[<"][^<"]+[>"])'
-                         r'\s*(?://.*(?P<nolint>NOLINT).*)?$')
-_COMMENT_OR_BLANK_RE = re.compile(r'^\s*(?://.)?$')
-
-
-def _IsSourceHeaderPair(source_path, header):
-  # Returns true if source and header are a matched pair.
-  # Source is the path on disk to the source file and header is the include
-  # reference to the header (i.e., "blah/foo.h" or <blah/foo.h> including the
-  # outer quotes or brackets.
-  if not _CC_SOURCES_RE.match(source_path):
-    return False
-
-  source_root = os.path.splitext(source_path)[0]
-  if source_root.endswith('_unittest'):
-    source_root = source_root[0:-9]
-  include = os.path.normpath(source_root + '.h')
-  header = os.path.normpath(header[1:-1])
-
-  return include.endswith(header)
-
-
-def _GetHeaderCompareKey(source_path, header):
-  if _IsSourceHeaderPair(source_path, header):
-    # We put the header that corresponds to this source file first.
-    group = 0
-  elif header.startswith('<'):
-    # C++ system headers should come after C system headers.
-    group = 1 if header.endswith('.h>') else 2
-  else:
-    group = 3
-  dirname, basename = os.path.split(header[1:-1])
-  return (group, dirname, basename)
-
-
-def _GetHeaderCompareKeyFunc(source):
-  return lambda header : _GetHeaderCompareKey(source, header)
-
-
-def _HeaderGroups(source_lines):
-  # Generates lists of headers in source, one per block of headers.
-  # Each generated value is a tuple (line, headers) denoting on which
-  # line of the source file an uninterrupted sequences of includes begins,
-  # and the list of included headers (paths including the quotes or angle
-  # brackets).
-  start_line, headers = None, []
-  for line, num in itertools.izip(source_lines, itertools.count(1)):
-    match = _INCLUDE_RE.match(line)
-    if match:
-      # The win32 api has all sorts of implicit include order dependencies.
-      # Rather than encode exceptions for these, we require that they be
-      # excluded from the ordering by a // NOLINT comment.
-      if not match.group('nolint'):
-        headers.append(match.group('header'))
-      if start_line is None:
-        # We just started a new run of headers.
-        start_line = num
-    elif headers and not _COMMENT_OR_BLANK_RE.match(line):
-      # Any non-empty or non-comment line interrupts a sequence of includes.
-      assert start_line is not None
-      yield (start_line, headers)
-      start_line = None
-      headers = []
-
-  # Just in case we have some headers we haven't yielded yet, this is our
-  # last chance to do so.
-  if headers:
-    assert start_line is not None
-    yield (start_line, headers)
-
-
-def CheckIncludeOrder(input_api, output_api):
-  """Checks that the C/C++ include order is correct."""
-  errors = []
-  is_cc_file = lambda x: input_api.FilterSourceFile(x, white_list=_CC_FILES)
-  for f in input_api.AffectedFiles(include_deletes=False,
-                                   file_filter=is_cc_file):
-    for line_num, group in _HeaderGroups(f.NewContents()):
-      sorted_group = sorted(group, key=_GetHeaderCompareKeyFunc(f.LocalPath()))
-      if group != sorted_group:
-        message = '%s, line %s: Out of order includes. ' \
-                  'Expected:\n\t#include %s' % (
-                      f.LocalPath(),
-                      line_num,
-                      '\n\t#include '.join(sorted_group))
-        errors.append(output_api.PresubmitPromptWarning(message))
-  return errors
-
-
-def CheckUnittestsRan(input_api, output_api, committing, configuration):
-  """Checks that the unittests success file is newer than any modified file"""
-  return presubmit.CheckTestSuccess(input_api, output_api, committing,
-                                    configuration, 'ALL',
-                                    message=_UNITTEST_MESSAGE % configuration)
-
-
-def CheckEnforcedChanges(input_api, output_api, committing, enforced):
-  """Enforces changes based on the provided rules.
-
-  |enforced| is a list of 2-tuples, where each entry is a list of file
-  names relative to the repository root. If all of the files in
-  the first list have been changed, then all of the files in the second
-  list must also be changed.
-  """
-
-  errors = []
-
-  changed = {}
-  for f in input_api.AffectedFiles(include_deletes=False):
-    changed[f.LocalPath()] = True
-
-  for (a, b) in enforced:
-    all_changed = all(changed.get(f, False) for f in a)
-    if not all_changed:
-      continue
-
-    for f in b:
-      if f not in changed:
-        errors.append(output_api.PresubmitPromptWarning(
-            '%s needs to be updated.' % f))
-
-  return errors
-
-
-def CheckReleaseNotes(input_api, output_api, committing):
-  version = os.path.join('syzygy', 'VERSION')
-  release_notes = os.path.join('syzygy', 'build', 'RELEASE-NOTES.TXT')
-  return CheckEnforcedChanges(input_api, output_api, committing,
-                              [[[version], [release_notes]]])
-
-
-def CheckReadMe(input_api, output_api, committing):
-  binaries = os.path.join('syzygy', 'build', 'binaries.gypi')
-  readme = os.path.join('syzygy', 'build', 'README.TXT.template')
-  return CheckEnforcedChanges(input_api, output_api, committing,
-                              [[[binaries], [readme]]])
-
-
-def CheckChange(input_api, output_api, committing):
-  # The list of (canned) checks we perform on all files in all changes.
-  checks = [
-    CheckIncludeOrder,
-    input_api.canned_checks.CheckChangeHasDescription,
-    input_api.canned_checks.CheckChangeHasNoCrAndHasOnlyOneEol,
-    input_api.canned_checks.CheckChangeHasNoTabs,
-    input_api.canned_checks.CheckChangeHasNoStrayWhitespace,
-    input_api.canned_checks.CheckChangeSvnEolStyle,
-    input_api.canned_checks.CheckDoNotSubmit,
-  ]
-
-  results = []
-  for check in checks:
-    results += check(input_api, output_api)
-
-  results += input_api.canned_checks.CheckLongLines(input_api, output_api, 80)
-
-  # We run lint only on C/C++ files so that we avoid getting notices about
-  # files being ignored.
-  is_cc_file = lambda x: input_api.FilterSourceFile(x, white_list=_CC_FILES,
-      black_list=_CC_FILES_BLACKLIST)
-  results += input_api.canned_checks.CheckChangeLintsClean(
-      input_api, output_api, source_file_filter=is_cc_file)
-
-  # We check the license on the default recognized source file types, as well
-  # as GYP and Python files.
-  gyp_file_re = r'.+\.gypi?$'
-  py_file_re = r'.+\.py$'
-  white_list = input_api.DEFAULT_WHITE_LIST + (gyp_file_re, py_file_re)
-  sources = lambda x: input_api.FilterSourceFile(x, white_list=white_list)
-  results += input_api.canned_checks.CheckLicense(input_api,
-                                                  output_api,
-                                                  _LICENSE_HEADER,
-                                                  source_file_filter=sources)
-
-  results += CheckReleaseNotes(input_api, output_api, committing)
-  results += CheckReadMe(input_api, output_api, committing)
-  results += CheckUnittestsRan(input_api, output_api, committing, "Debug")
-  results += CheckUnittestsRan(input_api, output_api, committing, "Release")
-
-  if internal_presubmit:
-    results += internal_presubmit.CheckChange(input_api,
-                                              output_api,
-                                              committing)
-
-  return results
-
-
-def CheckChangeOnUpload(input_api, output_api):
-  return CheckChange(input_api, output_api, False)
-
-
-def CheckChangeOnCommit(input_api, output_api):
-  return CheckChange(input_api, output_api, True)
diff --git a/syzygy/VERSION b/syzygy/VERSION
deleted file mode 100644
index 7a90c0b..0000000
--- a/syzygy/VERSION
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2012 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# One of BUILD and/or MINOR and/or MAJOR needs to be bumped after
-# publishing a build.
-
-MAJOR=0
-MINOR=7
-BUILD=18
-PATCH=1
diff --git a/syzygy/agent/agent.gypi b/syzygy/agent/agent.gypi
deleted file mode 100644
index 8faceec..0000000
--- a/syzygy/agent/agent.gypi
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright 2014 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Included by all agent module targets. Sets optimization and code generation
-# settings that are specific to agents.
-
-{
-  'msvs_settings': {
-    'VCCLCompilerTool': {
-      # Disable the use of MMX/SSE/SSE2/AVX instructions. This ensures that our
-      # instrumentation doesn't inadvertently stomp over these registers, which
-      # may be in use by the instrumented code.
-      #   0: Not set (equivalent to SSE2 as of VS2013)
-      #   1: SSE
-      #   2: SSE2
-      #   3: AVX
-      #   4: IA32 (no enhanced instruction sets)
-      'EnableEnhancedInstructionSet': '4',
-    },
-  },
-}
diff --git a/syzygy/agent/asan/allocators.h b/syzygy/agent/asan/allocators.h
deleted file mode 100644
index 1686ef7..0000000
--- a/syzygy/agent/asan/allocators.h
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Declares a handful of STL compatible allocators that interact with
-// SyzyASan subsystems. This is all with the goal of enhanced redzone
-// reporting.
-
-#ifndef SYZYGY_AGENT_ASAN_ALLOCATORS_H_
-#define SYZYGY_AGENT_ASAN_ALLOCATORS_H_
-
-#include <memory>
-
-#include "syzygy/agent/asan/heap.h"
-#include "syzygy/agent/asan/memory_notifier.h"
-
-namespace agent {
-namespace asan {
-
-// An STL-compatible allocator that notifies a MemoryNotifier object of
-// memory use.
-// @tparam T The type of object that is returned by the allocator.
-template <typename T>
-class MemoryNotifierAllocator : public std::allocator<T> {
- public:
-  typedef size_t size_type;
-  typedef T* pointer;
-  typedef const T* const_pointer;
-
-  // Functor that converts this allocator to an equivalent one for another
-  // type.
-  // @tparam T2 The type being casted to.
-  template <typename T2>
-  struct rebind {
-    typedef MemoryNotifierAllocator<T2> other;
-  };
-
-  // Constructor with a notifier object.
-  // @param memory_notifier A pointer to the memory notifier object
-  //     that this allocate will notify.
-  explicit MemoryNotifierAllocator(
-      MemoryNotifierInterface* memory_notifier);
-
-  // Copy constructor. Necessary for STL compatibility.
-  MemoryNotifierAllocator(const MemoryNotifierAllocator& other);
-
-  // Copy constructor from another type. Necessary for STL compatibility.
-  // This simply copies the memory notifier API.
-  // @tparam T2 The type of the other allocator.
-  // @param other The allocator being copied.
-  template <typename T2>
-  MemoryNotifierAllocator(const MemoryNotifierAllocator<T2>& other);
-
-  // Allocates @p count objects of type T.
-  // @param count The number of objects to allocate.
-  // @param hint A hint as to where the objects should be allocated.
-  // @returns a pointer to the allocated objects, NULL if the allocation
-  //     failed.
-  pointer allocate(size_type count, const void* hint = NULL);
-
-  // Deallocates a group of @p n objects.
-  // @param objects A pointer to the allocated objects. This must have
-  //     previously been returned a call to 'allocate'.
-  // @param count The number of objects in the allocation.
-  void deallocate(pointer objects, size_type count);
-
-  // @returns the MemoryNotifier object used by this allocator.
-  MemoryNotifierInterface* memory_notifier() const;
-
- protected:
-  MemoryNotifierInterface* memory_notifier_;
-};
-
-// An STL-compatible allocator that uses a HeapInterface object under the
-// hood.
-// @tparam T The type of object that is returned by the allocator.
-template <typename T>
-class HeapAllocator : public std::allocator<T> {
- public:
-  typedef size_t size_type;
-  typedef T* pointer;
-  typedef const T* const_pointer;
-
-  // Functor that converts this allocator to an equivalent one for another
-  // type.
-  // @tparam T2 The type being casted to.
-  template <typename T2>
-  struct rebind {
-    typedef HeapAllocator<T2> other;
-  };
-
-  // Constructor with a notifier object.
-  // @param heap A pointer to the heap object that will be used to make the
-  //     allocations.
-  explicit HeapAllocator(HeapInterface* heap);
-
-  // Copy constructor. Necessary for STL compatibility.
-  HeapAllocator(const HeapAllocator& other);
-
-  // Copy constructor from another type. Necessary for STL compatibility.
-  // This simply copies the memory notifier API.
-  // @tparam T2 The type of the other allocator.
-  // @param other The allocator being copied.
-  template <typename T2>
-  HeapAllocator(const HeapAllocator<T2>& other);
-
-  // Allocates @p count objects of type T.
-  // @param count The number of objects to allocate.
-  // @param hint A hint as to where the objects should be allocated.
-  // @returns a pointer to the allocated objects, NULL if the allocation
-  //     failed.
-  pointer allocate(size_type count, const void* hint = NULL);
-
-  // Deallocates a group of @p n objects.
-  // @param objects A pointer to the allocated objects. This must have
-  //     previously been returned a call to 'allocate'.
-  // @param count The number of objects in the allocation.
-  void deallocate(pointer objects, size_type count);
-
-  // @returns the Heap object used by this allocator.
-  HeapInterface* heap() const;
-
- protected:
-  HeapInterface* heap_;
-};
-
-}  // namespace asan
-}  // namespace agent
-
-#include "syzygy/agent/asan/allocators_impl.h"
-
-#endif  // SYZYGY_AGENT_ASAN_ALLOCATORS_H_
diff --git a/syzygy/agent/asan/allocators_impl.h b/syzygy/agent/asan/allocators_impl.h
deleted file mode 100644
index 3c4d1a3..0000000
--- a/syzygy/agent/asan/allocators_impl.h
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Internal implementation details for allocators.h. Not meant to be
-// included directly.
-
-#ifndef SYZYGY_AGENT_ASAN_ALLOCATORS_IMPL_H_
-#define SYZYGY_AGENT_ASAN_ALLOCATORS_IMPL_H_
-
-#include "base/logging.h"
-
-namespace agent {
-namespace asan {
-
-template <typename T>
-MemoryNotifierAllocator<T>::MemoryNotifierAllocator(
-    MemoryNotifierInterface* memory_notifier)
-    : memory_notifier_(memory_notifier) {
-  DCHECK_NE(static_cast<MemoryNotifierInterface*>(NULL), memory_notifier_);
-}
-
-template <typename T>
-MemoryNotifierAllocator<T>::MemoryNotifierAllocator(
-    const MemoryNotifierAllocator& other)
-    : memory_notifier_(other.memory_notifier_) {
-  DCHECK_NE(static_cast<MemoryNotifierInterface*>(NULL), memory_notifier_);
-}
-
-template <typename T>
-template <typename T2>
-MemoryNotifierAllocator<T>::MemoryNotifierAllocator(
-    const MemoryNotifierAllocator<T2>& other)
-    : memory_notifier_(other.memory_notifier()) {
-  DCHECK_NE(static_cast<MemoryNotifierInterface*>(NULL), memory_notifier_);
-}
-
-template <typename T>
-typename MemoryNotifierAllocator<T>::pointer
-MemoryNotifierAllocator<T>::allocate(
-    size_type count, const void* hint) {
-  DCHECK_NE(static_cast<MemoryNotifierInterface*>(NULL), memory_notifier_);
-
-  pointer objects = std::allocator<T>::allocate(count, hint);
-  if (count > 0)
-    memory_notifier_->NotifyInternalUse(objects, sizeof(T) * count);
-
-  return objects;
-}
-
-template <typename T>
-void MemoryNotifierAllocator<T>::deallocate(
-    pointer objects, size_type count) {
-  DCHECK_NE(static_cast<MemoryNotifierInterface*>(NULL), memory_notifier_);
-
-  if (count > 0)
-    memory_notifier_->NotifyReturnedToOS(objects, sizeof(T) * count);
-  std::allocator<T>::deallocate(objects, count);
-}
-
-template <typename T>
-MemoryNotifierInterface*
-MemoryNotifierAllocator<T>::memory_notifier() const {
-  DCHECK_NE(static_cast<MemoryNotifierInterface*>(NULL), memory_notifier_);
-
-  return memory_notifier_;
-}
-
-template <typename T>
-HeapAllocator<T>::HeapAllocator(
-    HeapInterface* heap)
-    : heap_(heap) {
-  DCHECK_NE(static_cast<HeapInterface*>(NULL), heap_);
-}
-
-template <typename T>
-HeapAllocator<T>::HeapAllocator(
-    const HeapAllocator& other)
-    : heap_(other.heap_) {
-  DCHECK_NE(static_cast<HeapInterface*>(NULL), heap_);
-}
-
-template <typename T>
-template <typename T2>
-HeapAllocator<T>::HeapAllocator(
-    const HeapAllocator<T2>& other)
-    : heap_(other.heap()) {
-  DCHECK_NE(static_cast<HeapInterface*>(NULL), heap_);
-}
-
-template <typename T>
-typename HeapAllocator<T>::pointer
-HeapAllocator<T>::allocate(
-    size_type count, const void* hint) {
-  DCHECK_NE(static_cast<HeapInterface*>(NULL), heap_);
-
-  pointer objects = reinterpret_cast<pointer>(
-      heap_->Allocate(count * sizeof(T)));
-
-  return objects;
-}
-
-template <typename T>
-void HeapAllocator<T>::deallocate(
-    pointer objects, size_type count) {
-  DCHECK_NE(static_cast<HeapInterface*>(NULL), heap_);
-
-  heap_->Free(objects);
-}
-
-template <typename T>
-HeapInterface*
-HeapAllocator<T>::heap() const {
-  DCHECK_NE(static_cast<HeapInterface*>(NULL), heap_);
-
-  return heap_;
-}
-
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_ALLOCATORS_IMPL_H_
diff --git a/syzygy/agent/asan/allocators_unittest.cc b/syzygy/agent/asan/allocators_unittest.cc
deleted file mode 100644
index e837ae1..0000000
--- a/syzygy/agent/asan/allocators_unittest.cc
+++ /dev/null
@@ -1,184 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/allocators.h"
-
-#include <set>
-#include <utility>
-
-#include "base/basictypes.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/unittest_util.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-class DummyMemoryNotifier : public MemoryNotifierInterface {
- public:
-  typedef std::pair<const void*, size_t> MemoryRange;
-  typedef std::set<MemoryRange> MemoryRangeSet;
-
-  DummyMemoryNotifier()
-      : internal_used_(0), future_used_(0) {
-  }
-
-  virtual ~DummyMemoryNotifier() { }
-
-  virtual void NotifyInternalUse(const void* address, size_t size) {
-    MemoryRange range(address, size);
-    ASSERT_TRUE(internal_.find(range) == internal_.end());
-    ASSERT_TRUE(future_.find(range) == future_.end());
-    internal_used_ += size;
-    internal_.insert(range);
-  }
-
-  virtual void NotifyFutureHeapUse(const void* address, size_t size) {
-    MemoryRange range(address, size);
-    ASSERT_TRUE(internal_.find(range) == internal_.end());
-    ASSERT_TRUE(future_.find(range) == future_.end());
-    future_used_ += size;
-    future_.insert(range);
-  }
-
-  virtual void NotifyReturnedToOS(const void* address, size_t size) {
-    MemoryRange range(address, size);
-    size_t count_internal = internal_.erase(range);
-    size_t count_future = future_.erase(range);
-    ASSERT_EQ(1u, count_internal + count_future);
-    if (count_internal) {
-      internal_used_ -= size;
-      ASSERT_LE(0u, internal_used_);
-    }
-    if (count_future) {
-      future_used_ -= size;
-      ASSERT_LE(0u, future_used_);
-    }
-  }
-
-  size_t internal_used_;
-  size_t future_used_;
-  MemoryRangeSet internal_;
-  MemoryRangeSet future_;
-};
-
-typedef DummyMemoryNotifier::MemoryRange MemoryRange;
-
-}  // namespace
-
-TEST(MemoryNotifierAllocatorTest, ConstructorsWorkAsExpected) {
-  DummyMemoryNotifier n;
-
-  MemoryNotifierAllocator<uint32> a1(&n);
-  EXPECT_EQ(&n, a1.memory_notifier());
-
-  MemoryNotifierAllocator<uint32> a2(a1);
-  EXPECT_EQ(&n, a2.memory_notifier());
-
-  MemoryNotifierAllocator<uint16> a3(a1);
-  EXPECT_EQ(&n, a3.memory_notifier());
-}
-
-TEST(MemoryNotifierAllocatorTest, NotifiesInternalUse) {
-  DummyMemoryNotifier n;
-  MemoryNotifierAllocator<uint32> a1(&n);
-  MemoryNotifierAllocator<uint16> a2(a1);
-
-  EXPECT_EQ(0u, n.internal_.size());
-  EXPECT_EQ(0u, n.future_.size());
-
-  uint32* ui32 = a1.allocate(10);
-  EXPECT_EQ(1u, n.internal_.size());
-  EXPECT_EQ(0u, n.future_.size());
-  EXPECT_THAT(n.internal_,
-              testing::UnorderedElementsAre(MemoryRange(ui32, 40)));
-
-  uint16* ui16 = a2.allocate(8);
-  EXPECT_EQ(2u, n.internal_.size());
-  EXPECT_EQ(0u, n.future_.size());
-  EXPECT_THAT(n.internal_,
-              testing::UnorderedElementsAre(MemoryRange(ui32, 40),
-                                            MemoryRange(ui16, 16)));
-
-  a1.deallocate(ui32, 10);
-  EXPECT_EQ(1u, n.internal_.size());
-  EXPECT_EQ(0u, n.future_.size());
-  EXPECT_THAT(n.internal_,
-              testing::UnorderedElementsAre(MemoryRange(ui16, 16)));
-
-  a2.deallocate(ui16, 8);
-  EXPECT_EQ(0u, n.internal_.size());
-  EXPECT_EQ(0u, n.future_.size());
-}
-
-TEST(MemoryNotifierAllocatorTest, StlContainerStressTest) {
-  DummyMemoryNotifier n;
-  typedef std::set<uint32,
-                   std::less<uint32>,
-                   MemoryNotifierAllocator<uint32>> DummySet;
-  MemoryNotifierAllocator<uint32> a(&n);
-  DummySet s(a);
-
-  for (size_t i = 0; i < 10000; ++i) {
-    uint32 j = ::rand() % 2000;
-    s.insert(j);
-  }
-
-  for (size_t i = 0; i < 1500; ++i) {
-    uint32 j = ::rand() % 2000;
-    s.erase(j);
-  }
-
-  s.clear();
-}
-
-TEST(HeapAllocatorTest, Allocate) {
-  testing::MockHeap h;
-  HeapAllocator<uint32> a(&h);
-  EXPECT_CALL(h, Allocate(sizeof(uint32)));
-  a.allocate(1, NULL);
-}
-
-TEST(HeapAllocatorTest, Deallocate) {
-  testing::MockHeap h;
-  HeapAllocator<uint32> a(&h);
-  EXPECT_CALL(h, Free(reinterpret_cast<void*>(0x12345678)));
-  a.deallocate(reinterpret_cast<uint32*>(0x12345678), 1);
-}
-
-TEST(HeapAllocatorTest, StlContainerStressTest) {
-  testing::DummyHeap h;
-  typedef std::set<uint32,
-                   std::less<uint32>,
-                   HeapAllocator<uint32>> DummySet;
-  HeapAllocator<uint32> a(&h);
-  DummySet s(a);
-
-  for (size_t i = 0; i < 10000; ++i) {
-    uint32 j = ::rand() % 2000;
-    s.insert(j);
-  }
-
-  for (size_t i = 0; i < 1500; ++i) {
-    uint32 j = ::rand() % 2000;
-    s.erase(j);
-  }
-
-  s.clear();
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/asan.gyp b/syzygy/agent/asan/asan.gyp
deleted file mode 100644
index 624c963..0000000
--- a/syzygy/agent/asan/asan.gyp
+++ /dev/null
@@ -1,255 +0,0 @@
-# Copyright 2012 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-{
-  'variables': {
-    'chromium_code': 1,
-    'system_interceptors_output_base_name': '<(SHARED_INTERMEDIATE_DIR)/'
-        'syzygy/agent/asan/asan_system_interceptors',
-  },
-  'targets': [
-    {
-      'target_name': 'syzyasan_rtl_lib',
-      'type': 'static_library',
-      'sources': [
-        'allocators.h',
-        'allocators_impl.h',
-        'asan_crt_interceptors.cc',
-        'asan_crt_interceptors.h',
-        'asan_heap_checker.cc',
-        'asan_heap_checker.h',
-        'asan_logger.cc',
-        'asan_logger.h',
-        'asan_rtl_impl.cc',
-        'asan_rtl_impl.h',
-        'asan_rtl_utils.cc',
-        'asan_rtl_utils.h',
-        'asan_runtime.cc',
-        'asan_runtime.h',
-        'asan_system_interceptors.cc',
-        'asan_system_interceptors.h',
-        'block.cc',
-        'block.h',
-        'block_impl.h',
-        'block_utils.cc',
-        'block_utils.h',
-        'circular_queue_impl.h',
-        'circular_queue.h',
-        'constants.cc',
-        'constants.h',
-        'error_info.cc',
-        'error_info.h',
-        'heap.h',
-        'heap_manager.h',
-        'memory_interceptors.cc',
-        'memory_interceptors.h',
-        'memory_notifier.h',
-        'page_allocator.h',
-        'page_allocator_impl.h',
-        'quarantine.h',
-        'shadow.cc',
-        'shadow.h',
-        'shadow_impl.h',
-        'shadow_marker.h',
-        'shadow_marker.cc',
-        'stack_capture.cc',
-        'stack_capture.h',
-        'stack_capture_cache.cc',
-        'stack_capture_cache.h',
-        'windows_heap_adapter.cc',
-        'windows_heap_adapter.h',
-        'heaps/ctmalloc_heap.cc',
-        'heaps/ctmalloc_heap.h',
-        'heaps/internal_heap.cc',
-        'heaps/internal_heap.h',
-        'heaps/large_block_heap.cc',
-        'heaps/large_block_heap.h',
-        'heaps/simple_block_heap.cc',
-        'heaps/simple_block_heap.h',
-        'heap_managers/block_heap_manager.cc',
-        'heap_managers/block_heap_manager.h',
-        'heaps/win_heap.cc',
-        'heaps/win_heap.h',
-        'heaps/zebra_block_heap.cc',
-        'heaps/zebra_block_heap.h',
-        'memory_notifiers/null_memory_notifier.h',
-        'memory_notifiers/shadow_memory_notifier.cc',
-        'memory_notifiers/shadow_memory_notifier.h',
-        'quarantines/sharded_quarantine.h',
-        'quarantines/sharded_quarantine_impl.h',
-        'quarantines/size_limited_quarantine.h',
-        'quarantines/size_limited_quarantine_impl.h',
-      ],
-      'dependencies': [
-        'system_interceptors_generator',
-        '<(src)/syzygy/trace/common/common.gyp:trace_common_lib',
-        '<(src)/syzygy/trace/rpc/rpc.gyp:logger_rpc_lib',
-        '<(src)/syzygy/trace/protocol/protocol.gyp:protocol_lib',
-        '<(src)/third_party/ctmalloc/ctmalloc.gyp:ctmalloc_lib',
-      ],
-    },
-    {
-      'target_name': 'syzyasan_rtl',
-      'type': 'loadable_module',
-      'includes': ['../agent.gypi'],
-      'sources': [
-        '<(system_interceptors_output_base_name).def.gen',
-        'syzyasan_rtl.cc',
-        'syzyasan_rtl.rc',
-      ],
-      'dependencies': [
-        'syzyasan_rtl_lib',
-        '<(src)/syzygy/agent/common/common.gyp:agent_common_lib',
-        '<(src)/syzygy/common/common.gyp:common_lib',
-        '<(src)/syzygy/common/common.gyp:syzygy_version',
-        '<(src)/syzygy/core/core.gyp:core_lib',
-      ],
-      'configurations': {
-        # Override the default imports list at source - apparently the
-        # configuration inheritance hierarchy is traversed and settings merged
-        # for each target. It's not sufficient here to e.g. override the
-        # desired settings in the final, assembled configuration such as
-        # 'Debug' or 'Release', as that will only alter their contribution to
-        # the project.
-        # Note that this is brittle to changes in build/common.gypi.
-        'Common_Base': {
-          'msvs_settings': {
-            'VCLinkerTool': {
-              'AdditionalDependencies=': [],
-              'ModuleDefinitionFile': [
-                '<(system_interceptors_output_base_name).def.gen'
-              ],
-            },
-          },
-        },
-      },
-      'msvs_settings': {
-        'VCLinkerTool': {
-          # Link against the XP-constrained user32 import libraries for
-          # kernel32 and user32 of the platform-SDK provided one to avoid
-          # inadvertently taking dependencies on post-XP user32 exports.
-          'IgnoreDefaultLibraryNames': [
-            'user32.lib',
-            'kernel32.lib',
-          ],
-          'AdditionalDependencies=': [
-            # Custom import libs.
-            'user32.winxp.lib',
-            'kernel32.winxp.lib',
-
-            # SDK import libs.
-            'dbghelp.lib',
-            'psapi.lib',
-            'rpcrt4.lib',
-          ],
-          'AdditionalLibraryDirectories': [
-            '<(src)/build/win/importlibs/x86',
-            '<(src)/syzygy/build/importlibs/x86',
-          ],
-          # This module should delay load nothing.
-          'DelayLoadDLLs=': [
-          ],
-          # Force MSVS to produce the same output name as Ninja.
-          'ImportLibrary': '$(OutDir)lib\$(TargetFileName).lib'
-        },
-      },
-    },
-    {
-      'target_name': 'system_interceptors_generator',
-      'type': 'none',
-      'msvs_cygwin_shell': 0,
-      'sources': [
-        'asan_system_interceptor_parser.py',
-      ],
-      'actions': [
-        {
-          'action_name': 'generate_syzyasan_system_interceptors',
-          'inputs': [
-            'syzyasan_rtl.def',
-            'asan_system_interceptors_function_list.txt',
-          ],
-          'outputs': [
-            '<(system_interceptors_output_base_name)_impl.gen',
-            '<(system_interceptors_output_base_name)_instrumentation_filter'
-                '.gen',
-            '<(system_interceptors_output_base_name).def.gen',
-          ],
-          'action': [
-            '<(python_exe)',
-            'asan_system_interceptor_parser.py',
-            '--output-base=<(system_interceptors_output_base_name)',
-            '--overwrite',
-            '--def-file=syzyasan_rtl.def',
-            'asan_system_interceptors_function_list.txt',
-          ],
-        },
-      ],
-    },
-    {
-      'target_name': 'syzyasan_rtl_unittests',
-      'type': 'executable',
-      'sources': [
-        'allocators_unittest.cc',
-        'asan_crt_interceptors_unittest.cc',
-        'asan_heap_checker_unittest.cc',
-        'asan_logger_unittest.cc',
-        'asan_runtime_unittest.cc',
-        'asan_rtl_impl_unittest.cc',
-        'asan_rtl_unittest.cc',
-        'asan_rtl_unittests_main.cc',
-        'asan_rtl_utils_unittest.cc',
-        'asan_system_interceptors_unittest.cc',
-        'block_unittest.cc',
-        'block_utils_unittest.cc',
-        'circular_queue_unittest.cc',
-        'error_info_unittest.cc',
-        'memory_interceptors_unittest.cc',
-        'page_allocator_unittest.cc',
-        'shadow_marker_unittest.cc',
-        'shadow_unittest.cc',
-        'stack_capture_unittest.cc',
-        'stack_capture_cache_unittest.cc',
-        'unittest_util.cc',
-        'unittest_util.h',
-        'windows_heap_adapter_unittest.cc',
-        'heaps/ctmalloc_heap_unittest.cc',
-        'heaps/internal_heap_unittest.cc',
-        'heaps/large_block_heap_unittest.cc',
-        'heaps/simple_block_heap_unittest.cc',
-        'heap_managers/block_heap_manager_unittest.cc',
-        'heaps/win_heap_unittest.cc',
-        'heaps/zebra_block_heap_unittest.cc',
-        'memory_notifiers/shadow_memory_notifier_unittest.cc',
-        'quarantines/sharded_quarantine_unittest.cc',
-        'quarantines/size_limited_quarantine_unittest.cc',
-      ],
-      'dependencies': [
-        'syzyasan_rtl_lib',
-        'syzyasan_rtl',
-        '<(src)/base/base.gyp:base',
-        '<(src)/syzygy/agent/common/common.gyp:agent_common_lib',
-        '<(src)/syzygy/core/core.gyp:core_unittest_utils',
-        '<(src)/syzygy/trace/agent_logger/agent_logger.gyp:agent_logger_lib',
-        '<(src)/testing/gmock.gyp:gmock',
-        '<(src)/testing/gtest.gyp:gtest',
-       ],
-      'msvs_settings': {
-        'VCLinkerTool': {
-          # Disable support for large address spaces.
-          'LargeAddressAware': 1,
-        },
-      },
-    },
-  ],
-}
diff --git a/syzygy/agent/asan/asan_crt_interceptors.cc b/syzygy/agent/asan/asan_crt_interceptors.cc
deleted file mode 100644
index 4aa4211..0000000
--- a/syzygy/agent/asan/asan_crt_interceptors.cc
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/asan_crt_interceptors.h"
-
-#include <algorithm>
-
-#include "base/logging.h"
-#include "syzygy/agent/asan/asan_rtl_utils.h"
-#include "syzygy/agent/asan/error_info.h"
-#include "syzygy/agent/asan/shadow.h"
-
-namespace {
-
-using agent::asan::Shadow;
-using agent::asan::TestMemoryRange;
-
-}  // namespace
-
-extern "C" {
-
-void* __cdecl asan_memcpy(unsigned char* destination,
-                          const unsigned char* source,
-                          size_t num) {
-  TestMemoryRange(source, num, agent::asan::ASAN_READ_ACCESS);
-  TestMemoryRange(destination, num, agent::asan::ASAN_WRITE_ACCESS);
-  return ::memcpy(destination, source, num);
-}
-
-void* __cdecl asan_memmove(unsigned char* destination,
-                           const unsigned char* source,
-                           size_t num) {
-  TestMemoryRange(source, num, agent::asan::ASAN_READ_ACCESS);
-  TestMemoryRange(destination, num, agent::asan::ASAN_WRITE_ACCESS);
-  return ::memmove(destination, source, num);
-}
-
-void* __cdecl asan_memset(unsigned char* ptr, int value, size_t num) {
-  TestMemoryRange(ptr, num, agent::asan::ASAN_WRITE_ACCESS);
-  return ::memset(ptr, value, num);
-}
-
-const void* __cdecl asan_memchr(const unsigned char* ptr,
-                                int value,
-                                size_t num) {
-  TestMemoryRange(ptr, num, agent::asan::ASAN_READ_ACCESS);
-  return ::memchr(ptr, value, num);
-}
-
-size_t __cdecl asan_strcspn(const char* str1, const char* str2) {
-  // TODO(sebmarchand): Provide an implementation that guarantees the same
-  //     behavior as the original function.
-  NOTIMPLEMENTED();
-  return 0;
-}
-
-size_t __cdecl asan_strlen(const char* str) {
-  size_t size = 0;
-  if (!agent::asan::Shadow::GetNullTerminatedArraySize<char>(str, 0U, &size)) {
-    ReportBadAccess(reinterpret_cast<const uint8*>(str) + size,
-                    agent::asan::ASAN_READ_ACCESS);
-    return ::strlen(str);
-  }
-  return size - 1;
-}
-
-const char* __cdecl asan_strrchr(const char* str, int character) {
-  size_t size = 0;
-  if (!agent::asan::Shadow::GetNullTerminatedArraySize<char>(str, 0U, &size)) {
-    ReportBadAccess(reinterpret_cast<const uint8*>(str) + size,
-                    agent::asan::ASAN_READ_ACCESS);
-  }
-  return ::strrchr(str, character);
-}
-
-const wchar_t* asan_wcsrchr(const wchar_t* str, wchar_t character) {
-  size_t size = 0;
-  if (!agent::asan::Shadow::GetNullTerminatedArraySize<wchar_t>(str,
-                                                                0U,
-                                                                &size)) {
-    ReportBadAccess(reinterpret_cast<const uint8*>(str) + size,
-                    agent::asan::ASAN_READ_ACCESS);
-  }
-  return ::wcsrchr(str, character);
-}
-
-const wchar_t* asan_wcsstr(const wchar_t* str, const wchar_t* keys) {
-  size_t size = 0;
-  if (!agent::asan::Shadow::GetNullTerminatedArraySize<wchar_t>(keys,
-                                                                0U,
-                                                                &size)) {
-    ReportBadAccess(reinterpret_cast<const uint8*>(keys) + size,
-                    agent::asan::ASAN_READ_ACCESS);
-  }
-  const wchar_t* ret = ::wcsstr(str, keys);
-  if (ret != NULL && !agent::asan::Shadow::IsAccessible(ret)) {
-    ReportBadAccess(reinterpret_cast<const uint8*>(ret),
-                    agent::asan::ASAN_READ_ACCESS);
-  }
-  return ret;
-}
-
-const wchar_t* asan_wcschr(const wchar_t* str, wchar_t character) {
-  const wchar_t* s = str;
-  while (agent::asan::Shadow::IsAccessible(s) && *s != character && *s != NULL)
-    s++;
-  if (!agent::asan::Shadow::IsAccessible(s)) {
-    ReportBadAccess(reinterpret_cast<const uint8*>(s),
-                    agent::asan::ASAN_READ_ACCESS);
-    return ::wcschr(str, character);
-
-  }
-  if (*s == NULL)
-    return NULL;
-  return s;
-}
-
-int __cdecl asan_strcmp(const char* str1, const char* str2) {
-  // TODO(sebmarchand): Provide an implementation that guarantees the same
-  //     behavior as the original function.
-  NOTIMPLEMENTED();
-  return 0;
-}
-
-const char* __cdecl asan_strpbrk(const char* str1, const char* str2) {
-  // TODO(sebmarchand): Provide an implementation that guarantees the same
-  //     behavior as the original function.
-  NOTIMPLEMENTED();
-  return NULL;
-}
-
-const char* __cdecl asan_strstr(const char* str1, const char* str2) {
-  // TODO(sebmarchand): Provide an implementation that guarantees the same
-  //     behavior as the original function.
-  NOTIMPLEMENTED();
-  return NULL;
-}
-
-size_t __cdecl asan_strspn(const char* str1, const char* str2) {
-  // TODO(sebmarchand): Provide an implementation that guarantees the same
-  //     behavior as the original function.
-  NOTIMPLEMENTED();
-  return 0;
-}
-
-char* __cdecl asan_strncpy(char* destination, const char* source, size_t num) {
-  if (num != 0U) {
-    size_t src_size = 0;
-    if (!agent::asan::Shadow::GetNullTerminatedArraySize<char>(source,
-                                                               num,
-                                                               &src_size) &&
-        src_size <= num) {
-      ReportBadAccess(reinterpret_cast<const uint8*>(source) + src_size,
-                      agent::asan::ASAN_READ_ACCESS);
-    }
-    // We can't use the GetNullTerminatedArraySize function here, as destination
-    // might not be null terminated.
-    TestMemoryRange(reinterpret_cast<const uint8*>(destination),
-                    num,
-                    agent::asan::ASAN_WRITE_ACCESS);
-  }
-  return ::strncpy(destination, source, num);
-}
-
-char* __cdecl asan_strncat(char* destination, const char* source, size_t num) {
-  if (num != 0U) {
-    size_t src_size = 0;
-    if (!agent::asan::Shadow::GetNullTerminatedArraySize<char>(source,
-                                                               num,
-                                                               &src_size) &&
-        src_size <= num) {
-      ReportBadAccess(reinterpret_cast<const uint8*>(source) + src_size,
-                      agent::asan::ASAN_READ_ACCESS);
-    }
-    size_t dst_size = 0;
-    if (!agent::asan::Shadow::GetNullTerminatedArraySize<char>(destination,
-                                                               0U,
-                                                               &dst_size)) {
-      ReportBadAccess(reinterpret_cast<const uint8*>(destination) + dst_size,
-                      agent::asan::ASAN_WRITE_ACCESS);
-    } else {
-      // Test if we can append the source to the destination.
-      TestMemoryRange(reinterpret_cast<const uint8*>(destination + dst_size),
-                      std::min(num, src_size),
-                      agent::asan::ASAN_WRITE_ACCESS);
-    }
-  }
-  return ::strncat(destination, source, num);
-}
-
-}  // extern "C"
diff --git a/syzygy/agent/asan/asan_crt_interceptors.h b/syzygy/agent/asan/asan_crt_interceptors.h
deleted file mode 100644
index 290e453..0000000
--- a/syzygy/agent/asan/asan_crt_interceptors.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Defines the ASan CRT interceptors.
-#ifndef SYZYGY_AGENT_ASAN_ASAN_CRT_INTERCEPTORS_H_
-#define SYZYGY_AGENT_ASAN_ASAN_CRT_INTERCEPTORS_H_
-
-// Exposes the CRT interceptors.
-extern "C" {
-
-void* __cdecl asan_memcpy(unsigned char* destination,
-                          const unsigned char* source,
-                          size_t num);
-
-void* __cdecl asan_memmove(unsigned char* destination,
-                           const unsigned char* source,
-                           size_t num);
-
-void* __cdecl asan_memset(unsigned char* ptr, int value, size_t num);
-
-const void* __cdecl asan_memchr(const unsigned char* ptr,
-                                int value,
-                                size_t num);
-
-size_t __cdecl asan_strcspn(const char* str1, const char* str2);
-
-size_t __cdecl asan_strlen(const char* str);
-
-const char* __cdecl asan_strrchr(const char* str, int character);
-
-const wchar_t* asan_wcsrchr(const wchar_t* str, wchar_t character);
-
-const wchar_t* asan_wcschr(const wchar_t* str, wchar_t character);
-
-int __cdecl asan_strcmp(const char* str1, const char* str2);
-
-const char* __cdecl asan_strpbrk(const char* str1, const char* str2);
-
-const char* __cdecl asan_strstr(const char* str1, const char* str2);
-
-const wchar_t* asan_wcsstr(const wchar_t* str, const wchar_t* keys);
-
-size_t __cdecl asan_strspn(const char* str1, const char* str2);
-
-char* __cdecl asan_strncpy(char* destination, const char* source, size_t num);
-
-char* __cdecl asan_strncat(char* destination, const char* source, size_t num);
-
-}  // extern "C"
-
-#endif  // SYZYGY_AGENT_ASAN_ASAN_CRT_INTERCEPTORS_H_
diff --git a/syzygy/agent/asan/asan_crt_interceptors_unittest.cc b/syzygy/agent/asan/asan_crt_interceptors_unittest.cc
deleted file mode 100644
index 7e28f6d..0000000
--- a/syzygy/agent/asan/asan_crt_interceptors_unittest.cc
+++ /dev/null
@@ -1,615 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/asan_crt_interceptors.h"
-
-#include <windows.h>
-
-#include "base/bind.h"
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/unittest_util.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-using testing::ScopedASanAlloc;
-
-typedef testing::TestAsanRtl CrtInterceptorsTest;
-
-// An arbitrary size for the buffer we allocate in the different unittests.
-const size_t kAllocSize = 13;
-
-void AsanErrorCallback(AsanErrorInfo* error_info) {
-  // Our tests should clean up after themselves and not leave any blocks
-  // corrupt.
-  ASSERT_NE(CORRUPT_BLOCK, error_info->error_type);
-
-  // Raise an exception to prevent the intercepted function from corrupting
-  // the block. If this error is not handled then this will cause the unittest
-  // to fail.
-  ::RaiseException(EXCEPTION_ARRAY_BOUNDS_EXCEEDED, 0, 0, 0);
-}
-
-}  // namespace
-
-TEST_F(CrtInterceptorsTest, AsanCheckMemset) {
-  const size_t kAllocSize = 13;
-  ScopedASanAlloc<uint8> mem(this, kAllocSize);
-  ASSERT_TRUE(mem.get() != NULL);
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(mem.get(), memsetFunction(mem.GetAs<void*>(), 0xAA, kAllocSize));
-  for (size_t i = 0; i < kAllocSize; ++i)
-    EXPECT_EQ(0xAA, mem[i]);
-
-  memsetFunctionFailing(mem.get() - 1, 0xBB, kAllocSize);
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  memsetFunctionFailing(mem.get(), 0xCC, kAllocSize + 1);
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, AsanCheckMemchr) {
-  const size_t kAllocSize = 13;
-  ScopedASanAlloc<uint8> mem(this, kAllocSize);
-  ASSERT_TRUE(mem.get() != NULL);
-  ::memset(mem.get(), 0, kAllocSize);
-  mem[4] = 0xAA;
-
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(mem.get() + 4, memchrFunction(mem.get(), mem[4], kAllocSize));
-  EXPECT_EQ(NULL, memchrFunction(mem.get(), mem[4] + 1, kAllocSize));
-
-  memchrFunctionFailing(mem.get() - 1, mem[4], kAllocSize);
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  memchrFunctionFailing(mem.get() + 1, mem[4], kAllocSize);
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, AsanCheckMemmove) {
-  const size_t kAllocSize = 13;
-  ScopedASanAlloc<uint8> mem_src(this, kAllocSize);
-  ASSERT_TRUE(mem_src.get() != NULL);
-  // Fill the array with value going from 0 to kAllocSize;
-  for (size_t i = 0; i < kAllocSize; ++i)
-    mem_src[i] = i;
-
-  SetCallBackFunction(&AsanErrorCallback);
-  // Shift all the value from one index to the right.
-  EXPECT_EQ(mem_src.get() + 1,
-            memmoveFunction(mem_src.get() + 1, mem_src.get(), kAllocSize - 1));
-  EXPECT_EQ(0, mem_src[0]);
-  for (size_t i = 1; i < kAllocSize; ++i)
-    EXPECT_EQ(i - 1, mem_src[i]);
-
-  // Re-shift them to the left.
-  memmoveFunctionFailing(mem_src.get(), mem_src.get() + 1, kAllocSize);
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  ResetLog();
-
-  memmoveFunctionFailing(mem_src.get() - 1, mem_src.get(), kAllocSize);
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, AsanCheckMemcpy) {
-  const size_t kAllocSize = 13;
-  ScopedASanAlloc<uint8> mem_src(this, kAllocSize);
-  ASSERT_TRUE(mem_src.get() != NULL);
-  ScopedASanAlloc<uint8> mem_dst(this, kAllocSize);
-  ASSERT_TRUE(mem_dst.get() != NULL);
-  // Fill the array with value going from 0 to kAllocSize;
-  for (size_t i = 0; i < kAllocSize; ++i) {
-    mem_src[i] = i;
-    mem_dst[i] = ~i;
-  }
-
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(mem_dst.get(),
-            memcpyFunction(mem_dst.get(), mem_src.get(), kAllocSize));
-  for (size_t i = 0; i < kAllocSize; ++i)
-    EXPECT_EQ(mem_dst[i], mem_src[i]);
-
-  memcpyFunctionFailing(mem_dst.get(), mem_src.get(), kAllocSize + 1);
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  ResetLog();
-
-  memcpyFunctionFailing(mem_dst.get(), mem_src.get() - 1, kAllocSize);
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, DISABLED_AsanCheckStrcspn) {
-  // TODO(sebmarchand): Reactivate this unittest once the implementation of
-  //     this interceptor has been fixed.
-  const char* str_value = "abc1";
-  ScopedASanAlloc<char> str(this, ::strlen(str_value) + 1, str_value);
-  ASSERT_TRUE(str.get() != NULL);
-
-  const char* str_value_2 = "abc";
-  ScopedASanAlloc<char> str2(this, ::strlen(str_value_2) + 1, str_value_2);
-  ASSERT_TRUE(str2.get() != NULL);
-
-  // This should contain at least one value present in |str| but none present
-  // in |str2|.
-  const char* keys_value = "12";
-  EXPECT_NE(::strlen(str_value), ::strcspn(str_value, keys_value));
-  EXPECT_EQ(::strlen(str_value_2), ::strcspn(str_value_2, keys_value));
-  ScopedASanAlloc<char> keys(this, ::strlen(keys_value) + 1, keys_value);
-  ASSERT_TRUE(keys.get() != NULL);
-
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(::strcspn(str.get(), keys.get()),
-            strcspnFunction(str.get(), keys.get()));
-
-  strcspnFunctionFailing(str.get() - 1, keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  // The key set should be null terminated, otherwise an overflow should be
-  // detected.
-  size_t keys_len = ::strlen(keys.get());
-  keys[keys_len] = 'a';
-  strcspnFunctionFailing(str.get(), keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  keys[keys_len] = 0;
-  ResetLog();
-
-  // The implementation allows a non null terminated input string if it contains
-  // at least one of the keys, otherwise it'll overflow.
-
-  size_t str_len = ::strlen(str.get());
-  str[str_len] = 'a';
-  EXPECT_EQ(::strcspn(str.get(), keys.get()),
-            strcspnFunction(str.get(), keys.get()));
-  str[str_len] = 0;
-  ResetLog();
-
-  size_t str2_len = ::strlen(str2.get());
-  str2[str2_len] = 'a';
-  strcspnFunctionFailing(str2.get(), keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  str2[str2_len] = 0;
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, DISABLED_AsanStrcspnImpl) {
-  // TODO(sebmarchand): Reactivate this unittest once the implementation of
-  //     this interceptor has been fixed.
-  EXPECT_EQ(5, asan_strcspn("abcde", "fgh"));
-  EXPECT_EQ(5, asan_strcspn("abcde", ""));
-  EXPECT_EQ(0, asan_strcspn("abcde", "abcde"));
-  EXPECT_EQ(0U, asan_strcspn("abcde", "edcba"));
-  EXPECT_EQ(3, asan_strcspn("abcde", "ed"));
-  EXPECT_EQ(2, asan_strcspn("abcde", "c"));
-  EXPECT_EQ(0U, asan_strcspn("", ""));
-  EXPECT_EQ(0U, asan_strcspn("", "abcde"));
-}
-
-TEST_F(CrtInterceptorsTest, AsanCheckStrlen) {
-  const char* str_value = "test_strlen";
-  ScopedASanAlloc<char> str(this, ::strlen(str_value) + 1, str_value);
-  ASSERT_TRUE(str != NULL);
-
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(::strlen(str.get()), strlenFunction(str.get()));
-
-  strlenFunctionFailing(str.get() - 1);
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  size_t str_len = ::strlen(str.get());
-  str[str_len] = 'a';
-  strlenFunctionFailing(str.get());
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, AsanCheckStrrchr) {
-  const char* str_value = "test_strrchr";
-  ScopedASanAlloc<char> str(this, ::strlen(str_value) + 1, str_value);
-  ASSERT_TRUE(str != NULL);
-
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(::strrchr(str.get(), 'c'), strrchrFunction(str.get(), 'c'));
-  EXPECT_EQ(::strrchr(str.get(), 'z'), strrchrFunction(str.get(), 'z'));
-
-  strrchrFunctionFailing(str.get() - 1, 'c');
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  size_t str_len = ::strlen(str.get());
-  str[str_len] = 'a';
-  strrchrFunctionFailing(str.get(), 'c');
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, AsanCheckWcsrchr) {
-  const wchar_t* wstr_value = L"test_wcsrchr";
-  ScopedASanAlloc<wchar_t> wstr(this, ::wcslen(wstr_value) + 1);
-  ASSERT_TRUE(wstr != NULL);
-  wcscpy(wstr.get(), wstr_value);
-
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(::wcsrchr(wstr.get(), L'c'), wcsrchrFunction(wstr.get(), L'c'));
-  EXPECT_EQ(::wcsrchr(wstr.get(), 'z'), wcsrchrFunction(wstr.get(), 'z'));
-
-  wcsrchrFunctionFailing(wstr.get() - 1, L'c');
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  size_t str_len = ::wcslen(wstr_value);
-  wstr[str_len] = L'a';
-  wcsrchrFunctionFailing(wstr.get(), L'c');
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, AsanCheckWcschr) {
-  const wchar_t* wstr_value = L"test_wcschr";
-  ScopedASanAlloc<wchar_t> wstr(this, ::wcslen(wstr_value) + 1);
-  ASSERT_TRUE(wstr != NULL);
-  wcscpy(wstr.get(), wstr_value);
-
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(::wcschr(wstr.get(), L'c'), wcschrFunction(wstr.get(), L'c'));
-  EXPECT_EQ(::wcschr(wstr.get(), 'z'), wcschrFunction(wstr.get(), 'z'));
-
-  wcschrFunctionFailing(wstr.get() - 1, L'c');
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  size_t str_len = ::wcslen(wstr_value);
-  wstr[str_len] = L'a';
-  wcschrFunctionFailing(wstr.get(), L'z');
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, DISABLED_AsanCheckStrcmp) {
-  // TODO(sebmarchand): Reactivate this unittest once the implementation of
-  //     this interceptor has been fixed.
-  const char* str_value = "test_strcmp";
-  ScopedASanAlloc<char> str(this, ::strlen(str_value) + 1, str_value);
-  ASSERT_TRUE(str.get() != NULL);
-
-  const char* keys_value = "strcmp";
-  ScopedASanAlloc<char> keys(this, ::strlen(keys_value) + 1, keys_value);
-  ASSERT_TRUE(keys.get() != NULL);
-
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(::strcmp(str.get(), keys.get()),
-            strcmpFunction(str.get(), keys.get()));
-
-  strcmpFunctionFailing(str.get() - 1, keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  size_t keys_len = ::strlen(keys.get());
-  keys[keys_len] = 'a';
-  strcmpFunctionFailing(str.get(), keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  keys[keys_len] = 0;
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, DISABLED_AsanCheckStrpbrk) {
-  // TODO(sebmarchand): Reactivate this unittest once the implementation of
-  //     this interceptor has been fixed.
-  const char* str_value = "abc1";
-  ScopedASanAlloc<char> str(this, ::strlen(str_value) + 1, str_value);
-  ASSERT_TRUE(str.get() != NULL);
-
-  const char* str_value_2 = "abc";
-  ScopedASanAlloc<char> str2(this, ::strlen(str_value_2) + 1, str_value_2);
-  ASSERT_TRUE(str2.get() != NULL);
-
-  // This should contain at least one value present in |str| but none present
-  // in |str2|.
-  const char* keys_value = "12";
-  EXPECT_NE(::strlen(str_value), ::strcspn(str_value, keys_value));
-  EXPECT_EQ(::strlen(str_value_2), ::strcspn(str_value_2, keys_value));
-  ScopedASanAlloc<char> keys(this, ::strlen(keys_value) + 1, keys_value);
-  ASSERT_TRUE(keys.get() != NULL);
-
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(::strpbrk(str.get(), keys.get()),
-            strpbrkFunction(str.get(), keys.get()));
-
-  strpbrkFunctionFailing(str.get() - 1, keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  size_t keys_len = ::strlen(keys.get());
-  keys[keys_len] = 'a';
-  strpbrkFunctionFailing(str.get(), keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  keys[keys_len] = 0;
-  ResetLog();
-
-  // The implementation allows a non null terminated input string if it contains
-  // at least one of the keys, otherwise it'll overflow.
-
-  size_t str_len = ::strlen(str.get());
-  str[str_len] = 'a';
-  EXPECT_EQ(::strpbrk(str.get(), keys.get()),
-            strpbrkFunction(str.get(), keys.get()));
-  str[str_len] = 0;
-  ResetLog();
-
-  size_t str2_len = ::strlen(str2.get());
-  str2[str2_len] = 'a';
-  strpbrkFunctionFailing(str2.get(), keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  str2[str2_len] = 0;
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, DISABLED_AsanStrpbrkImpl) {
-  // TODO(sebmarchand): Reactivate this unittest once the implementation of
-  //     this interceptor has been fixed.
-  const char* abcde = "abcde";
-  const char* empty_string = "";
-  EXPECT_EQ(strpbrk(abcde, abcde), asan_strpbrk(abcde, abcde));
-  EXPECT_EQ(strpbrk(abcde, "fgh"), asan_strpbrk(abcde, "fgh"));
-  EXPECT_EQ(strpbrk(abcde, ""), asan_strpbrk(abcde, ""));
-  EXPECT_EQ(strpbrk(abcde, "edcba"), asan_strpbrk(abcde, "edcba"));
-  EXPECT_EQ(strpbrk(abcde, "ed"), asan_strpbrk(abcde, "ed"));
-  EXPECT_EQ(strpbrk(abcde, "c"), asan_strpbrk(abcde, "c"));
-  EXPECT_EQ(strpbrk(empty_string, ""), asan_strpbrk(empty_string, ""));
-  EXPECT_EQ(strpbrk(empty_string, abcde), asan_strpbrk(empty_string, abcde));
-}
-
-TEST_F(CrtInterceptorsTest, DISABLED_AsanCheckStrstr) {
-  // TODO(sebmarchand): Reactivate this unittest once the implementation of
-  //     this interceptor has been fixed.
-  const char* str_value = "test_strstr";
-  ScopedASanAlloc<char> str(this, ::strlen(str_value) + 1, str_value);
-  ASSERT_TRUE(str != NULL);
-
-  const char* keys_value = "strstr";
-  ScopedASanAlloc<char> keys(this, ::strlen(keys_value) + 1, keys_value);
-  ASSERT_TRUE(keys.get() != NULL);
-
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(::strstr(str.get(), keys.get()),
-            strstrFunction(str.get(), keys.get()));
-
-  strstrFunctionFailing(str.get() - 1, keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  size_t keys_len = ::strlen(keys.get());
-  keys[keys_len] = 'a';
-  strstrFunctionFailing(str.get(), keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  keys[keys_len] = 0;
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, AsanCheckWcsstr) {
-  const wchar_t* str_value = L"test_wcsstr";
-  ScopedASanAlloc<wchar_t> str(this, ::wcslen(str_value) + 1, str_value);
-  ASSERT_TRUE(str != NULL);
-
-  const wchar_t* keys_value = L"wcsstr";
-  ScopedASanAlloc<wchar_t> keys(this, ::wcslen(keys_value) + 1, keys_value);
-  ASSERT_TRUE(keys.get() != NULL);
-
-  EXPECT_EQ(::wcsstr(str.get(), keys.get()),
-            wcsstrFunction(str.get(), keys.get()));
-
-  EXPECT_EQ(NULL, wcsstrFunction(str.get(), L"abcd"));
-
-  SetCallBackFunction(&AsanErrorCallback);
-  keys[::wcslen(keys_value)] = L'a';
-  wcsstrFunctionFailing(str.get(), keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  keys[::wcslen(keys_value)] = 0;
-
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, DISABLED_AsanCheckStrspn) {
-  // TODO(sebmarchand): Reactivate this unittest once the implementation of
-  //     this interceptor has been fixed.
-  const char* str_value = "123_abc";
-  ScopedASanAlloc<char> str(this, ::strlen(str_value) + 1, str_value);
-  ASSERT_TRUE(str.get() != NULL);
-
-  const char* keys_value = "123";
-  EXPECT_EQ(::strlen(keys_value), ::strspn(str_value, keys_value));
-  ScopedASanAlloc<char> keys(this, ::strlen(keys_value) + 1, keys_value);
-  ASSERT_TRUE(keys.get() != NULL);
-
-  // The second test string should only contains values present in the keys.
-  const char* str_value_2 = "12321";
-  ScopedASanAlloc<char> str2(this, ::strlen(str_value_2) + 1, str_value_2);
-  EXPECT_EQ(::strlen(str_value_2), ::strspn(str_value_2, keys_value));
-  ASSERT_TRUE(str2.get() != NULL);
-
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(::strspn(str.get(), keys.get()),
-            strspnFunction(str.get(), keys.get()));
-
-  strspnFunctionFailing(str.get() - 1, keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  size_t keys_len = ::strlen(keys.get());
-  keys[keys_len] = 'a';
-  strspnFunctionFailing(str.get(), keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  keys[keys_len] = 0;
-  ResetLog();
-
-  // The implementation allows a non null terminated input string if it doesn't
-  // start with a value contained in the keys, otherwise it'll overflow.
-
-  size_t str_len = ::strlen(str.get());
-  str[str_len] = 'a';
-  EXPECT_EQ(::strspn(str.get(), keys.get()),
-            strspnFunction(str.get(), keys.get()));
-  str[str_len] = 0;
-  ResetLog();
-
-  size_t str2_len = ::strlen(str2.get());
-  str2[str2_len] = keys[0];
-  strspnFunctionFailing(str2.get(), keys.get());
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  str2[str2_len] = 0;
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, DISABLED_AsanStrspnImpl) {
-  // TODO(sebmarchand): Reactivate this unittest once the implementation of
-  //     this interceptor has been fixed.
-  EXPECT_EQ(5, asan_strspn("abcde", "abcde"));
-  EXPECT_EQ(5, asan_strspn("abcde", "edcba"));
-  EXPECT_EQ(0U, asan_strspn("abcde", ""));
-  EXPECT_EQ(2, asan_strspn("abcde", "ab"));
-  EXPECT_EQ(4, asan_strspn("abccde", "abc"));
-  EXPECT_EQ(2, asan_strspn("abcde", "fghab"));
-  EXPECT_EQ(3, asan_strspn("abcde", "fagbhc"));
-  EXPECT_EQ(1, asan_strspn("abcde", "aaa"));
-  EXPECT_EQ(0U, asan_strspn("abcde", "fgh"));
-  EXPECT_EQ(0U, asan_strspn("", ""));
-  EXPECT_EQ(0U, asan_strspn("", "abcde"));
-}
-
-TEST_F(CrtInterceptorsTest, AsanCheckStrncpy) {
-  const char* str_value = "test_strncpy";
-  ScopedASanAlloc<char> source(this, ::strlen(str_value) + 1, str_value);
-  ASSERT_TRUE(source != NULL);
-
-  const char* long_str_value = "test_strncpy_long_source";
-  ScopedASanAlloc<char> long_source(this, ::strlen(long_str_value) + 1,
-      long_str_value);
-  ASSERT_TRUE(long_source.get() != NULL);
-
-  ScopedASanAlloc<char> destination(this, ::strlen(str_value) + 1);
-  ASSERT_TRUE(destination != NULL);
-
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(destination.get(),
-            strncpyFunction(destination.get(),
-                            source.get(),
-                            ::strlen(str_value)));
-
-  // Test an underflow on the source.
-  strncpyFunctionFailing(destination.get(),
-                         source.get() - 1,
-                         ::strlen(str_value));
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  // Test an underflow on the destination.
-  strncpyFunctionFailing(destination.get() - 1,
-                         source.get(),
-                         ::strlen(str_value));
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  // Test an overflow on the destination.
-  std::vector<uint8> original_data(::strlen(long_str_value));
-  memcpy(&original_data[0], destination.get(), ::strlen(long_str_value));
-  strncpyFunctionFailing(destination.get(),
-                         long_source.get(),
-                         ::strlen(long_str_value));
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  ResetLog();
-
-  // Another overflow on the destination.
-  strncpyFunctionFailing(destination.get(),
-                         source.get(),
-                         ::strlen(str_value) + 2);
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  ResetLog();
-
-  // Test an overflow on the source.
-  size_t source_len = ::strlen(source.get());
-  source[source_len] = 'a';
-  strncpyFunctionFailing(destination.get(),
-                         source.get(),
-                         ::strlen(source.get()) + 1);
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  source[source_len] = 0;
-  ResetLog();
-}
-
-TEST_F(CrtInterceptorsTest, AsanCheckStrncat) {
-  const char* prefix_value = "test_";
-  const char* suffix_value = "strncat";
-  char buffer[64];
-
-  ScopedASanAlloc<char> mem(this,
-      ::strlen(prefix_value) + ::strlen(suffix_value) + 1, prefix_value);
-  ASSERT_TRUE(mem != NULL);
-  ::strcpy(buffer, prefix_value);
-
-  ScopedASanAlloc<char> suffix(this, ::strlen(suffix_value) + 1, suffix_value);
-  ASSERT_TRUE(mem.get() != NULL);
-
-  SetCallBackFunction(&AsanErrorCallback);
-  EXPECT_EQ(mem.get(),
-      strncatFunction(mem.get(), suffix.get(), ::strlen(suffix_value)));
-  EXPECT_STRCASEEQ(
-      ::strncat(buffer, suffix.get(), ::strlen(suffix_value)), mem.get());
-
-  // Test an underflow on the suffix.
-  ::strcpy(mem.get(), prefix_value);
-  ::strcpy(buffer, prefix_value);
-  strncatFunctionFailing(mem.get(), suffix.get() - 1, ::strlen(suffix_value));
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  // Test an underflow on the destination.
-  ::strcpy(mem.get(), prefix_value);
-  ::strcpy(buffer, prefix_value);
-  strncatFunctionFailing(mem.get() - 1, suffix.get(), ::strlen(suffix_value));
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-  ResetLog();
-
-  // Test an overflow on the suffix.
-  size_t suffix_len = ::strlen(suffix.get());
-  suffix[suffix_len] = 'a';
-  ::strcpy(mem.get(), prefix_value);
-  ::strcpy(buffer, prefix_value);
-  strncatFunctionFailing(mem.get(), suffix.get(), ::strlen(suffix.get()) + 1);
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  suffix[suffix_len] = 0;
-  ResetLog();
-
-  // Test an overflow on the destination.
-  ::strcpy(mem.get(), prefix_value);
-  ::strcpy(buffer, prefix_value);
-  size_t prefix_len = ::strlen(prefix_value);
-  mem[prefix_len] = 'a';
-  buffer[prefix_len] = 'a';
-  strncatFunctionFailing(mem.get(), suffix.get(), ::strlen(suffix.get()));
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  mem[prefix_len] = 0;
-  buffer[prefix_len] = 0;
-  ResetLog();
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/asan_heap_checker.cc b/syzygy/agent/asan/asan_heap_checker.cc
deleted file mode 100644
index 44e9df0..0000000
--- a/syzygy/agent/asan/asan_heap_checker.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/asan_heap_checker.h"
-
-#include "syzygy/agent/asan/asan_runtime.h"
-#include "syzygy/agent/asan/shadow.h"
-
-namespace agent {
-namespace asan {
-
-bool HeapChecker::IsHeapCorrupt(CorruptRangesVector* corrupt_ranges) {
-  DCHECK_NE(reinterpret_cast<CorruptRangesVector*>(NULL), corrupt_ranges);
-
-  corrupt_ranges->clear();
-
-  // Walk over all of the addressable memory to find the corrupt blocks.
-  // TODO(sebmarchand): Iterates over the heap slabs once we have switched to
-  //     a new memory allocator.
-  GetCorruptRangesInSlab(
-      reinterpret_cast<const uint8*>(Shadow::kAddressLowerBound),
-      Shadow::kAddressUpperBound - Shadow::kAddressLowerBound - 1,
-      corrupt_ranges);
-
-  return !corrupt_ranges->empty();
-}
-
-void HeapChecker::GetCorruptRangesInSlab(const uint8* lower_bound,
-                                         size_t length,
-                                         CorruptRangesVector* corrupt_ranges) {
-  DCHECK_NE(reinterpret_cast<const uint8*>(NULL), lower_bound);
-  DCHECK_NE(0U, length);
-  DCHECK_NE(reinterpret_cast<CorruptRangesVector*>(NULL), corrupt_ranges);
-
-  ShadowWalker shadow_walker(false, lower_bound, lower_bound + length);
-
-  AsanCorruptBlockRange* current_corrupt_range = NULL;
-
-  // Iterates over the blocks.
-  BlockInfo block_info = {};
-  while (shadow_walker.Next(&block_info)) {
-    bool current_block_is_corrupt = IsBlockCorrupt(block_info.block, NULL);
-    // If the current block is corrupt and |current_corrupt_range| is NULL
-    // then this means that the current block is at the beginning of a corrupt
-    // range.
-    if (current_block_is_corrupt && current_corrupt_range == NULL) {
-      current_corrupt_range = new AsanCorruptBlockRange();
-      current_corrupt_range->address = block_info.block;
-      current_corrupt_range->length = 0;
-      current_corrupt_range->block_count = 0;
-      current_corrupt_range->block_info = NULL;
-      current_corrupt_range->block_info_count = 0;
-      corrupt_ranges->push_back(current_corrupt_range);
-    } else if (!current_block_is_corrupt && current_corrupt_range != NULL) {
-      current_corrupt_range = NULL;
-    }
-
-    if (current_block_is_corrupt) {
-      // If the current block is corrupt then we need to update the size of the
-      // current range.
-      DCHECK_NE(reinterpret_cast<AsanCorruptBlockRange*>(NULL),
-                current_corrupt_range);
-      current_corrupt_range->block_count++;
-      const uint8* current_block_end = block_info.block + block_info.block_size;
-      current_corrupt_range->length = current_block_end -
-          reinterpret_cast<const uint8*>(current_corrupt_range->address);
-    }
-  }
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/asan_heap_checker.h b/syzygy/agent/asan/asan_heap_checker.h
deleted file mode 100644
index a5dce69..0000000
--- a/syzygy/agent/asan/asan_heap_checker.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Declares HeapChecker, a class that checks a heap for corruption.
-
-#ifndef SYZYGY_AGENT_ASAN_ASAN_HEAP_CHECKER_H_
-#define SYZYGY_AGENT_ASAN_ASAN_HEAP_CHECKER_H_
-
-#include <vector>
-
-#include "base/logging.h"
-#include "base/memory/scoped_vector.h"
-#include "syzygy/agent/asan/error_info.h"
-#include "syzygy/agent/asan/stack_capture.h"
-
-namespace agent {
-namespace asan {
-
-// Forward declaration.
-class AsanRuntime;
-
-// A class to analyze the heap and to check if it's corrupt.
-class HeapChecker {
- public:
-  typedef ScopedVector<AsanCorruptBlockRange> CorruptRangesVector;
-
-  // Constructor.
-  HeapChecker() { }
-
-  // Checks if the heap is corrupt and returns the information about the
-  // corrupt ranges.
-  // @param corrupt_ranges Will receive the information about the corrupt
-  //     ranges.
-  // @returns true if the heap is corrupt, false otherwise.
-  bool IsHeapCorrupt(CorruptRangesVector* corrupt_ranges);
-
-  // TODO(sebmarchand): Add a testing seam that controls the range of memory
-  //     that is walked by HeapChecker to keep unittest times to something
-  //     reasonable.
-
- private:
-  // Get the information about the corrupt ranges in a heap slab.
-  // @param lower_bound The lower bound for this slab.
-  // @param length The length of this slab.
-  // @param corrupt_ranges Will receive the information about the corrupt ranges
-  //     in this slab.
-  void GetCorruptRangesInSlab(const uint8* lower_bound,
-                              size_t length,
-                              CorruptRangesVector* corrupt_ranges);
-};
-
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_ASAN_HEAP_CHECKER_H_
diff --git a/syzygy/agent/asan/asan_heap_checker_unittest.cc b/syzygy/agent/asan/asan_heap_checker_unittest.cc
deleted file mode 100644
index e9f99b1..0000000
--- a/syzygy/agent/asan/asan_heap_checker_unittest.cc
+++ /dev/null
@@ -1,186 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/asan_heap_checker.h"
-
-#include "base/rand_util.h"
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/asan_logger.h"
-#include "syzygy/agent/asan/asan_runtime.h"
-#include "syzygy/agent/asan/unittest_util.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-typedef public testing::TestWithAsanRuntime HeapCheckerTest;
-
-using testing::FakeAsanBlock;
-
-}  // namespace
-
-TEST_F(HeapCheckerTest, IsHeapCorruptInvalidChecksum) {
-  const size_t kAllocSize = 100;
-  FakeAsanBlock fake_block(kShadowRatioLog, runtime_.stack_cache());
-
-  fake_block.InitializeBlock(kAllocSize);
-  base::RandBytes(fake_block.block_info.body, kAllocSize);
-
-  HeapChecker heap_checker;
-  HeapChecker::CorruptRangesVector corrupt_ranges;
-  EXPECT_FALSE(heap_checker.IsHeapCorrupt(&corrupt_ranges));
-
-  // Free the block and corrupt its data.
-  ASSERT_TRUE(fake_block.MarkBlockAsQuarantined());
-  size_t header_checksum = fake_block.block_info.header->checksum;
-
-  // Corrupt the data in such a way that we can guarantee no hash collision.
-  const size_t kMaxIterations = 10;
-  size_t iteration = 0;
-  uint8 original_value = fake_block.block_info.body[0];
-  do {
-    fake_block.block_info.body[0]++;
-    BlockSetChecksum(fake_block.block_info);
-  } while (fake_block.block_info.header->checksum == header_checksum &&
-           iteration++ < kMaxIterations);
-
-  // Restore the checksum to make sure that the corruption gets detected.
-  fake_block.block_info.header->checksum = header_checksum;
-
-  EXPECT_TRUE(heap_checker.IsHeapCorrupt(&corrupt_ranges));
-  ASSERT_EQ(1, corrupt_ranges.size());
-  AsanCorruptBlockRange* range_info = *corrupt_ranges.begin();
-
-  EXPECT_EQ(1, range_info->block_count);
-  ShadowWalker shadow_walker(
-      false,
-      reinterpret_cast<const uint8*>(range_info->address),
-      reinterpret_cast<const uint8*>(range_info->address) + range_info->length);
-  BlockInfo block_info = {};
-  EXPECT_TRUE(shadow_walker.Next(&block_info));
-  EXPECT_EQ(fake_block.block_info.header, block_info.header);
-  EXPECT_FALSE(shadow_walker.Next(&block_info));
-
-  fake_block.block_info.header->checksum = header_checksum;
-  fake_block.block_info.body[0] = original_value;
-  EXPECT_FALSE(heap_checker.IsHeapCorrupt(&corrupt_ranges));
-}
-
-TEST_F(HeapCheckerTest, IsHeapCorruptInvalidMagicNumber) {
-  const size_t kAllocSize = 100;
-  FakeAsanBlock fake_block(kShadowRatioLog, runtime_.stack_cache());
-
-  fake_block.InitializeBlock(kAllocSize);
-  base::RandBytes(fake_block.block_info.body, kAllocSize);
-
-  HeapChecker heap_checker;
-  HeapChecker::CorruptRangesVector corrupt_ranges;
-  EXPECT_FALSE(heap_checker.IsHeapCorrupt(&corrupt_ranges));
-
-  // Corrupt the header of the block and ensure that the heap corruption gets
-  // detected.
-  fake_block.block_info.header->magic = ~fake_block.block_info.header->magic;
-  EXPECT_TRUE(heap_checker.IsHeapCorrupt(&corrupt_ranges));
-  ASSERT_EQ(1, corrupt_ranges.size());
-  AsanCorruptBlockRange* range_info = *corrupt_ranges.begin();
-
-  EXPECT_EQ(1, range_info->block_count);
-  ShadowWalker shadow_walker(
-      false,
-      reinterpret_cast<const uint8*>(range_info->address),
-      reinterpret_cast<const uint8*>(range_info->address) + range_info->length);
-  BlockInfo block_info = {};
-  EXPECT_TRUE(shadow_walker.Next(&block_info));
-  EXPECT_EQ(fake_block.block_info.header, block_info.header);
-  EXPECT_FALSE(shadow_walker.Next(&block_info));
-
-  fake_block.block_info.header->magic = ~fake_block.block_info.header->magic;
-  EXPECT_FALSE(heap_checker.IsHeapCorrupt(&corrupt_ranges));
-}
-
-TEST_F(HeapCheckerTest, IsHeapCorrupt) {
-  const size_t kAllocSize = 100;
-
-  BlockLayout block_layout = {};
-  BlockPlanLayout(kShadowRatio, kShadowRatio, kAllocSize, 0, 0, &block_layout);
-
-  const size_t kNumberOfBlocks = 4;
-  size_t total_alloc_size = block_layout.block_size * kNumberOfBlocks;
-  uint8* global_alloc = reinterpret_cast<uint8*>(::malloc(total_alloc_size));
-
-  uint8* blocks[kNumberOfBlocks];
-  BlockHeader* block_headers[kNumberOfBlocks];
-
-  for (size_t i = 0; i < kNumberOfBlocks; ++i) {
-    blocks[i] = global_alloc + i * block_layout.block_size;
-    BlockInfo block_info = {};
-    BlockInitialize(block_layout, blocks[i], false, &block_info);
-    Shadow::PoisonAllocatedBlock(block_info);
-    BlockSetChecksum(block_info);
-    block_headers[i] = block_info.header;
-    EXPECT_EQ(block_headers[i], reinterpret_cast<BlockHeader*>(blocks[i]));
-  }
-
-  HeapChecker heap_checker;
-  HeapChecker::CorruptRangesVector corrupt_ranges;
-  EXPECT_FALSE(heap_checker.IsHeapCorrupt(&corrupt_ranges));
-
-  // Corrupt the header of the first two blocks and of the last one.
-  block_headers[0]->magic++;
-  block_headers[1]->magic++;
-  block_headers[kNumberOfBlocks - 1]->magic++;
-
-  EXPECT_TRUE(heap_checker.IsHeapCorrupt(&corrupt_ranges));
-
-  // We expect the heap to contain 2 ranges of corrupt blocks, the first one
-  // containing the 2 first blocks and the second one containing the last block.
-
-  EXPECT_EQ(2, corrupt_ranges.size());
-
-  BlockInfo block_info = {};
-  ShadowWalker shadow_walker_1(
-      false,
-      reinterpret_cast<const uint8*>(corrupt_ranges[0]->address),
-      reinterpret_cast<const uint8*>(corrupt_ranges[0]->address) +
-          corrupt_ranges[0]->length);
-  EXPECT_TRUE(shadow_walker_1.Next(&block_info));
-  EXPECT_EQ(reinterpret_cast<const BlockHeader*>(block_info.header),
-            block_headers[0]);
-  EXPECT_TRUE(shadow_walker_1.Next(&block_info));
-  EXPECT_EQ(reinterpret_cast<const BlockHeader*>(block_info.header),
-            block_headers[1]);
-  EXPECT_FALSE(shadow_walker_1.Next(&block_info));
-
-  ShadowWalker shadow_walker_2(
-      false,
-      reinterpret_cast<const uint8*>(corrupt_ranges[1]->address),
-      reinterpret_cast<const uint8*>(corrupt_ranges[1]->address) +
-          corrupt_ranges[1]->length);
-  EXPECT_TRUE(shadow_walker_2.Next(&block_info));
-  EXPECT_EQ(reinterpret_cast<const BlockHeader*>(block_info.header),
-            block_headers[kNumberOfBlocks - 1]);
-  EXPECT_FALSE(shadow_walker_2.Next(&block_info));
-
-  // Restore the checksum of the blocks.
-  block_headers[0]->magic--;
-  block_headers[1]->magic--;
-  block_headers[kNumberOfBlocks - 1]->magic--;
-
-  Shadow::Unpoison(global_alloc, total_alloc_size);
-  ::free(global_alloc);
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/asan_logger.cc b/syzygy/agent/asan/asan_logger.cc
deleted file mode 100644
index 69fd3f3..0000000
--- a/syzygy/agent/asan/asan_logger.cc
+++ /dev/null
@@ -1,152 +0,0 @@
-// Copyright 2012 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/asan_logger.h"
-
-#include "base/command_line.h"
-#include "base/environment.h"
-#include "base/logging.h"
-#include "base/debug/stack_trace.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/process/launch.h"
-#include "base/strings/stringprintf.h"
-#include "base/strings/utf_string_conversions.h"
-#include "syzygy/trace/rpc/logger_rpc.h"
-#include "syzygy/trace/rpc/rpc_helpers.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-using trace::client::GetInstanceString;
-
-AsanLogger* logger_instance = NULL;
-
-void InitExecutionContext(const CONTEXT& rtl_context,
-                          ExecutionContext* exc_context) {
-  DCHECK(exc_context != NULL);
-
-  exc_context->edi = rtl_context.Edi;
-  exc_context->esi = rtl_context.Esi;
-  exc_context->ebx = rtl_context.Ebx;
-  exc_context->edx = rtl_context.Edx;
-  exc_context->ecx = rtl_context.Ecx;
-  exc_context->eax = rtl_context.Eax;
-  exc_context->ebp = rtl_context.Ebp;
-  exc_context->eip = rtl_context.Eip;
-  exc_context->seg_cs = rtl_context.SegCs;
-  exc_context->eflags = rtl_context.EFlags;
-  exc_context->esp = rtl_context.Esp;
-  exc_context->seg_ss = rtl_context.SegSs;
-}
-
-}  // namespace
-
-AsanLogger::AsanLogger() : log_as_text_(true), minidump_on_failure_(false) {
-}
-
-void AsanLogger::Init() {
-  bool success = rpc_binding_.Open(
-      kLoggerRpcProtocol,
-      GetInstanceString(kLoggerRpcEndpointRoot, instance_id_));
-
-  // TODO(rogerm): Add a notion of a session to the logger interface. Opening
-  //     a session (either here, or on first use) allows for better management
-  //     of symbol context across trace log messages for a given process.
-  if (success) {
-    const CommandLine* command_line = CommandLine::ForCurrentProcess();
-    std::string message = base::StringPrintf(
-        "PID=%d; cmd-line='%ls'\n",
-        ::GetCurrentProcessId(),
-        command_line->GetCommandLineString().c_str());
-    success = trace::client::InvokeRpc(
-        &LoggerClient_Write,
-        rpc_binding_.Get(),
-        reinterpret_cast<const unsigned char*>(message.c_str())).succeeded();
-    if (!success)
-      rpc_binding_.Close();
-  }
-}
-
-void AsanLogger::Stop() {
-  if (rpc_binding_.Get() != NULL) {
-    trace::client::InvokeRpc(
-        &LoggerClient_Stop,
-        rpc_binding_.Get());
-  }
-}
-
-void AsanLogger::Write(const std::string& message) {
-  // If we're bound to a logging endpoint, log the message there.
-  if (rpc_binding_.Get() != NULL) {
-    trace::client::InvokeRpc(
-        &LoggerClient_Write,
-        rpc_binding_.Get(),
-        reinterpret_cast<const unsigned char*>(message.c_str()));
-  }
-}
-
-void AsanLogger::WriteWithContext(const std::string& message,
-                                  const CONTEXT& context) {
-  // If we're bound to a logging endpoint, log the message there.
-  if (rpc_binding_.Get() != NULL) {
-    ExecutionContext exec_context = {};
-    InitExecutionContext(context, &exec_context);
-    trace::client::InvokeRpc(
-        &LoggerClient_WriteWithContext,
-        rpc_binding_.Get(),
-        reinterpret_cast<const unsigned char*>(message.c_str()),
-        &exec_context);
-  }
-}
-
-void AsanLogger::WriteWithStackTrace(const std::string& message,
-                                     const void * const * trace_data,
-                                     size_t trace_length) {
-  // If we're bound to a logging endpoint, log the message there.
-  if (rpc_binding_.Get() != NULL) {
-    trace::client::InvokeRpc(
-        &LoggerClient_WriteWithTrace,
-        rpc_binding_.Get(),
-        reinterpret_cast<const unsigned char*>(message.c_str()),
-        reinterpret_cast<const DWORD*>(trace_data),
-        trace_length);
-  }
-}
-
-void AsanLogger::SaveMiniDump(CONTEXT* context, AsanErrorInfo* error_info) {
-  DCHECK(context != NULL);
-  DCHECK(error_info != NULL);
-
-  if (rpc_binding_.Get() == NULL)
-    return;
-
-  EXCEPTION_RECORD exception = {};
-  exception.ExceptionCode = EXCEPTION_ARRAY_BOUNDS_EXCEEDED;
-  exception.ExceptionAddress = reinterpret_cast<PVOID>(context->Eip);
-  exception.NumberParameters = 2;
-  exception.ExceptionInformation[0] = reinterpret_cast<ULONG_PTR>(context);
-  exception.ExceptionInformation[1] = reinterpret_cast<ULONG_PTR>(error_info);
-
-  const EXCEPTION_POINTERS pointers = { &exception, context };
-  trace::client::InvokeRpc(&LoggerClient_SaveMiniDump,
-                           rpc_binding_.Get(),
-                           ::GetCurrentThreadId(),
-                           reinterpret_cast<unsigned long>(&pointers),
-                           0);
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/asan_logger.h b/syzygy/agent/asan/asan_logger.h
deleted file mode 100644
index bd22f8e..0000000
--- a/syzygy/agent/asan/asan_logger.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2012 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef SYZYGY_AGENT_ASAN_ASAN_LOGGER_H_
-#define SYZYGY_AGENT_ASAN_ASAN_LOGGER_H_
-
-#include <string>
-
-#include "base/logging.h"
-#include "syzygy/trace/rpc/rpc_helpers.h"
-
-namespace agent {
-namespace asan {
-
-struct AsanErrorInfo;
-
-// A wrapper class to manage the singleton ASAN RPC logger instance.
-class AsanLogger {
- public:
-  AsanLogger();
-
-  // Set the RPC instance ID to use. If an instance-id is to be used by the
-  // logger, it must be set before calling Init().
-  const std::wstring& instance_id() const { return instance_id_; }
-  void set_instance_id(const base::StringPiece16& instance_id) {
-    DCHECK(rpc_binding_.Get() == NULL);
-    instance_id_.assign(instance_id.begin(), instance_id.end());
-  }
-
-  // Set whether to write text to the asan log.
-  bool log_as_text() const { return log_as_text_; }
-  void set_log_as_text(bool value) { log_as_text_ = value; }
-
-  // Set whether to save a minidump on error.
-  bool minidump_on_failure() const { return minidump_on_failure_; }
-  void set_minidump_on_failure(bool value) { minidump_on_failure_ = value; }
-
-  // Initialize the logger.
-  void Init();
-
-  // Stop the logger.
-  void Stop();
-
-  // Write a @p message to the logger.
-  void Write(const std::string& message);
-
-  // Write a @p message to the logger, and have the logger include the most
-  // detailed and accurate stack trace it can derive given the execution
-  // @p context .
-  void WriteWithContext(const std::string& message, const CONTEXT& context);
-
-  // Write a @p message to the logger, with an optional stack @p trace
-  // containing @p trace_length elements.
-  void WriteWithStackTrace(const std::string& message,
-                           const void* const* trace_data,
-                           size_t trace_length);
-
-  // Ask the logger to capture a minidump of the process for the given
-  // @p context and @p error_info.
-  void SaveMiniDump(CONTEXT* context, AsanErrorInfo* error_info);
-
- protected:
-  // The RPC binding.
-  trace::client::ScopedRpcBinding rpc_binding_;
-
-  // The logger's instance id.
-  std::wstring instance_id_;
-
-  // True if the runtime has been asked to write text to the logger.
-  // Default: true.
-  bool log_as_text_;
-
-  // True if the runtime has been asked to save a minidump on error.
-  // Default: false.
-  bool minidump_on_failure_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(AsanLogger);
-};
-
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_ASAN_LOGGER_H_
diff --git a/syzygy/agent/asan/asan_logger_unittest.cc b/syzygy/agent/asan/asan_logger_unittest.cc
deleted file mode 100644
index 0991149..0000000
--- a/syzygy/agent/asan/asan_logger_unittest.cc
+++ /dev/null
@@ -1,150 +0,0 @@
-// Copyright 2012 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/asan_logger.h"
-
-#include <string>
-
-#include "base/bind.h"
-#include "base/bind_helpers.h"
-#include "base/environment.h"
-#include "base/file_util.h"
-#include "base/files/file_enumerator.h"
-#include "base/files/file_path.h"
-#include "base/files/scoped_temp_dir.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/strings/string_util.h"
-#include "base/strings/stringprintf.h"
-#include "base/strings/utf_string_conversions.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/asan_runtime.h"
-#include "syzygy/trace/agent_logger/agent_logger.h"
-#include "syzygy/trace/agent_logger/agent_logger_rpc_impl.h"
-#include "syzygy/trace/protocol/call_trace_defs.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-using testing::Return;
-
-class TestAsanLogger : public AsanLogger {
- public:
-  using AsanLogger::instance_id_;
-  using AsanLogger::rpc_binding_;
-};
-
-class AsanLoggerTest : public testing::Test {
- public:
-  AsanLoggerTest() {
-    EXPECT_TRUE(temp_dir_.CreateUniqueTempDir());
-    temp_path_ = temp_dir_.path().Append(L"log.txt");
-
-    // Setup the instance id.
-    instance_id_ = base::StringPrintf(L"%d", ::GetCurrentProcessId());
-  }
-
-  MOCK_METHOD1(LoggerStoppedCallback, bool(trace::common::Service*));
-
- protected:
-  base::ScopedTempDir temp_dir_;
-  base::FilePath temp_path_;
-  std::wstring instance_id_;
-  TestAsanLogger client_;
-};
-
-}  // namespace
-
-TEST_F(AsanLoggerTest, EndToEnd) {
-  const std::string kMessage("This is the test message\n");
-
-  {
-    // Setup a log file destination.
-    base::ScopedFILE destination(base::OpenFile(temp_path_, "wb"));
-
-    // Start up the logging service.
-    trace::agent_logger::AgentLogger server;
-    trace::agent_logger::RpcLoggerInstanceManager instance_manager(&server);
-    server.set_instance_id(instance_id_);
-    server.set_destination(destination.get());
-    server.set_minidump_dir(temp_dir_.path());
-    ASSERT_TRUE(server.Start());
-
-    // Use the AsanLogger client.
-    client_.set_instance_id(instance_id_);
-    client_.set_log_as_text(true);
-    client_.set_minidump_on_failure(true);
-    client_.Init();
-    ASSERT_EQ(instance_id_, client_.instance_id_);
-    ASSERT_TRUE(client_.rpc_binding_.Get() != NULL);
-    client_.Write(kMessage);
-
-    // Generate a minidump.
-    CONTEXT ctx = {};
-    ::RtlCaptureContext(&ctx);
-    AsanErrorInfo info = {};
-    client_.SaveMiniDump(&ctx, &info);
-
-    // Shutdown the logging service.
-    ASSERT_TRUE(server.Stop());
-    ASSERT_TRUE(server.Join());
-  }
-
-  // Inspect the log file contents.
-  std::string content;
-  ASSERT_TRUE(base::ReadFileToString(temp_path_, &content));
-  ASSERT_THAT(content, testing::EndsWith(kMessage));
-
-  // We should have exactly one minidump in the temp directory.
-  using base::FileEnumerator;
-  FileEnumerator fe(temp_dir_.path(), false, FileEnumerator::FILES, L"*.dmp");
-  base::FilePath minidump(fe.Next());
-  EXPECT_FALSE(minidump.empty());
-  EXPECT_TRUE(fe.Next().empty());
-
-  // TODO(rogerm): Inspect the contents of the minidump.
-}
-
-TEST_F(AsanLoggerTest, Stop) {
-  // Setup a log file destination.
-  base::ScopedFILE destination(base::OpenFile(temp_path_, "wb"));
-
-  // Start up the logging service.
-  trace::agent_logger::AgentLogger server;
-  trace::agent_logger::RpcLoggerInstanceManager instance_manager(&server);
-  server.set_instance_id(instance_id_);
-  server.set_destination(destination.get());
-  server.set_stopped_callback(
-      base::Bind(&AsanLoggerTest::LoggerStoppedCallback,
-                 base::Unretained(this)));
-  ASSERT_TRUE(server.Start());
-
-  // Use the AsanLogger client.
-  client_.set_instance_id(instance_id_);
-  client_.Init();
-  ASSERT_EQ(instance_id_, client_.instance_id_);
-  ASSERT_TRUE(client_.rpc_binding_.Get() != NULL);
-
-  trace::common::Service* server_base = static_cast<trace::common::Service*>(
-      &server);
-  EXPECT_CALL(*this, LoggerStoppedCallback(server_base)).Times(1).
-      WillOnce(Return(true));
-  client_.Stop();
-  ASSERT_TRUE(server.Join());
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/asan_rtl_impl.cc b/syzygy/agent/asan/asan_rtl_impl.cc
deleted file mode 100644
index 48dd6d7..0000000
--- a/syzygy/agent/asan/asan_rtl_impl.cc
+++ /dev/null
@@ -1,218 +0,0 @@
-// Copyright 2012 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/asan_rtl_impl.h"
-
-#include "base/bind.h"
-#include "base/callback.h"
-#include "base/logging.h"
-#include "base/debug/alias.h"
-#include "base/memory/scoped_ptr.h"
-#include "syzygy/agent/asan/asan_rtl_utils.h"
-#include "syzygy/agent/asan/asan_runtime.h"
-#include "syzygy/agent/asan/heap_manager.h"
-#include "syzygy/agent/asan/shadow.h"
-#include "syzygy/agent/asan/stack_capture.h"
-#include "syzygy/agent/asan/windows_heap_adapter.h"
-#include "syzygy/agent/common/scoped_last_error_keeper.h"
-
-namespace {
-
-using agent::asan::AsanErrorInfo;
-using agent::asan::AsanRuntime;
-using agent::asan::HeapManagerInterface;
-using agent::asan::Shadow;
-using agent::asan::TestStructure;
-using agent::asan::WindowsHeapAdapter;
-
-HANDLE process_heap = NULL;
-HeapManagerInterface::HeapId asan_process_heap = NULL;
-
-// The asan runtime manager.
-AsanRuntime* asan_runtime = NULL;
-
-}  // namespace
-
-namespace agent {
-namespace asan {
-
-void SetUpRtl(AsanRuntime* runtime) {
-  DCHECK(runtime != NULL);
-  asan_runtime = runtime;
-  process_heap = ::GetProcessHeap();
-
-  // Set the instance used by the helper functions.
-  SetAsanRuntimeInstance(runtime);
-
-  asan_process_heap = runtime->GetProcessHeap();
-}
-
-void TearDownRtl() {
-  DCHECK_NE(static_cast<HANDLE>(NULL), process_heap);
-  DCHECK_NE(static_cast<HeapManagerInterface::HeapId>(NULL), asan_process_heap);
-  process_heap = NULL;
-  asan_process_heap = NULL;
-}
-
-}  // namespace asan
-}  // namespace agent
-
-extern "C" {
-
-HANDLE WINAPI asan_GetProcessHeap() {
-  DCHECK_NE(static_cast<HANDLE>(NULL), process_heap);
-  DCHECK_NE(static_cast<HeapManagerInterface::HeapId>(NULL), asan_process_heap);
-  return reinterpret_cast<HANDLE>(asan_process_heap);
-}
-
-HANDLE WINAPI asan_HeapCreate(DWORD options,
-                              SIZE_T initial_size,
-                              SIZE_T maximum_size) {
-  return WindowsHeapAdapter::HeapCreate(options, initial_size, maximum_size);
-}
-
-BOOL WINAPI asan_HeapDestroy(HANDLE heap) {
-  DCHECK(process_heap != NULL);
-  if (heap == process_heap)
-    return ::HeapDestroy(heap);
-
-  return WindowsHeapAdapter::HeapDestroy(heap);
-}
-
-LPVOID WINAPI asan_HeapAlloc(HANDLE heap,
-                             DWORD flags,
-                             SIZE_T bytes) {
-  DCHECK(process_heap != NULL);
-  if (heap == process_heap)
-    return ::HeapAlloc(heap, flags, bytes);
-
-  return WindowsHeapAdapter::HeapAlloc(heap, flags, bytes);
-}
-
-LPVOID WINAPI asan_HeapReAlloc(HANDLE heap,
-                               DWORD flags,
-                               LPVOID mem,
-                               SIZE_T bytes) {
-  DCHECK(process_heap != NULL);
-  if (heap == process_heap)
-    return ::HeapReAlloc(heap, flags, mem, bytes);
-
-  return WindowsHeapAdapter::HeapReAlloc(heap, flags, mem, bytes);
-}
-
-BOOL WINAPI asan_HeapFree(HANDLE heap,
-                          DWORD flags,
-                          LPVOID mem) {
-  DCHECK(process_heap != NULL);
-  if (heap == process_heap)
-    return ::HeapFree(heap, flags, mem);
-
-  return WindowsHeapAdapter::HeapFree(heap, flags, mem);
-}
-
-SIZE_T WINAPI asan_HeapSize(HANDLE heap,
-                            DWORD flags,
-                            LPCVOID mem) {
-  DCHECK(process_heap != NULL);
-  if (heap == process_heap)
-    return ::HeapSize(heap, flags, mem);
-
-  return WindowsHeapAdapter::HeapSize(heap, flags, mem);
-}
-
-BOOL WINAPI asan_HeapValidate(HANDLE heap,
-                              DWORD flags,
-                              LPCVOID mem) {
-  DCHECK(process_heap != NULL);
-  if (heap == process_heap)
-    return ::HeapValidate(heap, flags, mem);
-
-  return WindowsHeapAdapter::HeapValidate(heap, flags, mem);
-}
-
-SIZE_T WINAPI asan_HeapCompact(HANDLE heap,
-                               DWORD flags) {
-  DCHECK(process_heap != NULL);
-  if (heap == process_heap)
-    return ::HeapCompact(heap, flags);
-
-  return WindowsHeapAdapter::HeapCompact(heap, flags);
-}
-
-BOOL WINAPI asan_HeapLock(HANDLE heap) {
-  DCHECK(process_heap != NULL);
-  if (heap == process_heap)
-    return ::HeapLock(heap);
-
-  return WindowsHeapAdapter::HeapLock(heap);
-}
-
-BOOL WINAPI asan_HeapUnlock(HANDLE heap) {
-  DCHECK(process_heap != NULL);
-  if (heap == process_heap)
-    return ::HeapUnlock(heap);
-
-  return WindowsHeapAdapter::HeapUnlock(heap);
-}
-
-BOOL WINAPI asan_HeapWalk(HANDLE heap,
-                          LPPROCESS_HEAP_ENTRY entry) {
-  DCHECK(process_heap != NULL);
-  if (heap == process_heap)
-    return ::HeapWalk(heap, entry);
-
-  return WindowsHeapAdapter::HeapWalk(heap, entry);
-}
-
-BOOL WINAPI asan_HeapSetInformation(
-    HANDLE heap, HEAP_INFORMATION_CLASS info_class,
-    PVOID info, SIZE_T info_length) {
-  DCHECK(process_heap != NULL);
-  if (heap == NULL || heap == process_heap)
-    return ::HeapSetInformation(heap, info_class, info, info_length);
-
-  return WindowsHeapAdapter::HeapSetInformation(heap, info_class, info,
-      info_length);
-}
-
-BOOL WINAPI asan_HeapQueryInformation(
-    HANDLE heap, HEAP_INFORMATION_CLASS info_class,
-    PVOID info, SIZE_T info_length, PSIZE_T return_length) {
-  DCHECK(process_heap != NULL);
-  if (heap == NULL || heap == process_heap) {
-    return ::HeapQueryInformation(heap,
-                                  info_class,
-                                  info,
-                                  info_length,
-                                  return_length);
-  }
-
-  return WindowsHeapAdapter::HeapQueryInformation(heap,
-                                                  info_class,
-                                                  info,
-                                                  info_length,
-                                                  return_length);
-}
-
-void WINAPI asan_SetCallBack(AsanErrorCallBack callback) {
-  DCHECK(asan_runtime != NULL);
-  asan_runtime->SetErrorCallBack(base::Bind(callback));
-}
-
-// Unittesting seam.
-AsanRuntime* WINAPI asan_GetActiveRuntime() {
-  return asan_runtime;
-}
-
-}  // extern "C"
diff --git a/syzygy/agent/asan/asan_rtl_impl.h b/syzygy/agent/asan/asan_rtl_impl.h
deleted file mode 100644
index c2c88ef..0000000
--- a/syzygy/agent/asan/asan_rtl_impl.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2012 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Implement the ASAN RTL functions.
-#ifndef SYZYGY_AGENT_ASAN_ASAN_RTL_IMPL_H_
-#define SYZYGY_AGENT_ASAN_ASAN_RTL_IMPL_H_
-
-#include <windows.h>
-
-namespace agent {
-namespace asan {
-
-class AsanRuntime;
-struct AsanErrorInfo;
-
-// Initialize the Asan runtime library global variables.
-// @param runtime The Asan runtime manager.
-void SetUpRtl(AsanRuntime* runtime);
-
-// Tear down the runtime library.
-void TearDownRtl();
-
-}  // namespace asan
-}  // namespace agent
-
-// Exposes the Asan Rtl functions.
-extern "C" {
-
-HANDLE WINAPI asan_GetProcessHeap();
-
-HANDLE WINAPI asan_HeapCreate(DWORD options,
-                              SIZE_T initial_size,
-                              SIZE_T maximum_size);
-
-BOOL WINAPI asan_HeapDestroy(HANDLE heap);
-
-LPVOID WINAPI asan_HeapAlloc(HANDLE heap,
-                             DWORD flags,
-                             SIZE_T bytes);
-
-LPVOID WINAPI asan_HeapReAlloc(HANDLE heap,
-                               DWORD flags,
-                               LPVOID mem,
-                               SIZE_T bytes);
-
-BOOL WINAPI asan_HeapFree(HANDLE heap,
-                          DWORD flags,
-                          LPVOID mem);
-
-SIZE_T WINAPI asan_HeapSize(HANDLE heap,
-                            DWORD flags,
-                            LPCVOID mem);
-
-BOOL WINAPI asan_HeapValidate(HANDLE heap,
-                              DWORD flags,
-                              LPCVOID mem);
-
-SIZE_T WINAPI asan_HeapCompact(HANDLE heap,
-                               DWORD flags);
-
-BOOL WINAPI asan_HeapLock(HANDLE heap);
-
-BOOL WINAPI asan_HeapUnlock(HANDLE heap);
-
-BOOL WINAPI asan_HeapWalk(HANDLE heap,
-                          LPPROCESS_HEAP_ENTRY entry);
-
-BOOL WINAPI asan_HeapSetInformation(
-    HANDLE heap, HEAP_INFORMATION_CLASS info_class,
-    PVOID info, SIZE_T info_length);
-
-BOOL WINAPI asan_HeapQueryInformation(
-    HANDLE heap, HEAP_INFORMATION_CLASS info_class,
-    PVOID info, SIZE_T info_length, PSIZE_T return_length);
-
-typedef void (*AsanErrorCallBack)(agent::asan::AsanErrorInfo*);
-void WINAPI asan_SetCallBack(AsanErrorCallBack callback);
-
-}  // extern "C"
-
-#endif  // SYZYGY_AGENT_ASAN_ASAN_RTL_IMPL_H_
diff --git a/syzygy/agent/asan/asan_rtl_impl_unittest.cc b/syzygy/agent/asan/asan_rtl_impl_unittest.cc
deleted file mode 100644
index b73ff57..0000000
--- a/syzygy/agent/asan/asan_rtl_impl_unittest.cc
+++ /dev/null
@@ -1,153 +0,0 @@
-// Copyright 2012 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/asan_rtl_impl.h"
-
-#include <windows.h>  // NOLINT
-
-#include "base/rand_util.h"
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/asan_runtime.h"
-#include "syzygy/agent/asan/shadow.h"
-#include "syzygy/agent/asan/unittest_util.h"
-#include "syzygy/core/unittest_util.h"
-
-namespace {
-
-class AsanRtlImplTest : public testing::TestWithAsanLogger {
- public:
-  AsanRtlImplTest() : heap_(NULL) {
-  }
-
-  void SetUp() OVERRIDE {
-    testing::TestWithAsanLogger::SetUp();
-    asan_runtime_.SetUp(std::wstring());
-    agent::asan::SetUpRtl(&asan_runtime_);
-    heap_ = asan_HeapCreate(0, 0, 0);
-    ASSERT_TRUE(heap_ != NULL);
-  }
-
-  void TearDown() OVERRIDE {
-    if (heap_ != NULL) {
-      asan_HeapDestroy(heap_);
-      heap_ = NULL;
-    }
-    agent::asan::TearDownRtl();
-    asan_runtime_.TearDown();
-    testing::TestWithAsanLogger::TearDown();
-  }
-
- protected:
-  agent::asan::AsanRuntime asan_runtime_;
-
-  // Arbitrary constant for all size limit.
-  static const size_t kMaxAllocSize = 134584;
-
-  // Scratch heap handle valid from SetUp to TearDown.
-  HANDLE heap_;
-};
-
-}  // namespace
-
-TEST_F(AsanRtlImplTest, CreateDestroy) {
-  HANDLE heap = asan_HeapCreate(0, 0, 0);
-  ASSERT_TRUE(heap != NULL);
-  ASSERT_TRUE(asan_HeapDestroy(heap));
-}
-
-TEST_F(AsanRtlImplTest, Alloc) {
-  for (size_t size = 10; size < kMaxAllocSize; size = size * 5 + 123) {
-    void* mem = asan_HeapAlloc(heap_, 0, size);
-    ASSERT_TRUE(mem != NULL);
-    ::memset(mem, '\0', size);
-
-    size_t new_size = size;
-    while (new_size == size)
-      new_size = base::RandInt(size / 2, size * 2);
-
-    void* new_mem = asan_HeapReAlloc(heap_, 0, mem, new_size);
-    ASSERT_TRUE(new_mem != NULL);
-    ASSERT_NE(mem, new_mem);
-
-    ASSERT_TRUE(asan_HeapFree(heap_, 0, new_mem));
-  }
-}
-
-TEST_F(AsanRtlImplTest, Size) {
-  for (size_t size = 10; size < kMaxAllocSize; size = size * 5 + 123) {
-    void* mem = asan_HeapAlloc(heap_, 0, size);
-    ASSERT_TRUE(mem != NULL);
-    ASSERT_EQ(size, asan_HeapSize(heap_, 0, mem));
-    ASSERT_TRUE(asan_HeapFree(heap_, 0, mem));
-  }
-}
-
-TEST_F(AsanRtlImplTest, Validate) {
-  for (size_t size = 10; size < kMaxAllocSize; size = size * 5 + 123) {
-    void* mem = asan_HeapAlloc(heap_, 0, size);
-    ASSERT_TRUE(mem != NULL);
-    ASSERT_TRUE(asan_HeapValidate(heap_, 0, mem));
-    ASSERT_TRUE(asan_HeapFree(heap_, 0, mem));
-  }
-}
-
-TEST_F(AsanRtlImplTest, Compact) {
-  // Compact isn't supported by the current heap implementation and should
-  // always return 0.
-  ASSERT_EQ(0U, asan_HeapCompact(heap_, 0));
-}
-
-TEST_F(AsanRtlImplTest, LockUnlock) {
-  // We can't really test these, aside from not crashing.
-  ASSERT_TRUE(asan_HeapLock(heap_));
-  ASSERT_TRUE(asan_HeapUnlock(heap_));
-}
-
-TEST_F(AsanRtlImplTest, Walk) {
-  // Walk isn't supported by the current heap implementation.
-  PROCESS_HEAP_ENTRY entry = {};
-  ASSERT_FALSE(asan_HeapWalk(heap_, &entry));
-}
-
-TEST_F(AsanRtlImplTest, SetQueryInformation) {
-  ULONG compat_flag = -1;
-  unsigned long ret = 0;
-  // QueryInformation isn't supported by the current heap implementation and
-  // should always return false.
-  ASSERT_FALSE(
-      asan_HeapQueryInformation(heap_, HeapCompatibilityInformation,
-                                &compat_flag, sizeof(compat_flag), &ret));
-
-  // Put the heap in LFH, which should always succeed, except when a debugger
-  // is attached. When a debugger is attached, the heap is wedged in certain
-  // debug settings.
-  if (base::debug::BeingDebugged()) {
-    LOG(WARNING) << "Can't test HeapProxy::SetInformation under debugger.";
-    return;
-  }
-
-  // SetInformation isn't supported by the current heap implementation and
-  // should always return true.
-  ASSERT_TRUE(
-      asan_HeapSetInformation(heap_, HeapCompatibilityInformation,
-                              &compat_flag, sizeof(compat_flag)));
-}
-
-TEST_F(AsanRtlImplTest, SetInformationWithNullHeapPtr) {
-  // The documentation of HeapSetInformation specify that the heap handle is
-  // optional.
-  ASSERT_TRUE(
-      asan_HeapSetInformation(NULL, HeapEnableTerminationOnCorruption,
-                              NULL, 0));
-}
diff --git a/syzygy/agent/asan/asan_rtl_unittest.cc b/syzygy/agent/asan/asan_rtl_unittest.cc
deleted file mode 100644
index dbef9c0..0000000
--- a/syzygy/agent/asan/asan_rtl_unittest.cc
+++ /dev/null
@@ -1,608 +0,0 @@
-// Copyright 2012 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include <windows.h>
-
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/asan_heap_checker.h"
-#include "syzygy/agent/asan/asan_rtl_impl.h"
-#include "syzygy/agent/asan/asan_runtime.h"
-#include "syzygy/agent/asan/unittest_util.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-using testing::AsanBlockInfoVector;
-using testing::MemoryAccessorTester;
-using testing::ScopedASanAlloc;
-
-// An arbitrary size for the buffer we allocate in the different unittests.
-const size_t kAllocSize = 13;
-
-class AsanRtlTest : public testing::TestAsanRtl {
- public:
-  AsanRtlTest() : memory_src_(NULL), memory_dst_(NULL), memory_length_(0),
-      memory_size_(0) { }
-
-  void SetUp() OVERRIDE {
-    testing::TestAsanRtl::SetUp();
-
-    // Setup the callback to detect invalid accesses.
-    SetCallBackFunction(&MemoryAccessorTester::AsanErrorCallback);
-  }
- protected:
-  void AllocMemoryBuffers(int32 length, int32 element_size);
-  void FreeMemoryBuffers();
-
-  // Memory buffers used to test special instructions.
-  void* memory_src_;
-  void* memory_dst_;
-  int32 memory_length_;
-  int32 memory_size_;
-};
-
-void AsanRtlTest::AllocMemoryBuffers(int32 length, int32 element_size) {
-  ASSERT_EQ(reinterpret_cast<void*>(NULL), memory_src_);
-  ASSERT_EQ(reinterpret_cast<void*>(NULL), memory_dst_);
-  ASSERT_EQ(0, memory_length_);
-  ASSERT_EQ(0, memory_size_);
-
-  // Keep track of memory size.
-  memory_length_ = length;
-  memory_size_ = length * element_size;
-
-  // Allocate memory space.
-  memory_src_ = HeapAllocFunction(heap_, 0, memory_size_);
-  ASSERT_TRUE(memory_src_ != NULL);
-  memory_dst_ = HeapAllocFunction(heap_, 0, memory_size_);
-  ASSERT_TRUE(memory_dst_ != NULL);
-
-  // Initialize memory.
-  ::memset(memory_src_, 0, memory_size_);
-  ::memset(memory_dst_, 0, memory_size_);
-}
-
-void AsanRtlTest::FreeMemoryBuffers() {
-  ASSERT_NE(reinterpret_cast<void*>(NULL), memory_src_);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), memory_dst_);
-
-  ASSERT_TRUE(HeapFreeFunction(heap_, 0, memory_src_));
-  ASSERT_TRUE(HeapFreeFunction(heap_, 0, memory_dst_));
-
-  memory_length_ = 0;
-  memory_size_ = 0;
-  memory_src_ = NULL;
-  memory_dst_ = NULL;
-}
-
-}  // namespace
-
-TEST_F(AsanRtlTest, GetProcessHeap) {
-  agent::asan::AsanRuntime* runtime = GetActiveRuntimeFunction();
-  ASSERT_NE(reinterpret_cast<agent::asan::AsanRuntime*>(NULL), runtime);
-  HANDLE asan_heap_handle = GetProcessHeapFunction();
-  EXPECT_NE(static_cast<HANDLE>(NULL), asan_heap_handle);
-  EXPECT_EQ(reinterpret_cast<HANDLE>(runtime->GetProcessHeap()),
-                                     asan_heap_handle);
-}
-
-TEST_F(AsanRtlTest, AsanCheckGoodAccess) {
-  FARPROC check_access_fn =
-      ::GetProcAddress(asan_rtl_, "asan_check_4_byte_read_access");
-  ASSERT_TRUE(check_access_fn != NULL);
-
-  // Run through access checking an allocation that's larger than our
-  // block size (8), but not a multiple thereof to exercise all paths
-  // in the access check function (save for the failure path).
-  ScopedASanAlloc<uint8> mem(this, kAllocSize);
-  ASSERT_TRUE(mem.get() != NULL);
-
-  MemoryAccessorTester tester;
-  for (size_t i = 0; i < kAllocSize; ++i) {
-    ASSERT_NO_FATAL_FAILURE(
-        tester.CheckAccessAndCompareContexts(check_access_fn, mem.get() + i));
-  }
-}
-
-TEST_F(AsanRtlTest, AsanCheckHeapBufferOverflow) {
-  FARPROC check_access_fn =
-      ::GetProcAddress(asan_rtl_, "asan_check_4_byte_read_access");
-  ASSERT_TRUE(check_access_fn != NULL);
-
-  ScopedASanAlloc<uint8> mem(this, kAllocSize);
-  ASSERT_TRUE(mem.get() != NULL);
-
-  MemoryAccessorTester tester;
-  tester.AssertMemoryErrorIsDetected(
-      check_access_fn, mem.get() + kAllocSize, HEAP_BUFFER_OVERFLOW);
-  EXPECT_TRUE(LogContains("previously allocated here"));
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-}
-
-TEST_F(AsanRtlTest, AsanCheckHeapBufferUnderflow) {
-  FARPROC check_access_fn =
-      ::GetProcAddress(asan_rtl_, "asan_check_4_byte_read_access");
-  ASSERT_TRUE(check_access_fn != NULL);
-
-  ScopedASanAlloc<uint8> mem(this, kAllocSize);
-  ASSERT_TRUE(mem.get() != NULL);
-
-  MemoryAccessorTester tester;
-  tester.AssertMemoryErrorIsDetected(
-      check_access_fn, mem.get() - 1, HEAP_BUFFER_UNDERFLOW);
-  EXPECT_TRUE(LogContains("previously allocated here"));
-  EXPECT_TRUE(LogContains(kHeapBufferUnderFlow));
-}
-
-TEST_F(AsanRtlTest, AsanCheckUseAfterFree) {
-  FARPROC check_access_fn =
-      ::GetProcAddress(asan_rtl_, "asan_check_4_byte_read_access");
-  ASSERT_TRUE(check_access_fn != NULL);
-
-  ScopedASanAlloc<uint8> mem(this, kAllocSize);
-  ASSERT_TRUE(mem.get() != NULL);
-
-  uint8* mem_ptr = mem.get();
-  mem.reset(NULL);
-
-  MemoryAccessorTester tester;
-  tester.AssertMemoryErrorIsDetected(check_access_fn, mem_ptr, USE_AFTER_FREE);
-  EXPECT_TRUE(LogContains("previously allocated here"));
-  EXPECT_TRUE(LogContains("freed here"));
-  EXPECT_TRUE(LogContains(kHeapUseAfterFree));
-}
-
-TEST_F(AsanRtlTest, AsanCheckDoubleFree) {
-  FARPROC check_access_fn =
-      ::GetProcAddress(asan_rtl_, "asan_check_4_byte_read_access");
-  ASSERT_TRUE(check_access_fn != NULL);
-
-  uint8* mem_ptr = NULL;
-  {
-    ScopedASanAlloc<uint8> mem(this, kAllocSize);
-    ASSERT_TRUE(mem.get() != NULL);
-    mem_ptr = mem.get();
-  }
-
-  MemoryAccessorTester tester;
-  tester.set_expected_error_type(DOUBLE_FREE);
-  EXPECT_FALSE(HeapFreeFunction(heap_, 0, mem_ptr));
-  EXPECT_TRUE(tester.memory_error_detected());
-  EXPECT_TRUE(LogContains(kAttemptingDoubleFree));
-  EXPECT_TRUE(LogContains("previously allocated here"));
-  EXPECT_TRUE(LogContains("freed here"));
-}
-
-TEST_F(AsanRtlTest, AsanCheckWildAccess) {
-  FARPROC check_access_fn =
-      ::GetProcAddress(asan_rtl_, "asan_check_4_byte_read_access");
-  ASSERT_TRUE(check_access_fn != NULL);
-
-  MemoryAccessorTester tester;
-  tester.AssertMemoryErrorIsDetected(
-      check_access_fn, reinterpret_cast<void*>(0x80000000), WILD_ACCESS);
-  EXPECT_TRUE(LogContains(kWildAccess));
-}
-
-TEST_F(AsanRtlTest, AsanCheckInvalidAccess) {
-  FARPROC check_access_fn =
-      ::GetProcAddress(asan_rtl_, "asan_check_4_byte_read_access");
-  ASSERT_TRUE(check_access_fn != NULL);
-
-  MemoryAccessorTester tester;
-  tester.AssertMemoryErrorIsDetected(
-      check_access_fn, reinterpret_cast<void*>(0x00000000), INVALID_ADDRESS);
-  EXPECT_TRUE(LogContains(kInvalidAddress));
-}
-
-TEST_F(AsanRtlTest, AsanCheckCorruptBlock) {
-  void* mem = HeapAllocFunction(heap_, 0, kAllocSize);
-  reinterpret_cast<uint8*>(mem)[-1]--;
-  MemoryAccessorTester tester;
-  tester.set_expected_error_type(CORRUPT_BLOCK);
-  EXPECT_TRUE(HeapFreeFunction(heap_, 0, mem));
-  EXPECT_TRUE(tester.memory_error_detected());
-  EXPECT_TRUE(LogContains(kHeapCorruptBlock));
-  EXPECT_TRUE(LogContains("previously allocated here"));
-}
-
-TEST_F(AsanRtlTest, AsanCheckCorruptHeap) {
-  FARPROC check_access_fn =
-      ::GetProcAddress(asan_rtl_, "asan_check_4_byte_read_access");
-  ASSERT_TRUE(check_access_fn != NULL);
-
-  agent::asan::AsanRuntime* runtime = GetActiveRuntimeFunction();
-  ASSERT_NE(reinterpret_cast<agent::asan::AsanRuntime*>(NULL), runtime);
-  runtime->params().check_heap_on_failure = true;
-
-  ScopedASanAlloc<uint8> mem(this, kAllocSize);
-  ASSERT_TRUE(mem.get() != NULL);
-
-  const size_t kMaxIterations = 10;
-
-  // Retrieves the information about this block.
-  BlockHeader* header = BlockGetHeaderFromBody(mem.get());
-  BlockInfo block_info = {};
-  EXPECT_TRUE(BlockInfoFromMemory(header, &block_info));
-
-  // We'll update a non essential value of the block trailer to corrupt it.
-  uint8* mem_in_trailer = reinterpret_cast<uint8*>(
-      &block_info.trailer->alloc_tid);
-
-  // This can fail because of a checksum collision. However, we run it a handful
-  // of times to keep the chances as small as possible.
-  for (size_t i = 0; i < kMaxIterations; ++i) {
-    (*mem_in_trailer)++;
-    MemoryAccessorTester tester;
-    tester.AssertMemoryErrorIsDetected(
-        check_access_fn, mem.get() + kAllocSize, HEAP_BUFFER_OVERFLOW);
-    EXPECT_TRUE(LogContains("previously allocated here"));
-    EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-
-    if (!tester.last_error_info().heap_is_corrupt &&
-          i + 1 < kMaxIterations)
-      continue;
-
-    EXPECT_TRUE(tester.last_error_info().heap_is_corrupt);
-
-    EXPECT_EQ(1, tester.last_error_info().corrupt_range_count);
-    EXPECT_EQ(1, tester.last_corrupt_ranges().size());
-    const AsanCorruptBlockRange* corrupt_range =
-        &tester.last_corrupt_ranges()[0].first;
-    const AsanBlockInfoVector* blocks_info =
-        &tester.last_corrupt_ranges()[0].second;
-
-    EXPECT_EQ(1, blocks_info->size());
-    EXPECT_TRUE((*blocks_info)[0]->corrupt);
-    EXPECT_EQ(kAllocSize, (*blocks_info)[0]->user_size);
-    EXPECT_EQ(block_info.header, (*blocks_info)[0]->header);
-    EXPECT_NE(0U, (*blocks_info)[0]->alloc_stack_size);
-    for (size_t j = 0; j < (*blocks_info)[0]->alloc_stack_size; ++j) {
-      EXPECT_NE(reinterpret_cast<void*>(NULL),
-                (*blocks_info)[0]->alloc_stack[j]);
-    }
-    EXPECT_EQ(0U, (*blocks_info)[0]->free_stack_size);
-
-    // An error should be triggered when we free this block.
-    tester.set_memory_error_detected(false);
-    tester.set_expected_error_type(CORRUPT_BLOCK);
-    mem.reset(NULL);
-    EXPECT_TRUE(tester.memory_error_detected());
-
-    break;
-  }
-}
-
-TEST_F(AsanRtlTest, AsanSingleSpecial1byteInstructionCheckGoodAccess) {
-  static const char* function_names[] = {
-      "asan_check_1_byte_movs_access",
-      "asan_check_1_byte_cmps_access",
-      "asan_check_1_byte_stos_access"
-  };
-
-  // Allocate memory space.
-  AllocMemoryBuffers(kAllocSize, sizeof(uint8));
-  uint8* src = reinterpret_cast<uint8*>(memory_src_);
-  uint8* dst = reinterpret_cast<uint8*>(memory_dst_);
-
-  // Validate memory accesses.
-  for (int32 function = 0; function < arraysize(function_names); ++function) {
-    FARPROC check_access_fn =
-        ::GetProcAddress(asan_rtl_, function_names[function]);
-    ASSERT_TRUE(check_access_fn != NULL);
-
-    for (int32 i = 0; i < memory_length_; ++i) {
-      MemoryAccessorTester tester;
-      tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        false, &dst[i], &src[i], 0xDEADDEAD,
-        UNKNOWN_BAD_ACCESS);
-    }
-  }
-
-  FreeMemoryBuffers();
-}
-
-TEST_F(AsanRtlTest, AsanSingleSpecial2byteInstructionCheckGoodAccess) {
-  static const char* function_names[] = {
-      "asan_check_2_byte_movs_access",
-      "asan_check_2_byte_cmps_access",
-      "asan_check_2_byte_stos_access"
-  };
-
-  // Allocate memory space.
-  AllocMemoryBuffers(kAllocSize, sizeof(uint16));
-  uint16* src = reinterpret_cast<uint16*>(memory_src_);
-  uint16* dst = reinterpret_cast<uint16*>(memory_dst_);
-
-  // Validate memory accesses.
-  for (int32 function = 0; function < arraysize(function_names); ++function) {
-    FARPROC check_access_fn =
-        ::GetProcAddress(asan_rtl_, function_names[function]);
-    ASSERT_TRUE(check_access_fn != NULL);
-
-    for (int32 i = 0; i < memory_length_; ++i) {
-      MemoryAccessorTester tester;
-      tester.ExpectSpecialMemoryErrorIsDetected(
-          check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-          false, &dst[i], &src[i], 0xDEADDEAD, UNKNOWN_BAD_ACCESS);
-    }
-  }
-
-  FreeMemoryBuffers();
-}
-
-TEST_F(AsanRtlTest, AsanSingleSpecial4byteInstructionCheckGoodAccess) {
-  static const char* function_names[] = {
-      "asan_check_4_byte_movs_access",
-      "asan_check_4_byte_cmps_access",
-      "asan_check_4_byte_stos_access"
-  };
-
-  // Allocate memory space.
-  AllocMemoryBuffers(kAllocSize, sizeof(uint32));
-  uint32* src = reinterpret_cast<uint32*>(memory_src_);
-  uint32* dst = reinterpret_cast<uint32*>(memory_dst_);
-
-  // Validate memory accesses.
-  for (int32 function = 0; function < arraysize(function_names); ++function) {
-    FARPROC check_access_fn =
-        ::GetProcAddress(asan_rtl_, function_names[function]);
-    ASSERT_TRUE(check_access_fn != NULL);
-
-    for (int32 i = 0; i < memory_length_; ++i) {
-      MemoryAccessorTester tester;
-      tester.ExpectSpecialMemoryErrorIsDetected(
-          check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-          false, &dst[i], &src[i], 0xDEADDEAD, UNKNOWN_BAD_ACCESS);
-    }
-  }
-
-  FreeMemoryBuffers();
-}
-
-TEST_F(AsanRtlTest, AsanSingleSpecialInstructionCheckBadAccess) {
-  static const char* function_names[] = {
-      "asan_check_1_byte_movs_access",
-      "asan_check_1_byte_cmps_access",
-      "asan_check_2_byte_movs_access",
-      "asan_check_2_byte_cmps_access",
-      "asan_check_4_byte_movs_access",
-      "asan_check_4_byte_cmps_access"
-  };
-
-  // Allocate memory space.
-  AllocMemoryBuffers(kAllocSize, sizeof(uint32));
-  uint32* src = reinterpret_cast<uint32*>(memory_src_);
-  uint32* dst = reinterpret_cast<uint32*>(memory_dst_);
-
-  // Validate memory accesses.
-  for (int32 function = 0; function < arraysize(function_names); ++function) {
-    FARPROC check_access_fn =
-        ::GetProcAddress(asan_rtl_, function_names[function]);
-    ASSERT_TRUE(check_access_fn != NULL);
-
-    MemoryAccessorTester tester;
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        true, &dst[0], &src[-1], 0xDEADDEAD, HEAP_BUFFER_UNDERFLOW);
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        true, &dst[-1], &src[0], 0xDEADDEAD, HEAP_BUFFER_UNDERFLOW);
-
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        true, &dst[0], &src[memory_length_], 0xDEADDEAD, HEAP_BUFFER_OVERFLOW);
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        true, &dst[memory_length_], &src[0], 0xDEADDEAD, HEAP_BUFFER_OVERFLOW);
-  }
-
-  FreeMemoryBuffers();
-}
-
-TEST_F(AsanRtlTest, AsanSingleStoInstructionCheckBadAccess) {
-  static const char* function_names[] = {
-      "asan_check_1_byte_stos_access",
-      "asan_check_2_byte_stos_access",
-      "asan_check_4_byte_stos_access"
-  };
-
-  // Allocate memory space.
-  AllocMemoryBuffers(kAllocSize, sizeof(uint32));
-  uint32* src = reinterpret_cast<uint32*>(memory_src_);
-  uint32* dst = reinterpret_cast<uint32*>(memory_dst_);
-
-  // Validate memory accesses.
-  for (int32 function = 0; function < arraysize(function_names); ++function) {
-    FARPROC check_access_fn =
-        ::GetProcAddress(asan_rtl_, function_names[function]);
-    ASSERT_TRUE(check_access_fn != NULL);
-
-    MemoryAccessorTester tester;
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        false, &dst[0], &src[-1], 0xDEAD, HEAP_BUFFER_UNDERFLOW);
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        true, &dst[-1], &src[0], 0xDEAD, HEAP_BUFFER_UNDERFLOW);
-
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        false, &dst[0], &src[memory_length_], 0xDEADDEAD, HEAP_BUFFER_OVERFLOW);
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        true, &dst[memory_length_], &src[0], 0xDEADDEAD, HEAP_BUFFER_OVERFLOW);
-  }
-
-  FreeMemoryBuffers();
-}
-
-TEST_F(AsanRtlTest, AsanPrefixedSpecialInstructionCheckGoodAccess) {
-  static const char* function_names[] = {
-      "asan_check_repz_4_byte_movs_access",
-      "asan_check_repz_4_byte_cmps_access",
-      "asan_check_repz_4_byte_stos_access"
-  };
-
-  // Allocate memory space.
-  AllocMemoryBuffers(kAllocSize, sizeof(uint32));
-  uint32* src = reinterpret_cast<uint32*>(memory_src_);
-  uint32* dst = reinterpret_cast<uint32*>(memory_dst_);
-
-  // Validate memory accesses.
-  for (int32 function = 0; function < arraysize(function_names); ++function) {
-    FARPROC check_access_fn =
-        ::GetProcAddress(asan_rtl_, function_names[function]);
-    ASSERT_TRUE(check_access_fn != NULL);
-
-    MemoryAccessorTester tester;
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        false, &dst[0], &src[0], memory_length_, UNKNOWN_BAD_ACCESS);
-  }
-
-  FreeMemoryBuffers();
-}
-
-TEST_F(AsanRtlTest, AsanPrefixedSpecialInstructionCheckBadAccess) {
-  static const char* function_names[] = {
-      "asan_check_repz_4_byte_movs_access",
-      "asan_check_repz_4_byte_cmps_access",
-      "asan_check_repz_4_byte_stos_access"
-  };
-
-  // Allocate memory space.
-  AllocMemoryBuffers(kAllocSize, sizeof(uint32));
-  uint32* src = reinterpret_cast<uint32*>(memory_src_);
-  uint32* dst = reinterpret_cast<uint32*>(memory_dst_);
-
-  // Validate memory accesses.
-  for (int32 function = 0; function < arraysize(function_names); ++function) {
-    FARPROC check_access_fn =
-        ::GetProcAddress(asan_rtl_, function_names[function]);
-    ASSERT_TRUE(check_access_fn != NULL);
-
-    MemoryAccessorTester tester;
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        true, &dst[0], &src[0], memory_length_ + 1, HEAP_BUFFER_OVERFLOW);
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        true, &dst[-1], &src[-1], memory_length_, HEAP_BUFFER_UNDERFLOW);
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        true, &dst[-1], &src[0], memory_length_, HEAP_BUFFER_UNDERFLOW);
-  }
-
-  FreeMemoryBuffers();
-}
-
-TEST_F(AsanRtlTest, AsanDirectionSpecialInstructionCheckGoodAccess) {
-  static const char* function_names[] = {
-      "asan_check_repz_4_byte_movs_access",
-      "asan_check_repz_4_byte_cmps_access",
-      "asan_check_repz_4_byte_stos_access"
-  };
-
-  // Allocate memory space.
-  AllocMemoryBuffers(kAllocSize, sizeof(uint32));
-  uint32* src = reinterpret_cast<uint32*>(memory_src_);
-  uint32* dst = reinterpret_cast<uint32*>(memory_dst_);
-
-  // Validate memory accesses.
-  for (int32 function = 0; function < arraysize(function_names); ++function) {
-    FARPROC check_access_fn =
-        ::GetProcAddress(asan_rtl_, function_names[function]);
-    ASSERT_TRUE(check_access_fn != NULL);
-
-    MemoryAccessorTester tester;
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_BACKWARD,
-        false, &dst[memory_length_ - 1],
-        &src[memory_length_ - 1], memory_length_,
-        UNKNOWN_BAD_ACCESS);
-  }
-
-  FreeMemoryBuffers();
-}
-
-TEST_F(AsanRtlTest, AsanSpecialInstructionCheckZeroAccess) {
-  static const char* function_names[] = {
-      "asan_check_repz_1_byte_movs_access",
-      "asan_check_repz_1_byte_cmps_access",
-      "asan_check_repz_1_byte_stos_access",
-      "asan_check_repz_2_byte_movs_access",
-      "asan_check_repz_2_byte_cmps_access",
-      "asan_check_repz_2_byte_stos_access",
-      "asan_check_repz_4_byte_movs_access",
-      "asan_check_repz_4_byte_cmps_access",
-      "asan_check_repz_4_byte_stos_access"
-  };
-
-  // Allocate memory space.
-  AllocMemoryBuffers(kAllocSize, sizeof(uint32));
-  uint32* src = reinterpret_cast<uint32*>(memory_src_);
-  uint32* dst = reinterpret_cast<uint32*>(memory_dst_);
-
-  // Validate memory accesses.
-  for (int32 function = 0; function < arraysize(function_names); ++function) {
-    FARPROC check_access_fn =
-        ::GetProcAddress(asan_rtl_, function_names[function]);
-    ASSERT_TRUE(check_access_fn != NULL);
-
-    // A prefixed instruction with a count of zero do not have side effects.
-    MemoryAccessorTester tester;
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        false, &dst[-1], &src[-1], 0, UNKNOWN_BAD_ACCESS);
-  }
-
-  FreeMemoryBuffers();
-}
-
-TEST_F(AsanRtlTest, AsanSpecialInstructionCheckShortcutAccess) {
-  static const char* function_names[] = {
-      "asan_check_repz_1_byte_cmps_access",
-      "asan_check_repz_2_byte_cmps_access",
-      "asan_check_repz_4_byte_cmps_access",
-  };
-
-  // Allocate memory space.
-  AllocMemoryBuffers(kAllocSize, sizeof(uint32));
-  uint32* src = reinterpret_cast<uint32*>(memory_src_);
-  uint32* dst = reinterpret_cast<uint32*>(memory_dst_);
-
-  src[1] = 0x12345667;
-
-  // Validate memory accesses.
-  for (int32 function = 0; function < arraysize(function_names); ++function) {
-    FARPROC check_access_fn =
-        ::GetProcAddress(asan_rtl_, function_names[function]);
-    ASSERT_TRUE(check_access_fn != NULL);
-
-    // Compare instruction stop their execution when values differ.
-    MemoryAccessorTester tester;
-    tester.ExpectSpecialMemoryErrorIsDetected(
-        check_access_fn, MemoryAccessorTester::DIRECTION_FORWARD,
-        false, &dst[0], &src[0], memory_length_ + 1, UNKNOWN_BAD_ACCESS);
-  }
-
-  FreeMemoryBuffers();
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/asan_rtl_unittests_main.cc b/syzygy/agent/asan/asan_rtl_unittests_main.cc
deleted file mode 100644
index 8824827..0000000
--- a/syzygy/agent/asan/asan_rtl_unittests_main.cc
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2012 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-#include "base/at_exit.h"
-#include "base/command_line.h"
-#include "gtest/gtest.h"
-
-int main(int argc, char** argv) {
-  testing::InitGoogleTest(&argc, argv);
-
-  CommandLine::Init(argc, argv);
-  base::AtExitManager at_exit;
-  return RUN_ALL_TESTS();
-}
diff --git a/syzygy/agent/asan/asan_rtl_utils.cc b/syzygy/agent/asan/asan_rtl_utils.cc
deleted file mode 100644
index f319869..0000000
--- a/syzygy/agent/asan/asan_rtl_utils.cc
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/asan_rtl_utils.h"
-
-#include "base/bind.h"
-#include "base/callback.h"
-#include "base/logging.h"
-#include "base/debug/alias.h"
-#include "base/memory/scoped_ptr.h"
-#include "syzygy/agent/asan/asan_heap_checker.h"
-#include "syzygy/agent/asan/asan_runtime.h"
-#include "syzygy/agent/asan/shadow.h"
-#include "syzygy/agent/asan/stack_capture.h"
-#include "syzygy/agent/common/scoped_last_error_keeper.h"
-
-namespace {
-
-// The asan runtime manager.
-agent::asan::AsanRuntime* asan_runtime = NULL;
-
-}  // namespace
-
-namespace agent {
-namespace asan {
-
-void SetAsanRuntimeInstance(AsanRuntime* runtime) {
-  asan_runtime = runtime;
-}
-
-void ReportBadMemoryAccess(void* location,
-                           AccessMode access_mode,
-                           size_t access_size,
-                           const AsanContext& asan_context) {
-  // Capture the context and restore the value of the register as before calling
-  // the asan hook.
-
-  // Save the last error value so this function will be able to restore it.
-  agent::common::ScopedLastErrorKeeper scoped_last_error_keeper;
-
-  // We keep a structure with all the useful information about this bad access
-  // on the stack.
-  AsanErrorInfo bad_access_info = {};
-
-  // We need to call ::RtlCaptureContext if we want SegSS and SegCS to be
-  // properly set.
-  ::RtlCaptureContext(&bad_access_info.context);
-  bad_access_info.context.ContextFlags = CONTEXT_INTEGER | CONTEXT_CONTROL;
-
-  // Restore the original value of the registers.
-  bad_access_info.context.Eip = asan_context.original_eip;
-  bad_access_info.context.Eax = asan_context.original_eax;
-  bad_access_info.context.Ecx = asan_context.original_ecx;
-  bad_access_info.context.Edx = asan_context.original_edx;
-  bad_access_info.context.Ebx = asan_context.original_ebx;
-  bad_access_info.context.Ebp = asan_context.original_ebp;
-  bad_access_info.context.Esp = asan_context.original_esp;
-  bad_access_info.context.Esi = asan_context.original_esi;
-  bad_access_info.context.Edi = asan_context.original_edi;
-  bad_access_info.context.EFlags = asan_context.original_eflags;
-
-  StackCapture stack;
-  stack.InitFromStack();
-  // We need to compute a relative stack id so that for the same stack trace
-  // we'll get the same value every time even if the modules are loaded at a
-  // different base address.
-  stack.set_stack_id(stack.ComputeRelativeStackId());
-
-  // Check if we can ignore this error.
-  if (asan_runtime->ShouldIgnoreError(stack.stack_id()))
-    return;
-
-  bad_access_info.crash_stack_id = stack.stack_id();
-  bad_access_info.location = location;
-  bad_access_info.access_mode = access_mode;
-  bad_access_info.access_size = access_size;
-  bad_access_info.alloc_stack_size = 0U;
-  bad_access_info.alloc_tid = 0U;
-  bad_access_info.error_type = UNKNOWN_BAD_ACCESS;
-  bad_access_info.free_stack_size = 0U;
-  bad_access_info.free_tid = 0U;
-  bad_access_info.milliseconds_since_free = 0U;
-  bad_access_info.corrupt_ranges = NULL;
-  bad_access_info.corrupt_range_count = 0;
-
-  // Make sure this structure is not optimized out.
-  base::debug::Alias(&bad_access_info);
-
-  // TODO(sebmarchand): Check if the heap is corrupt and store the information
-  //     about the corrupt blocks if it's the case.
-  bad_access_info.heap_is_corrupt = false;
-
-  asan_runtime->GetBadAccessInformation(&bad_access_info);
-
-  // Report this error.
-  asan_runtime->OnError(&bad_access_info);
-}
-
-void ContextToAsanContext(const CONTEXT& context, AsanContext* asan_context) {
-  DCHECK(asan_context != NULL);
-  asan_context->original_eax = context.Eax;
-  asan_context->original_ebp = context.Ebp;
-  asan_context->original_ebx = context.Ebx;
-  asan_context->original_ecx = context.Ecx;
-  asan_context->original_edi = context.Edi;
-  asan_context->original_edx = context.Edx;
-  asan_context->original_eflags = context.EFlags;
-  asan_context->original_eip = context.Eip;
-  asan_context->original_esi = context.Esi;
-  asan_context->original_esp = context.Esp;
-}
-
-void ReportBadAccess(const uint8* location, AccessMode access_mode) {
-  AsanContext asan_context = {};
-  CONTEXT context = {};
-  ::RtlCaptureContext(&context);
-  ContextToAsanContext(context, &asan_context);
-  ReportBadMemoryAccess(const_cast<uint8*>(location),
-                        access_mode,
-                        1U,
-                        asan_context);
-}
-
-void TestMemoryRange(const uint8* memory,
-                     size_t size,
-                     AccessMode access_mode) {
-  if (size == 0U)
-    return;
-  // TODO(sebmarchand): This approach is pretty limited because it only checks
-  //     if the first and the last elements are accessible. Once we have the
-  //     plumbing in place we should benchmark a check that looks at each
-  //     address to be touched (via the shadow memory, 8 bytes at a time).
-  if (!Shadow::IsAccessible(memory) ||
-      !Shadow::IsAccessible(memory + size - 1)) {
-    const uint8* location = NULL;
-    if (!Shadow::IsAccessible(memory)) {
-      location = memory;
-    } else {
-      location = memory + size - 1;
-    }
-    ReportBadAccess(location, access_mode);
-  }
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/asan_rtl_utils.h b/syzygy/agent/asan/asan_rtl_utils.h
deleted file mode 100644
index 2cd4f5b..0000000
--- a/syzygy/agent/asan/asan_rtl_utils.h
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Utility functions used by the ASan check functions..
-#ifndef SYZYGY_AGENT_ASAN_ASAN_RTL_UTILS_H_
-#define SYZYGY_AGENT_ASAN_ASAN_RTL_UTILS_H_
-
-#include <windows.h>
-
-#include "syzygy/agent/asan/error_info.h"
-
-namespace agent {
-namespace asan {
-
-// Forward declarations.
-class AsanRuntime;
-
-// Contents of the registers before calling the ASAN memory check function.
-#pragma pack(push, 1)
-struct AsanContext {
-  DWORD original_edi;
-  DWORD original_esi;
-  DWORD original_ebp;
-  DWORD original_esp;
-  DWORD original_ebx;
-  DWORD original_edx;
-  DWORD original_ecx;
-  DWORD original_eax;
-  DWORD original_eflags;
-  DWORD original_eip;
-};
-#pragma pack(pop)
-
-// Set the AsanRuntime instance that should be used to report the crash.
-// @param runtime The runtime instance to use.
-void SetAsanRuntimeInstance(AsanRuntime* runtime);
-
-// Convert a CONTEXT struct to an ASan context.
-// @param context The context to convert.
-// @param asan_context Receives the ASan context.
-void ContextToAsanContext(const CONTEXT& context, AsanContext* asan_context);
-
-// Report a bad access to the memory.
-// @param location The memory address of the access.
-// @param access_mode The mode of the access.
-// @param access_size The size of the access.
-// @param asan_context The context of the access.
-void ReportBadMemoryAccess(void* location,
-                           AccessMode access_mode,
-                           size_t access_size,
-                           const AsanContext& asan_context);
-
-// Report an invalid access to @p location.
-// @param location The memory address of the access.
-// @param access_mode The mode of the access.
-void ReportBadAccess(const uint8* location, AccessMode access_mode);
-
-// Test that a memory range is accessible. Report an error if it's not.
-// @param memory The pointer to the beginning of the memory range that we want
-//     to check.
-// @param size The size of the memory range that we want to check.
-// @param access_mode The access mode.
-void TestMemoryRange(const uint8* memory,
-                     size_t size,
-                     AccessMode access_mode);
-
-// Helper function to test if the memory range of a given structure is
-// accessible.
-// @tparam T the type of the structure to be tested.
-// @param structure A pointer to this structure.
-// @param access mode The access mode.
-template <typename T>
-void TestStructure(const T* structure, AccessMode access_mode) {
-  TestMemoryRange(reinterpret_cast<const uint8*>(structure),
-                  sizeof(T),
-                  access_mode);
-}
-
-}  // namespace asan
-}  // namespace agent
-
-
-#endif  // SYZYGY_AGENT_ASAN_ASAN_RTL_UTILS_H_
diff --git a/syzygy/agent/asan/asan_rtl_utils_unittest.cc b/syzygy/agent/asan/asan_rtl_utils_unittest.cc
deleted file mode 100644
index 7b1ebdd..0000000
--- a/syzygy/agent/asan/asan_rtl_utils_unittest.cc
+++ /dev/null
@@ -1,165 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/asan_rtl_utils.h"
-
-#include <windows.h>
-
-#include "base/bind.h"
-#include "base/rand_util.h"
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/asan_runtime.h"
-#include "syzygy/agent/asan/shadow.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-using agent::asan::Shadow;
-
-// A flag used in asan callback to ensure that a memory error has been detected.
-bool memory_error_detected = false;
-// Will save the information about the last ASan error.
-AsanErrorInfo last_error_info = {};
-
-void AsanErrorCallBack(AsanErrorInfo* error_info) {
-  EXPECT_NE(reinterpret_cast<AsanErrorInfo*>(NULL), error_info);
-  memory_error_detected = true;
-  last_error_info = *error_info;
-}
-
-class TestAsanRuntime : public AsanRuntime {
- public:
-  TestAsanRuntime() {
-    memory_error_detected = false;
-    SetUp(L"");
-    SetErrorCallBack(base::Bind(AsanErrorCallBack));
-  }
-
-  ~TestAsanRuntime() {
-    TearDown();
-  }
-};
-
-}  // namespace
-
-TEST(AsanRtlUtilsTest, ContextToAsanContext) {
-  CONTEXT context = {};
-  AsanContext asan_context = {};
-  base::RandBytes(reinterpret_cast<void*>(&context), sizeof(context));
-  ContextToAsanContext(context, &asan_context);
-
-  EXPECT_EQ(context.Eax, asan_context.original_eax);
-  EXPECT_EQ(context.Ebp, asan_context.original_ebp);
-  EXPECT_EQ(context.Ebx, asan_context.original_ebx);
-  EXPECT_EQ(context.Ecx, asan_context.original_ecx);
-  EXPECT_EQ(context.Edi, asan_context.original_edi);
-  EXPECT_EQ(context.Edx, asan_context.original_edx);
-  EXPECT_EQ(context.Eip, asan_context.original_eip);
-  EXPECT_EQ(context.Esi, asan_context.original_esi);
-  EXPECT_EQ(context.Esp, asan_context.original_esp);
-  EXPECT_EQ(context.EFlags, asan_context.original_eflags);
-}
-
-TEST(AsanRtlUtilsTest, ReportBadMemoryAccess) {
-  TestAsanRuntime runtime;
-  SetAsanRuntimeInstance(&runtime);
-  void* bad_location = reinterpret_cast<void*>(0xBAD0ADD5);
-  AccessMode access_mode = ASAN_READ_ACCESS;
-  size_t access_size = 4;
-  AsanContext asan_context = {};
-  base::RandBytes(reinterpret_cast<void*>(&asan_context), sizeof(asan_context));
-  ReportBadMemoryAccess(bad_location, access_mode, access_size, asan_context);
-
-  EXPECT_TRUE(memory_error_detected);
-  EXPECT_EQ(bad_location, last_error_info.location);
-  EXPECT_EQ(access_size, last_error_info.access_size);
-  EXPECT_EQ(access_mode, last_error_info.access_mode);
-  EXPECT_EQ(asan_context.original_eax, last_error_info.context.Eax);
-  EXPECT_EQ(asan_context.original_ebp, last_error_info.context.Ebp);
-  EXPECT_EQ(asan_context.original_ebx, last_error_info.context.Ebx);
-  EXPECT_EQ(asan_context.original_ecx, last_error_info.context.Ecx);
-  EXPECT_EQ(asan_context.original_edi, last_error_info.context.Edi);
-  EXPECT_EQ(asan_context.original_edx, last_error_info.context.Edx);
-  EXPECT_EQ(asan_context.original_eip, last_error_info.context.Eip);
-  EXPECT_EQ(asan_context.original_esi, last_error_info.context.Esi);
-  EXPECT_EQ(asan_context.original_esp, last_error_info.context.Esp);
-  EXPECT_EQ(asan_context.original_eflags, last_error_info.context.EFlags);
-}
-
-TEST(AsanRtlUtilsTest, ReportBadAccess) {
-  TestAsanRuntime runtime;
-  SetAsanRuntimeInstance(&runtime);
-  uint8* bad_location = reinterpret_cast<uint8*>(0xBAD0ADD5);
-  AccessMode access_mode = ASAN_READ_ACCESS;
-  ReportBadAccess(bad_location, access_mode);
-
-  EXPECT_TRUE(memory_error_detected);
-  EXPECT_EQ(bad_location, last_error_info.location);
-  EXPECT_EQ(access_mode, last_error_info.access_mode);
-}
-
-TEST(AsanRtlUtilsTest, TestMemoryRange) {
-  TestAsanRuntime runtime;
-  SetAsanRuntimeInstance(&runtime);
-  AccessMode access_mode = ASAN_READ_ACCESS;
-  const size_t kTestBufferSize = 64;
-  scoped_ptr<uint8> test_buffer(new uint8[kTestBufferSize]);
-
-  TestMemoryRange(test_buffer.get(), kTestBufferSize, access_mode);
-  EXPECT_FALSE(memory_error_detected);
-
-  // Poison the second half of the buffer.
-  Shadow::Poison(test_buffer.get() + kTestBufferSize / 2,
-                 kTestBufferSize / 2,
-                 kUserRedzoneMarker);
-
-  // Test the first half of the buffer, no error should be detected.
-  TestMemoryRange(test_buffer.get(), kTestBufferSize / 2, access_mode);
-  EXPECT_FALSE(memory_error_detected);
-
-  // Test the second half of the buffer, we should get an invalid access on its
-  // last byte.
-  TestMemoryRange(test_buffer.get(), kTestBufferSize, access_mode);
-  EXPECT_TRUE(memory_error_detected);
-  EXPECT_EQ(test_buffer.get() + kTestBufferSize - 1, last_error_info.location);
-  EXPECT_EQ(access_mode, last_error_info.access_mode);
-
-  Shadow::Unpoison(test_buffer.get(), kTestBufferSize);
-}
-
-TEST(AsanRtlUtilsTest, TestStructure) {
-  TestAsanRuntime runtime;
-  SetAsanRuntimeInstance(&runtime);
-  AccessMode access_mode = ASAN_READ_ACCESS;
-  scoped_ptr<double> test_struct(new double);
-
-  TestStructure(test_struct.get(), access_mode);
-  EXPECT_FALSE(memory_error_detected);
-
-  Shadow::Poison(test_struct.get(),
-                 sizeof(double),
-                 kUserRedzoneMarker);
-
-  TestStructure(test_struct.get(), access_mode);
-  EXPECT_TRUE(memory_error_detected);
-  EXPECT_EQ(test_struct.get(), last_error_info.location);
-  EXPECT_EQ(access_mode, last_error_info.access_mode);
-
-  Shadow::Unpoison(test_struct.get(), sizeof(double));
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/asan_runtime.cc b/syzygy/agent/asan/asan_runtime.cc
deleted file mode 100644
index 587d5a7..0000000
--- a/syzygy/agent/asan/asan_runtime.cc
+++ /dev/null
@@ -1,814 +0,0 @@
-// Copyright 2012 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/asan_runtime.h"
-
-#include <algorithm>
-#include <vector>
-
-#include "base/bind.h"
-#include "base/command_line.h"
-#include "base/environment.h"
-#include "base/logging.h"
-#include "base/strings/stringprintf.h"
-#include "base/strings/sys_string_conversions.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/win/pe_image.h"
-#include "base/win/wrapped_window_proc.h"
-#include "syzygy/agent/asan/asan_heap_checker.h"
-#include "syzygy/agent/asan/asan_logger.h"
-#include "syzygy/agent/asan/block.h"
-#include "syzygy/agent/asan/shadow.h"
-#include "syzygy/agent/asan/stack_capture_cache.h"
-#include "syzygy/agent/asan/windows_heap_adapter.h"
-#include "syzygy/trace/client/client_utils.h"
-#include "syzygy/trace/protocol/call_trace_defs.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-using agent::asan::AsanLogger;
-using agent::asan::StackCaptureCache;
-using agent::asan::WindowsHeapAdapter;
-using base::win::WinProcExceptionFilter;
-
-// Signatures of the various Breakpad functions for setting custom crash
-// key-value pairs.
-// Post r194002.
-typedef void (__cdecl * SetCrashKeyValuePairPtr)(const char*, const char*);
-// Post r217590.
-typedef void (__cdecl * SetCrashKeyValueImplPtr)(const wchar_t*,
-                                                 const wchar_t*);
-
-// Collects the various Breakpad-related exported functions.
-struct BreakpadFunctions {
-  // The Breakpad crash reporting entry point.
-  WinProcExceptionFilter crash_for_exception_ptr;
-
-  // Various flavours of the custom key-value setting function. The version
-  // exported depends on the version of Chrome. It is possible for both of these
-  // to be NULL even if crash_for_exception_ptr is not NULL.
-  SetCrashKeyValuePairPtr set_crash_key_value_pair_ptr;
-  SetCrashKeyValueImplPtr set_crash_key_value_impl_ptr;
-};
-
-// The static breakpad functions. All runtimes share these. This is under
-// AsanRuntime::lock_.
-BreakpadFunctions breakpad_functions = {};
-
-// A custom exception code we use to indicate that the exception originated
-// from ASan, and shouldn't be processed again by our unhandled exception
-// handler. This value has been created according to the rules here:
-// http://msdn.microsoft.com/en-us/library/windows/hardware/ff543026(v=vs.85).aspx
-// See winerror.h for more details.
-static const DWORD kAsanFacility = 0x68B;  // No more than 11 bits.
-static const DWORD kAsanStatus = 0x5AD0;  // No more than 16 bits.
-static const DWORD kAsanException =
-    (3 << 30) |  // Severity = error.
-    (1 << 29) |  // Customer defined code (not defined by MS).
-    (kAsanFacility << 16) |  // Facility code.
-    kAsanStatus;  // Status code.
-COMPILE_ASSERT((kAsanFacility >> 11) == 0, too_many_facility_bits);
-COMPILE_ASSERT((kAsanStatus >> 16) == 0, too_many_status_bits);
-COMPILE_ASSERT((kAsanException & (3 << 27)) == 0,
-               bits_27_and_28_must_be_clear);
-
-// Raises an exception, first wrapping it an ASan specific exception. This
-// indicates to our unhandled exception handler that it doesn't need to
-// process the exception.
-void RaiseFilteredException(
-    DWORD code, DWORD flags, DWORD num_args, const ULONG_PTR* args) {
-  // Retain the original arguments and craft a new exception.
-  const ULONG_PTR arguments[4] = {
-      code, flags, num_args, reinterpret_cast<const ULONG_PTR>(args) };
-  ::RaiseException(kAsanException, 0, ARRAYSIZE(arguments), arguments);
-}
-
-// The default error handler. It is expected that this will be bound in a
-// callback in the ASan runtime.
-// @param context The context when the error has been reported.
-// @param error_info The information about this error.
-void DefaultErrorHandler(AsanErrorInfo* error_info) {
-  DCHECK_NE(reinterpret_cast<AsanErrorInfo*>(NULL), error_info);
-
-  ULONG_PTR arguments[] = {
-    reinterpret_cast<ULONG_PTR>(&error_info->context),
-    reinterpret_cast<ULONG_PTR>(error_info)
-  };
-
-  ::DebugBreak();
-
-  // This raises an error in such a way that the ASan unhandled exception
-  // handler will not process it.
-  RaiseFilteredException(EXCEPTION_ARRAY_BOUNDS_EXCEEDED,
-                         0,
-                         ARRAYSIZE(arguments),
-                         arguments);
-}
-
-// Returns the breakpad crash reporting functions if breakpad is enabled for
-// the current executable.
-//
-// If we're running in the context of a breakpad enabled binary we can
-// report errors directly via that breakpad entry-point. This allows us
-// to report the exact context of the error without including the ASan RTL
-// in crash context, depending on where and when we capture the context.
-//
-// @param breakpad_functions The Breakpad functions structure to be populated.
-// @returns true if we found breakpad functions, false otherwise.
-bool GetBreakpadFunctions(BreakpadFunctions* breakpad_functions) {
-  DCHECK_NE(reinterpret_cast<BreakpadFunctions*>(NULL), breakpad_functions);
-
-  // Clear the structure.
-  ::memset(breakpad_functions, 0, sizeof(*breakpad_functions));
-
-  // The named entry-point exposed to report a crash.
-  static const char kCrashHandlerSymbol[] = "CrashForException";
-
-  // The named entry-point exposed to annotate a crash with a key/value pair.
-  static const char kSetCrashKeyValuePairSymbol[] = "SetCrashKeyValuePair";
-  static const char kSetCrashKeyValueImplSymbol[] = "SetCrashKeyValueImpl";
-
-  // Get a handle to the current executable image.
-  HMODULE exe_hmodule = ::GetModuleHandle(NULL);
-
-  // Lookup the crash handler symbol.
-  breakpad_functions->crash_for_exception_ptr =
-      reinterpret_cast<WinProcExceptionFilter>(
-          ::GetProcAddress(exe_hmodule, kCrashHandlerSymbol));
-  if (breakpad_functions->crash_for_exception_ptr == NULL)
-    return false;
-
-  // Lookup the crash annotation symbol.
-  breakpad_functions->set_crash_key_value_pair_ptr =
-      reinterpret_cast<SetCrashKeyValuePairPtr>(
-          ::GetProcAddress(exe_hmodule, kSetCrashKeyValuePairSymbol));
-  breakpad_functions->set_crash_key_value_impl_ptr =
-      reinterpret_cast<SetCrashKeyValueImplPtr>(
-          ::GetProcAddress(exe_hmodule, kSetCrashKeyValueImplSymbol));
-
-  return true;
-}
-
-// Sets a crash key using the given breakpad function.
-void SetCrashKeyValuePair(const BreakpadFunctions& breakpad_functions,
-                          const char* key,
-                          const char* value) {
-  if (breakpad_functions.set_crash_key_value_pair_ptr != NULL) {
-    breakpad_functions.set_crash_key_value_pair_ptr(key, value);
-    return;
-  }
-
-  if (breakpad_functions.set_crash_key_value_impl_ptr != NULL) {
-    std::wstring wkey = base::UTF8ToWide(key);
-    std::wstring wvalue = base::UTF8ToWide(value);
-    breakpad_functions.set_crash_key_value_impl_ptr(wkey.c_str(),
-                                                    wvalue.c_str());
-    return;
-  }
-
-  return;
-}
-
-// Writes the appropriate crash keys for the given error.
-void SetCrashKeys(const BreakpadFunctions& breakpad_functions,
-                  AsanErrorInfo* error_info) {
-  DCHECK(breakpad_functions.crash_for_exception_ptr != NULL);
-  DCHECK(error_info != NULL);
-
-  SetCrashKeyValuePair(breakpad_functions,
-                       "asan-error-type",
-                       ErrorInfoAccessTypeToStr(error_info->error_type));
-
-  if (error_info->shadow_info[0] != '\0') {
-    SetCrashKeyValuePair(breakpad_functions,
-                         "asan-error-message",
-                         error_info->shadow_info);
-  }
-}
-
-// The breakpad error handler. It is expected that this will be bound in a
-// callback in the ASan runtime.
-// @param breakpad_functions A struct containing pointers to the various
-//     Breakpad reporting functions.
-// @param error_info The information about this error.
-void BreakpadErrorHandler(const BreakpadFunctions& breakpad_functions,
-                          AsanErrorInfo* error_info) {
-  DCHECK(breakpad_functions.crash_for_exception_ptr != NULL);
-  DCHECK(error_info != NULL);
-
-  SetCrashKeys(breakpad_functions, error_info);
-
-  EXCEPTION_RECORD exception = {};
-  exception.ExceptionCode = EXCEPTION_ARRAY_BOUNDS_EXCEEDED;
-  exception.ExceptionAddress = reinterpret_cast<PVOID>(
-      error_info->context.Eip);
-  exception.NumberParameters = 2;
-  exception.ExceptionInformation[0] = reinterpret_cast<ULONG_PTR>(
-      &error_info->context);
-  exception.ExceptionInformation[1] = reinterpret_cast<ULONG_PTR>(error_info);
-
-  EXCEPTION_POINTERS pointers = { &exception, &error_info->context };
-  breakpad_functions.crash_for_exception_ptr(&pointers);
-  NOTREACHED();
-}
-
-// A helper function to find if an intrusive list contains a given entry.
-// @param list The list in which we want to look for the entry.
-// @param item The entry we want to look for.
-// @returns true if the list contains this entry, false otherwise.
-bool HeapListContainsEntry(const LIST_ENTRY* list, const LIST_ENTRY* item) {
-  LIST_ENTRY* current = list->Flink;
-  while (current != NULL) {
-    LIST_ENTRY* next_item = NULL;
-    if (current->Flink != list) {
-      next_item = current->Flink;
-    }
-
-    if (current == item) {
-      return true;
-    }
-
-    current = next_item;
-  }
-  return false;
-}
-
-// Check if the current process is large address aware.
-// @returns true if it is, false otherwise.
-bool CurrentProcessIsLargeAddressAware() {
-  const base::win::PEImage image(::GetModuleHandle(NULL));
-
-  bool process_is_large_address_aware =
-    (image.GetNTHeaders()->FileHeader.Characteristics &
-        IMAGE_FILE_LARGE_ADDRESS_AWARE) != 0;
-
-  return process_is_large_address_aware;
-}
-
-// A helper function to send a command to Windbg. Windbg should first receive
-// the ".ocommand ASAN" command to treat those messages as commands.
-void ASANDbgCmd(const wchar_t* fmt, ...) {
-  if (!base::debug::BeingDebugged())
-    return;
-  // The string should start with "ASAN" to be interpreted by the debugger as a
-  // command.
-  std::wstring command_wstring = L"ASAN ";
-  va_list args;
-  va_start(args, fmt);
-
-  // Append the actual command to the wstring.
-  base::StringAppendV(&command_wstring, fmt, args);
-
-  // Append "; g" to make sure that the debugger continues its execution after
-  // executing this command. This is needed because when the .ocommand function
-  // is used under Windbg the debugger will break on OutputDebugString.
-  command_wstring.append(L"; g");
-
-  OutputDebugString(command_wstring.c_str());
-}
-
-// A helper function to print a message to Windbg's console.
-void ASANDbgMessage(const wchar_t* fmt, ...) {
-  if (!base::debug::BeingDebugged())
-    return;
-  // Prepend the message with the .echo command so it'll be printed into the
-  // debugger's console.
-  std::wstring message_wstring = L".echo ";
-  va_list args;
-  va_start(args, fmt);
-
-  // Append the actual message to the wstring.
-  base::StringAppendV(&message_wstring, fmt, args);
-
-  // Treat the message as a command to print it.
-  ASANDbgCmd(message_wstring.c_str());
-}
-
-// Switch to the caller's context and print its stack trace in Windbg.
-void ASANDbgPrintContext(const CONTEXT& context) {
-  if (!base::debug::BeingDebugged())
-    return;
-  ASANDbgMessage(L"Caller's context (%p) and stack trace:", &context);
-  ASANDbgCmd(L".cxr %p; kv", reinterpret_cast<uint32>(&context));
-}
-
-// Returns the maximum allocation size that can be made safely. This leaves
-// space for child function frames, ideally enough for Breakpad to do its
-// work.
-size_t MaxSafeAllocaSize() {
-  // We leave 5KB of stack space for Breakpad and other crash reporting
-  // machinery.
-  const size_t kReservedStack = 5 * 1024;
-
-  // Find the base of the stack.
-  MEMORY_BASIC_INFORMATION mbi = {};
-  void* stack = &mbi;
-  if (VirtualQuery(stack, &mbi, sizeof(mbi)) == 0)
-    return 0;
-  size_t max_size = reinterpret_cast<uint8*>(stack) -
-      reinterpret_cast<uint8*>(mbi.AllocationBase);
-  max_size -= std::min(max_size, kReservedStack);
-  return max_size;
-}
-
-// Performs a dynamic stack allocation of at most |size| bytes. Sets the actual
-// size of the allocation and the pointer to it by modifying |size| and |result|
-// directly.
-#define SAFE_ALLOCA(size, result) {  \
-    size_t max_size = MaxSafeAllocaSize();  \
-    size = std::min(size, max_size);  \
-    result = _alloca(size);  \
-    if (result == NULL)  \
-      size = 0;  \
-  }
-
-}  // namespace
-
-const char AsanRuntime::kSyzygyAsanOptionsEnvVar[] = "SYZYGY_ASAN_OPTIONS";
-
-base::Lock AsanRuntime::lock_;
-AsanRuntime* AsanRuntime::runtime_ = NULL;
-LPTOP_LEVEL_EXCEPTION_FILTER AsanRuntime::previous_uef_ = NULL;
-bool AsanRuntime::uef_installed_ = false;
-
-AsanRuntime::AsanRuntime()
-    : logger_(), stack_cache_(), asan_error_callback_(), heap_manager_() {
-  common::SetDefaultAsanParameters(&params_);
-}
-
-AsanRuntime::~AsanRuntime() {
-}
-
-void AsanRuntime::SetUp(const std::wstring& flags_command_line) {
-  base::AutoLock auto_lock(lock_);
-  DCHECK(!runtime_);
-  runtime_ = this;
-
-  // Ensure that the current process is not large address aware. It shouldn't be
-  // because the shadow memory assume that the process will only be able to use
-  // 2GB of address space.
-  CHECK(!CurrentProcessIsLargeAddressAware());
-
-  // Initialize the command-line structures. This is needed so that
-  // SetUpLogger() can include the command-line in the message announcing
-  // this process. Note: this is mostly for debugging purposes.
-  CommandLine::Init(0, NULL);
-
-  Shadow::SetUp();
-
-  // Setup the "global" state.
-  StackCapture::Init();
-  StackCaptureCache::Init();
-  SetUpLogger();
-  SetUpStackCache();
-  SetUpHeapManager();
-  WindowsHeapAdapter::SetUp(heap_manager_.get());
-
-  // Parse and propagate any flags set via the environment variable. This logs
-  // failure for us.
-  if (!common::ParseAsanParameters(flags_command_line, &params_))
-    return;
-
-  // Propagates the flags values to the different modules.
-  PropagateParams();
-
-  // Register the error reporting callback to use if/when an ASan error is
-  // detected. If we're able to resolve a breakpad error reporting function
-  // then use that; otherwise, fall back to the default error handler.
-  if (!params_.disable_breakpad_reporting &&
-      GetBreakpadFunctions(&breakpad_functions)) {
-    logger_->Write("SyzyASAN: Using Breakpad for error reporting.");
-    SetErrorCallBack(base::Bind(&BreakpadErrorHandler, breakpad_functions));
-  } else {
-    logger_->Write("SyzyASAN: Using default error reporting handler.");
-    SetErrorCallBack(base::Bind(&DefaultErrorHandler));
-  }
-
-  // Install the unhandled exception handler. This is only installed once
-  // across all runtime instances in a process so we check that it hasn't
-  // already been installed.
-  if (!uef_installed_) {
-    uef_installed_ = true;
-    previous_uef_ = ::SetUnhandledExceptionFilter(&UnhandledExceptionFilter);
-  }
-}
-
-void AsanRuntime::TearDown() {
-  base::AutoLock auto_lock(lock_);
-
-  WindowsHeapAdapter::TearDown();
-  TearDownHeapManager();
-  TearDownStackCache();
-  TearDownLogger();
-  DCHECK(asan_error_callback_.is_null() == FALSE);
-  asan_error_callback_.Reset();
-  Shadow::TearDown();
-
-  // Unregister ourselves as the singleton runtime for UEF.
-  runtime_ = NULL;
-
-  // In principle, we should also check that all the heaps have been destroyed
-  // but this is not guaranteed to be the case in Chrome, so the heap list may
-  // not be empty here.
-}
-
-void AsanRuntime::OnError(AsanErrorInfo* error_info) {
-  DCHECK_NE(reinterpret_cast<AsanErrorInfo*>(NULL), error_info);
-
-  error_info->heap_is_corrupt = false;
-  if (params_.check_heap_on_failure) {
-    // TODO(chrisha): Rename IsHeapCorrupt to something else!
-    HeapChecker heap_checker;
-    HeapChecker::CorruptRangesVector corrupt_ranges;
-    heap_checker.IsHeapCorrupt(&corrupt_ranges);
-    size_t size = CalculateCorruptHeapInfoSize(corrupt_ranges);
-
-    // We place the corrupt heap information directly on the stack so that
-    // it gets recorded in minidumps. This is necessary until we can
-    // establish a side-channel in Breakpad for attaching additional metadata
-    // to crash reports.
-    void* buffer = NULL;
-    if (size > 0) {
-      // This modifies |size| and |buffer| in place with allocation details.
-      SAFE_ALLOCA(size, buffer);
-      WriteCorruptHeapInfo(corrupt_ranges, size, buffer, error_info);
-    }
-  }
-
-  LogAsanErrorInfo(error_info);
-
-  if (params_.minidump_on_failure) {
-    DCHECK(logger_.get() != NULL);
-    logger_->SaveMiniDump(&error_info->context, error_info);
-  }
-
-  if (params_.exit_on_failure) {
-    DCHECK(logger_.get() != NULL);
-    logger_->Stop();
-    exit(EXIT_FAILURE);
-  }
-
-  // Call the callback to handle this error.
-  DCHECK(!asan_error_callback_.is_null());
-  asan_error_callback_.Run(error_info);
-}
-
-void AsanRuntime::SetErrorCallBack(const AsanOnErrorCallBack& callback) {
-  asan_error_callback_ = callback;
-}
-
-void AsanRuntime::SetUpLogger() {
-  // Setup variables we're going to use.
-  scoped_ptr<base::Environment> env(base::Environment::Create());
-  scoped_ptr<AsanLogger> client(new AsanLogger);
-  CHECK(env.get() != NULL);
-  CHECK(client.get() != NULL);
-
-  // Initialize the client.
-  client->set_instance_id(
-      base::UTF8ToWide(trace::client::GetInstanceIdForThisModule()));
-  client->Init();
-
-  // Register the client singleton instance.
-  logger_.reset(client.release());
-}
-
-void AsanRuntime::TearDownLogger() {
-  logger_.reset();
-}
-
-void AsanRuntime::SetUpStackCache() {
-  DCHECK(stack_cache_.get() == NULL);
-  DCHECK(logger_.get() != NULL);
-  stack_cache_.reset(new StackCaptureCache(logger_.get()));
-}
-
-void AsanRuntime::TearDownStackCache() {
-  DCHECK(stack_cache_.get() != NULL);
-  stack_cache_->LogStatistics();
-  stack_cache_.reset();
-}
-
-void AsanRuntime::SetUpHeapManager() {
-  DCHECK_EQ(static_cast<heap_managers::BlockHeapManager*>(NULL),
-            heap_manager_.get());
-  DCHECK_NE(static_cast<StackCaptureCache*>(NULL), stack_cache_.get());
-  heap_manager_.reset(new heap_managers::BlockHeapManager(stack_cache_.get()));
-
-  // Configure the heap manager to notify us on heap corruption.
-  heap_manager_->SetHeapErrorCallback(base::Bind(&AsanRuntime::OnError,
-                                                 base::Unretained(this)));
-}
-
-void AsanRuntime::TearDownHeapManager() {
-  DCHECK_NE(static_cast<heap_managers::BlockHeapManager*>(NULL),
-            heap_manager_.get());
-  heap_manager_.reset();
-}
-
-bool AsanRuntime::GetAsanFlagsEnvVar(std::wstring* env_var_wstr) {
-  scoped_ptr<base::Environment> env(base::Environment::Create());
-  if (env.get() == NULL) {
-    LOG(ERROR) << "base::Environment::Create returned NULL.";
-    return false;
-  }
-
-  // If this fails, the environment variable simply does not exist.
-  std::string env_var_str;
-  if (!env->GetVar(kSyzygyAsanOptionsEnvVar, &env_var_str)) {
-    return true;
-  }
-
-  *env_var_wstr = base::SysUTF8ToWide(env_var_str);
-
-  return true;
-}
-
-void AsanRuntime::PropagateParams() {
-  // This function has to be kept in sync with the AsanParameters struct. These
-  // checks will ensure that this is the case.
-  COMPILE_ASSERT(sizeof(common::AsanParameters) == 52,
-                 must_update_propagate_params);
-  COMPILE_ASSERT(common::kAsanParametersVersion == 5,
-                 must_update_parameters_version);
-
-  // Push the configured parameter values to the appropriate endpoints.
-  heap_manager_->set_parameters(params_);
-  StackCaptureCache::set_compression_reporting_period(params_.reporting_period);
-  StackCapture::set_bottom_frames_to_skip(params_.bottom_frames_to_skip);
-  stack_cache_->set_max_num_frames(params_.max_num_frames);
-  // ignored_stack_ids is used locally by AsanRuntime.
-  logger_->set_log_as_text(params_.log_as_text);
-  // exit_on_failure is used locally by AsanRuntime.
-  logger_->set_minidump_on_failure(params_.minidump_on_failure);
-
-  // TODO(peterssen|sebmarchand|chrisha): Pass the zebra_block_heap_size to
-  //     the BlockHeapManager when it's defined.
-  // TODO(peterssen|sebmarchand|chrisha): Pass the
-  //     zebra_block_heap_quarantine_ratio to the BlockHeapManager when it's
-  //     defined.
-}
-
-size_t AsanRuntime::CalculateCorruptHeapInfoSize(
-    const HeapChecker::CorruptRangesVector& corrupt_ranges) {
-  size_t n = corrupt_ranges.size() *
-      (sizeof(AsanCorruptBlockRange) + sizeof(AsanBlockInfo));
-  return n;
-}
-
-void AsanRuntime::WriteCorruptHeapInfo(
-    const HeapChecker::CorruptRangesVector& corrupt_ranges,
-    size_t buffer_size,
-    void* buffer,
-    AsanErrorInfo* error_info) {
-  DCHECK((buffer_size == 0 && buffer == NULL) ||
-         (buffer_size != 0 && buffer != NULL));
-  DCHECK_NE(reinterpret_cast<AsanErrorInfo*>(NULL), error_info);
-
-  ::memset(buffer, 0, buffer_size);
-
-  error_info->heap_is_corrupt = false;
-  error_info->corrupt_range_count = 0;
-  error_info->corrupt_block_count = 0;
-  error_info->corrupt_ranges_reported = 0;
-  error_info->corrupt_ranges = NULL;
-
-  if (corrupt_ranges.empty())
-    return;
-
-  // If we have corrupt ranges then set the aggregate fields.
-  error_info->heap_is_corrupt = true;
-  error_info->corrupt_range_count = corrupt_ranges.size();
-  for (size_t i = 0; i < corrupt_ranges.size(); ++i)
-    error_info->corrupt_block_count += corrupt_ranges[i]->block_count;
-
-  // We report a AsanCorruptBlockRange and at least one AsanBlockInfo per
-  // corrupt range. Determine how many ranges we can report on.
-  size_t range_count = buffer_size /
-      (sizeof(AsanCorruptBlockRange) + sizeof(AsanBlockInfo));
-  range_count = std::min(range_count, corrupt_ranges.size());
-
-  // Allocate space for the corrupt range metadata.
-  uint8* cursor = reinterpret_cast<uint8*>(buffer);
-  uint8* buffer_end = cursor + buffer_size;
-  error_info->corrupt_ranges = reinterpret_cast<AsanCorruptBlockRange*>(
-      cursor);
-  cursor += range_count * sizeof(AsanCorruptBlockRange);
-  error_info->corrupt_range_count = corrupt_ranges.size();
-  error_info->corrupt_ranges_reported = range_count;
-
-  // Allocate space for the corrupt block metadata.
-  size_t block_count = (buffer_end - cursor) / sizeof(AsanBlockInfo);
-  AsanBlockInfo* block_infos = reinterpret_cast<AsanBlockInfo*>(cursor);
-  cursor += block_count * sizeof(AsanBlockInfo);
-
-  // Write as many corrupt block ranges as we have room for. This is
-  // effectively random as it is by order of address.
-  for (size_t i = 0; i < range_count; ++i) {
-    // Copy the information about the corrupt range.
-    error_info->corrupt_ranges[i] = *corrupt_ranges[i];
-
-    // Allocate space for the first block of this range on the stack.
-    // TODO(sebmarchand): Report more blocks if necessary.
-    AsanBlockInfo* asan_block_info = block_infos;
-    error_info->corrupt_ranges[i].block_info = block_infos;
-    error_info->corrupt_ranges[i].block_info_count = 1;
-    ++block_infos;
-
-    // Use a shadow walker to find the first corrupt block in this range and
-    // copy its metadata.
-    ShadowWalker shadow_walker(
-        false,
-        reinterpret_cast<const uint8*>(corrupt_ranges[i]->address),
-        reinterpret_cast<const uint8*>(corrupt_ranges[i]->address) +
-            corrupt_ranges[i]->length);
-    BlockInfo block_info = {};
-    CHECK(shadow_walker.Next(&block_info));
-    asan_block_info->header = block_info.header;
-    ErrorInfoGetAsanBlockInfo(stack_cache_.get(), asan_block_info);
-    DCHECK(asan_block_info->corrupt);
-  }
-
-  return;
-}
-
-void AsanRuntime::LogAsanErrorInfo(AsanErrorInfo* error_info) {
-  DCHECK_NE(reinterpret_cast<AsanErrorInfo*>(NULL), error_info);
-
-  const char* bug_descr = ErrorInfoAccessTypeToStr(error_info->error_type);
-  if (logger_->log_as_text()) {
-    std::string output(base::StringPrintf(
-        "SyzyASAN error: %s on address 0x%08X (stack_id=0x%08X)\n",
-        bug_descr, error_info->location, error_info->crash_stack_id));
-    if (error_info->access_mode != agent::asan::ASAN_UNKNOWN_ACCESS) {
-      const char* access_mode_str = NULL;
-      if (error_info->access_mode == agent::asan::ASAN_READ_ACCESS)
-        access_mode_str = "READ";
-      else
-        access_mode_str = "WRITE";
-      base::StringAppendF(&output,
-                          "%s of size %d at 0x%08X\n",
-                          access_mode_str,
-                          error_info->access_size,
-                          error_info->location);
-    }
-
-    // Log the failure and stack.
-    logger_->WriteWithContext(output, error_info->context);
-
-    logger_->Write(error_info->shadow_info);
-    if (error_info->free_stack_size != 0U) {
-      logger_->WriteWithStackTrace("freed here:\n",
-                                   error_info->free_stack,
-                                   error_info->free_stack_size);
-    }
-    if (error_info->alloc_stack_size != NULL) {
-      logger_->WriteWithStackTrace("previously allocated here:\n",
-                                   error_info->alloc_stack,
-                                   error_info->alloc_stack_size);
-    }
-    if (error_info->error_type >= USE_AFTER_FREE) {
-      std::string shadow_text;
-      Shadow::AppendShadowMemoryText(error_info->location, &shadow_text);
-      logger_->Write(shadow_text);
-    }
-  }
-
-  // Print the base of the Windbg help message.
-  ASANDbgMessage(L"An Asan error has been found (%ls), here are the details:",
-                 base::SysUTF8ToWide(bug_descr).c_str());
-
-  // Print the Windbg information to display the allocation stack if present.
-  if (error_info->alloc_stack_size != NULL) {
-    ASANDbgMessage(L"Allocation stack trace:");
-    ASANDbgCmd(L"dps %p l%d",
-               error_info->alloc_stack,
-               error_info->alloc_stack_size);
-  }
-
-  // Print the Windbg information to display the free stack if present.
-  if (error_info->free_stack_size != NULL) {
-    ASANDbgMessage(L"Free stack trace:");
-    ASANDbgCmd(L"dps %p l%d",
-               error_info->free_stack,
-               error_info->free_stack_size);
-  }
-}
-
-void AsanRuntime::GetBadAccessInformation(AsanErrorInfo* error_info) {
-  base::AutoLock lock(lock_);
-
-  // Checks if this is an access to an internal structure or if it's an access
-  // in the upper region of the memory (over the 2 GB limit).
-  if ((reinterpret_cast<size_t>(error_info->location) & (1 << 31)) != 0 ||
-      Shadow::GetShadowMarkerForAddress(error_info->location)
-          == kAsanMemoryMarker) {
-      error_info->error_type = WILD_ACCESS;
-  } else if (Shadow::GetShadowMarkerForAddress(error_info->location) ==
-      kInvalidAddressMarker) {
-    error_info->error_type = INVALID_ADDRESS;
-  } else {
-    ErrorInfoGetBadAccessInformation(stack_cache_.get(), error_info);
-  }
-}
-
-LONG WINAPI AsanRuntime::UnhandledExceptionFilter(
-    struct _EXCEPTION_POINTERS* exception) {
-  // This ensures that we don't have multiple colliding crashes being processed
-  // simultaneously.
-  base::AutoLock auto_lock(lock_);
-
-  // If this is an exception that we launched then extract the original
-  // exception data and continue processing it.
-  if (exception->ExceptionRecord->ExceptionCode == kAsanException) {
-    ULONG_PTR* args = exception->ExceptionRecord->ExceptionInformation;
-    DWORD code = args[0];
-    DWORD flags = args[1];
-    DWORD nargs = args[2];
-    const ULONG_PTR* orig_args = reinterpret_cast<const ULONG_PTR*>(args[3]);
-
-    // Rebuild the exception with the original exception data.
-    exception->ExceptionRecord->ExceptionCode = code;
-    exception->ExceptionRecord->ExceptionFlags = flags;
-    exception->ExceptionRecord->NumberParameters = nargs;
-    for (DWORD i = 0; i < nargs; ++i)
-      args[i] = orig_args[i];
-  } else if (runtime_) {
-    // If we're bound to a runtime then look for heap corruption and
-    // potentially augment the exception record.
-    AsanErrorInfo error_info = {};
-    error_info.location = exception->ExceptionRecord->ExceptionAddress;
-    error_info.context = *exception->ContextRecord;
-    error_info.error_type = CORRUPT_HEAP;
-    error_info.access_mode = ASAN_UNKNOWN_ACCESS;
-
-    // Check for heap corruption. If we find it we take over the exception
-    // and add additional metadata to the reporting.
-    if (!runtime_->params_.check_heap_on_failure) {
-      // This message is required in order to unittest this properly.
-      runtime_->logger_->Write(
-          "SyzyASAN: Heap checker disabled, ignoring unhandled exception.");
-    } else {
-      runtime_->logger_->Write(
-          "SyzyASAN: Heap checker enabled, processing unhandled exception.");
-
-      HeapChecker heap_checker;
-      HeapChecker::CorruptRangesVector corrupt_ranges;
-      heap_checker.IsHeapCorrupt(&corrupt_ranges);
-      size_t size = runtime_->CalculateCorruptHeapInfoSize(corrupt_ranges);
-
-      // We place the corrupt heap information directly on the stack so that
-      // it gets recorded in minidumps. This is necessary until we can
-      // establish a side-channel in Breakpad for attaching additional metadata
-      // to crash reports.
-      void* buffer = NULL;
-      if (size > 0) {
-        // This modifies |size| and |buffer| in place with allocation details.
-        SAFE_ALLOCA(size, buffer);
-        runtime_->WriteCorruptHeapInfo(
-            corrupt_ranges, size, buffer, &error_info);
-        runtime_->LogAsanErrorInfo(&error_info);
-
-        // If we have Breakpad integration then set our crash keys.
-        if (breakpad_functions.crash_for_exception_ptr != NULL)
-          SetCrashKeys(breakpad_functions, &error_info);
-
-        // Clone the old exception record.
-        _EXCEPTION_RECORD old_record = *(exception->ExceptionRecord);
-
-        // Modify the exception record, chaining it to the old one.
-        exception->ExceptionRecord->ExceptionRecord = &old_record;
-        exception->ExceptionRecord->NumberParameters = 2;
-        exception->ExceptionRecord->ExceptionInformation[0] =
-            reinterpret_cast<ULONG_PTR>(&error_info.context);
-        exception->ExceptionRecord->ExceptionInformation[1] =
-            reinterpret_cast<ULONG_PTR>(&error_info);
-      }
-    }
-  }
-
-  // Pass the buck to the next exception handler. If the process is Breakpad
-  // enabled this will eventually make its way there.
-  if (previous_uef_ != NULL)
-    return (*previous_uef_)(exception);
-
-  // We can't do anything with this, so let the system deal with it.
-  return EXCEPTION_CONTINUE_SEARCH;
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/asan_runtime.h b/syzygy/agent/asan/asan_runtime.h
deleted file mode 100644
index ebd1cc8..0000000
--- a/syzygy/agent/asan/asan_runtime.h
+++ /dev/null
@@ -1,205 +0,0 @@
-// Copyright 2012 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// A class that take care of initializing asan run-time library.
-
-#ifndef SYZYGY_AGENT_ASAN_ASAN_RUNTIME_H_
-#define SYZYGY_AGENT_ASAN_ASAN_RUNTIME_H_
-
-#include <set>
-#include <string>
-
-#include "base/callback.h"
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/synchronization/lock.h"
-#include "syzygy/agent/asan/asan_heap_checker.h"
-#include "syzygy/agent/asan/stack_capture.h"
-#include "syzygy/agent/asan/heap_managers/block_heap_manager.h"
-#include "syzygy/common/asan_parameters.h"
-
-namespace agent {
-namespace asan {
-
-// Forward declarations.
-class AsanLogger;
-
-// An Asan Runtime manager.
-// This class takes care of initializing the different modules (stack cache,
-// logger...) and provide the functions to report an error.
-// Basic usage:
-//     AsanRuntime* asan_runtime = new AsanRuntime();
-//     std::wstring asan_flags_str;
-//     AsanRuntime::GetAsanFlagsEnvVar(&asan_flags_str);
-//     asan_runtime->SetUp(asan_flags_str);  // Initialize the modules.
-//     ...
-//     AsanErrorInfo bad_access_info = {};
-//     ::RtlCaptureContext(&bad_access_info.context);
-//     StackCapture stack;
-//     stack.InitFromStack();
-//     stack.set_stack_id(stack.ComputeRelativeStackId());
-//     bad_access_info.crash_stack_id = stack.stack_id();
-//     asan_runtime->OnError(&bad_access_info);
-//     asan_runtime->TearDown();  // Release the modules.
-//     delete asan_runtime;
-class AsanRuntime {
- public:
-  typedef std::set<StackCapture::StackId> StackIdSet;
-
-  // The type of callback used by the OnError function.
-  typedef base::Callback<void(AsanErrorInfo*)> AsanOnErrorCallBack;
-
-  AsanRuntime();
-  ~AsanRuntime();
-
-  // @name Accessors.
-  // @{
-  AsanLogger* logger() {
-    DCHECK(logger_.get() != NULL);
-    return logger_.get();
-  }
-  StackCaptureCache* stack_cache() {
-    DCHECK(stack_cache_.get() != NULL);
-    return stack_cache_.get();
-  }
-  // @}
-
-  // Initialize asan runtime library.
-  // @param flags_command_line The parameters string.
-  void SetUp(const std::wstring& flags_command_line);
-
-  // Release asan runtime library.
-  void TearDown();
-
-  // The error handler.
-  // @param error_info The information about this error.
-  void OnError(AsanErrorInfo* error_info);
-
-  // Set the callback called on error.
-  // TODO(sebmarchand): Move the signature of this callback to an header file
-  //     so it'll be easier to update it.
-  void SetErrorCallBack(const AsanOnErrorCallBack& callback);
-
-  // Try to read the Asan environment variable.
-  // @param env_var_wstr The wstring where to store the environment variable.
-  // returns true on success, false otherwise.
-  static bool GetAsanFlagsEnvVar(std::wstring* env_var_wstr);
-
-  // Returns true if we should ignore the given @p stack_id, false
-  // otherwise.
-  bool ShouldIgnoreError(common::AsanStackId stack_id) const {
-    // TODO(sebmarchand): Keep a list of the stack ids that have already been
-    //     reported so we can avoid reporting the same error multiple times.
-    return params_.ignored_stack_ids_set.find(stack_id) !=
-        params_.ignored_stack_ids_set.end();
-  }
-
-  // Get information about a bad access.
-  // @param bad_access_info Will receive the information about this access.
-  void GetBadAccessInformation(AsanErrorInfo* error_info);
-
-  // The name of the environment variable containing the command-line.
-  static const char kSyzygyAsanOptionsEnvVar[];
-
-  // Accessors for runtime parameters.
-  common::InflatedAsanParameters& params() { return params_; }
-  const common::InflatedAsanParameters& params() const { return params_; }
-
-  // Retrieves the process's heap.
-  // @returns The ID of the process's heap.
-  HeapManagerInterface::HeapId GetProcessHeap() {
-    return heap_manager_->process_heap();
-  }
-
- protected:
-  // Propagate the values of the flags to the target modules.
-  void PropagateParams();
-
-  // @returns the space required to write the provided corrupt heap info.
-  // @param corrupt_ranges The corrupt range info.
-  size_t CalculateCorruptHeapInfoSize(
-      const HeapChecker::CorruptRangesVector& corrupt_ranges);
-
-  // Writes corrupt heap information to the provided buffer. This will write
-  // as much of the information as possible in the space provided.
-  // @param corrupt_ranges The corrupt range info.
-  // @param buffer_size The size of the buffer to be written to. May be zero.
-  // @param buffer The location where data will be written. May be null.
-  // @param error_info The written heap metadata will be wired up to the
-  //     provided error_info.
-  void WriteCorruptHeapInfo(
-      const HeapChecker::CorruptRangesVector& corrupt_ranges,
-      size_t buffer_size,
-      void* buffer,
-      AsanErrorInfo* error_info);
-
-  // Logs information about an ASAN error.
-  void LogAsanErrorInfo(AsanErrorInfo* error_info);
-
- private:
-  // Set up the logger.
-  void SetUpLogger();
-
-  // Tear down the logger.
-  void TearDownLogger();
-
-  // Set up the stack cache.
-  void SetUpStackCache();
-
-  // Tear down the stack cache.
-  void TearDownStackCache();
-
-  // Set up the heap manager.
-  void SetUpHeapManager();
-
-  // Tear down the heap manager.
-  void TearDownHeapManager();
-
-  // The unhandled exception filter registered by this runtime. This is used
-  // to catch unhandled exceptions so we can augment them with information
-  // about the corrupt heap.
-  static LONG WINAPI UnhandledExceptionFilter(
-      struct _EXCEPTION_POINTERS* exception);
-
-  // @name Static variables related to unhandled exception filtering (UEF).
-  // @{
-  static base::Lock lock_;  // Lock for all runtimes.
-  static AsanRuntime* runtime_;  // Singleton. Under lock_.
-  static LPTOP_LEVEL_EXCEPTION_FILTER previous_uef_;  // Under lock_.
-  static bool uef_installed_;  // Under lock_.
-  // @}
-
-  // The shared logger instance that will be used to report errors and runtime
-  // information.
-  scoped_ptr<AsanLogger> logger_;
-
-  // The shared stack cache instance that will be used by all the heaps.
-  scoped_ptr<StackCaptureCache> stack_cache_;
-
-  // The asan error callback functor.
-  AsanOnErrorCallBack asan_error_callback_;
-
-  // The heap manager.
-  scoped_ptr<heap_managers::BlockHeapManager> heap_manager_;  // Under lock_.
-
-  // The runtime parameters.
-  common::InflatedAsanParameters params_;
-
-  DISALLOW_COPY_AND_ASSIGN(AsanRuntime);
-};
-
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_ASAN_RUNTIME_H_
diff --git a/syzygy/agent/asan/asan_runtime_unittest.cc b/syzygy/agent/asan/asan_runtime_unittest.cc
deleted file mode 100644
index 325dcf9..0000000
--- a/syzygy/agent/asan/asan_runtime_unittest.cc
+++ /dev/null
@@ -1,197 +0,0 @@
-// Copyright 2012 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/asan_runtime.h"
-
-#include "base/bind.h"
-#include "base/command_line.h"
-#include "base/environment.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/utf_string_conversions.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/asan_logger.h"
-#include "syzygy/agent/asan/unittest_util.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-using agent::asan::AsanErrorInfo;
-
-// A derived class to expose protected members for unit-testing.
-class TestAsanRuntime : public AsanRuntime {
- public:
-  using AsanRuntime::PropagateParams;
-};
-
-class AsanRuntimeTest : public testing::TestWithAsanLogger {
- public:
-  typedef testing::TestWithAsanLogger Super;
-
-  AsanRuntimeTest()
-      : current_command_line_(CommandLine::NO_PROGRAM),
-        stack_cache_(&logger_) {
-  }
-
-  void SetUp() OVERRIDE {
-    Super::SetUp();
-
-    env_.reset(base::Environment::Create());
-    ASSERT_TRUE(env_.get() != NULL);
-    env_->UnSetVar(AsanRuntime::kSyzygyAsanOptionsEnvVar);
-
-    // Setup the "global" state.
-    StackCapture::Init();
-    StackCaptureCache::Init();
-  }
-
-  void TearDown() OVERRIDE {
-    // Clear the environment so other tests aren't affected.
-    env_->UnSetVar(AsanRuntime::kSyzygyAsanOptionsEnvVar);
-
-    Super::TearDown();
-  }
-
-  AsanLogger logger_;
-  StackCaptureCache stack_cache_;
-
-  // The test runtime instance.
-  TestAsanRuntime asan_runtime_;
-
-  // The value of the command-line that we want to test.
-  CommandLine current_command_line_;
-
-  // The process environment.
-  scoped_ptr<base::Environment> env_;
-};
-
-bool callback_called = false;
-
-// A simple callback that change the value of a boolean to indicate that it has
-// been called.
-void TestCallback(AsanErrorInfo* error_info) {
-  callback_called = true;
-}
-
-}  // namespace
-
-TEST_F(AsanRuntimeTest, SetUpAndTearDown) {
-  ASSERT_NO_FATAL_FAILURE(
-      asan_runtime_.SetUp(current_command_line_.GetCommandLineString()));
-  ASSERT_NO_FATAL_FAILURE(asan_runtime_.TearDown());
-}
-
-TEST_F(AsanRuntimeTest, OnError) {
-  ASSERT_NO_FATAL_FAILURE(
-      asan_runtime_.SetUp(current_command_line_.GetCommandLineString()));
-
-  // Disable the heap checking as this really slows down the unittests.
-  asan_runtime_.params().check_heap_on_failure = false;
-  asan_runtime_.SetErrorCallBack(base::Bind(&TestCallback));
-  callback_called = false;
-  AsanErrorInfo bad_access_info = {};
-  RtlCaptureContext(&bad_access_info.context);
-  asan_runtime_.OnError(&bad_access_info);
-  ASSERT_TRUE(callback_called);
-  ASSERT_NO_FATAL_FAILURE(asan_runtime_.TearDown());
-}
-
-TEST_F(AsanRuntimeTest, SetCompressionReportingPeriod) {
-  ASSERT_EQ(StackCaptureCache::GetDefaultCompressionReportingPeriod(),
-            StackCaptureCache::compression_reporting_period());
-
-  size_t new_period =
-      StackCaptureCache::GetDefaultCompressionReportingPeriod() + 1024;
-  std::string new_period_str = base::UintToString(new_period);
-  current_command_line_.AppendSwitchASCII(
-      common::kParamReportingPeriod, new_period_str);
-
-  ASSERT_NO_FATAL_FAILURE(
-      asan_runtime_.SetUp(current_command_line_.GetCommandLineString()));
-  // Ensure that the compression reporting period has been modified.
-  EXPECT_EQ(new_period, StackCaptureCache::compression_reporting_period());
-  ASSERT_NO_FATAL_FAILURE(asan_runtime_.TearDown());
-}
-
-TEST_F(AsanRuntimeTest, SetBottomFramesToSkip) {
-  size_t frames_to_skip = StackCapture::bottom_frames_to_skip() + 1;
-  std::string new_frames_to_skip_str = base::UintToString(frames_to_skip);
-  current_command_line_.AppendSwitchASCII(
-      common::kParamBottomFramesToSkip, new_frames_to_skip_str);
-
-  ASSERT_NO_FATAL_FAILURE(
-      asan_runtime_.SetUp(current_command_line_.GetCommandLineString()));
-  EXPECT_EQ(frames_to_skip, StackCapture::bottom_frames_to_skip());
-  ASSERT_NO_FATAL_FAILURE(asan_runtime_.TearDown());
-}
-
-TEST_F(AsanRuntimeTest, SetDisableBreakpad) {
-  current_command_line_.AppendSwitch(common::kParamDisableBreakpadReporting);
-
-  ASSERT_NO_FATAL_FAILURE(
-      asan_runtime_.SetUp(current_command_line_.GetCommandLineString()));
-  EXPECT_TRUE(asan_runtime_.params().disable_breakpad_reporting);
-  ASSERT_NO_FATAL_FAILURE(asan_runtime_.TearDown());
-}
-
-TEST_F(AsanRuntimeTest, SetExitOnFailure) {
-  current_command_line_.AppendSwitch(common::kParamExitOnFailure);
-
-  ASSERT_NO_FATAL_FAILURE(
-      asan_runtime_.SetUp(current_command_line_.GetCommandLineString()));
-  EXPECT_TRUE(asan_runtime_.params().exit_on_failure);
-  ASSERT_NO_FATAL_FAILURE(asan_runtime_.TearDown());
-}
-
-TEST_F(AsanRuntimeTest, ExitOnFailure) {
-  current_command_line_.AppendSwitch(common::kParamExitOnFailure);
-
-  ASSERT_NO_FATAL_FAILURE(
-      asan_runtime_.SetUp(current_command_line_.GetCommandLineString()));
-
-  EXPECT_TRUE(asan_runtime_.params().exit_on_failure);
-  AsanErrorInfo bad_access_info = {};
-  RtlCaptureContext(&bad_access_info.context);
-
-  // We need to delete the files and directory created by this unittest because
-  // the EXPECT_EXIT macro will clone the process and this new process will exit
-  // after the call to OnError, without calling the destructor of this class
-  // (who takes care of deleting the temporary files/directories).
-  DeleteTempFileAndDirectory();
-  // Disable the heap checking as this really slows down the unittests.
-  asan_runtime_.params().check_heap_on_failure = false;
-  EXPECT_EXIT(asan_runtime_.OnError(&bad_access_info),
-              ::testing::ExitedWithCode(EXIT_FAILURE), "");
-
-  ASSERT_NO_FATAL_FAILURE(asan_runtime_.TearDown());
-}
-
-TEST_F(AsanRuntimeTest, IgnoredStackIds) {
-  std::string ignored_stack_ids = "0x1;0X7E577E57;0xCAFEBABE;0xffffffff";
-  current_command_line_.AppendSwitchASCII(
-      common::kParamIgnoredStackIds, ignored_stack_ids);
-
-  ASSERT_NO_FATAL_FAILURE(
-      asan_runtime_.SetUp(current_command_line_.GetCommandLineString()));
-
-  EXPECT_THAT(asan_runtime_.params().ignored_stack_ids_set,
-              testing::ElementsAre(0x1, 0x7E577E57, 0xCAFEBABE, 0xFFFFFFFF));
-  ASSERT_NO_FATAL_FAILURE(asan_runtime_.TearDown());
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/asan_system_interceptor_parser.py b/syzygy/agent/asan/asan_system_interceptor_parser.py
deleted file mode 100644
index a7e7b07..0000000
--- a/syzygy/agent/asan/asan_system_interceptor_parser.py
+++ /dev/null
@@ -1,503 +0,0 @@
-#!python
-# Copyright 2014 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""A utility script to automatically generate the SyzyASan interceptors for the
-functions declared in a header file using SAL annotations.
-
-Here's how this script should be used:
-python asan_system_interceptor_parser.py input_header.h --output-file=$(OutName)
-    --overwrite --def-file=$(DefFile)
-
-3 files will be produced:
-- $(OutName)_impl.h.gen : This will contain the implementation of the new
-    interceptors.
-- $(OutName)_instrumentation_filter.h.gen : This will contain a list of
-   AsanInterceptor entries, e.g:
-    { "foo", NULL, NULL, "foo.dll", true },
-    { "bar", NULL, NULL, "bar.dll", true },
-- $(OutName).def.gen : This will contain a copy of the input DEF file followed
-    by the list of the new interceptors
-
-As an example, for a definition like this:
-MODULE: kernel32.dll
-BOOL
-WINAPI
-WriteFile(
-    _In_ HANDLE hFile,
-    _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer,
-    _In_ DWORD nNumberOfBytesToWrite,
-    _Out_opt_ LPDWORD lpNumberOfBytesWritten,
-    _Inout_opt_ LPOVERLAPPED lpOverlapped
-    );
-
-This will produce the following interceptor:
-BOOL WINAPI asan_WriteFile(
-    _In_ HANDLE hFile,
-    _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer,
-    _In_ DWORD nNumberOfBytesToWrite,
-    _Out_opt_ LPDWORD lpNumberOfBytesWritten,
-    _Inout_opt_ LPOVERLAPPED lpOverlapped
-    ) {
-  if (lpBuffer != NULL) {
-    TestMemoryRange(reinterpret_cast<const uint8*>(lpBuffer),
-                    nNumberOfBytesToWrite,
-                    agent::asan::ASAN_READ_ACCESS);
-  }
-
-  if (lpNumberOfBytesWritten != NULL) {
-    TestMemoryRange(reinterpret_cast<const uint8*>(lpNumberOfBytesWritten),
-                    sizeof(*lpNumberOfBytesWritten),
-                    agent::asan::ASAN_WRITE_ACCESS);
-  }
-
-  if (lpOverlapped != NULL) {
-    TestMemoryRange(reinterpret_cast<const uint8*>(lpOverlapped),
-                    sizeof(*lpOverlapped),
-                    agent::asan::ASAN_READ_ACCESS);
-  }
-
-
-  BOOL ret = ::WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite,
-                         lpNumberOfBytesWritten, lpOverlapped);
-
-  if (interceptor_tail_callback != NULL)
-    (*interceptor_tail_callback)();
-
-
-  if (lpNumberOfBytesWritten != NULL) {
-    TestMemoryRange(reinterpret_cast<const uint8*>(lpNumberOfBytesWritten),
-                    sizeof(*lpNumberOfBytesWritten),
-                    agent::asan::ASAN_WRITE_ACCESS);
-  }
-
-  if (lpBuffer != NULL) {
-    TestMemoryRange(reinterpret_cast<const uint8*>(lpBuffer),
-                    nNumberOfBytesToWrite,
-                    agent::asan::ASAN_READ_ACCESS);
-  }
-
-  return ret;
-}
-"""
-
-import logging
-import optparse
-import os
-import re
-import sys
-from string import Template
-
-# Matches a function declaration of this type:
-# MODULE: MODULE_NAME
-# RETURN_TYPE
-# WINAPI
-# FUNCTION_NAME(
-#     ...
-#     );
-_FUNCTION_MATCH_RE = re.compile(r"""
-    MODULE\:\s*(?P<module_name>(\w+\.\w+))\s+
-                                # Match the name of the module implementing the
-                                # function.
-    (?P<ret>\w+)\s+             # Match the return type of the function.
-    (?P<conv>WINAPI|__cdecl)\s+ # Match the calling convention keyword.
-    (?P<name>\w+)\s*\(          # Match the function name.
-      (?P<params>[^;]+)\)\s*;   # Match the functions parameters, terminated by
-                                # ');'. This field can contain embedded
-                                # parenthesis.
-    """, re.VERBOSE | re.IGNORECASE | re.MULTILINE)
-
-
-# Match and tokenize an argument in a function declaration using SAL
-# annotations. Here are some examples of strings that we need to be able to
-# match:
-#     - _In_ HANDLE hFile
-#     - _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer
-#     - _Out_writes_to_opt_(nBufferLength, return + 1) LPWSTR lpBuffer
-#     - _Out_writes_bytes_opt_(nNumber) __out_data_source(FILE) LPVOID lpBuffer
-#     - _Out_writes_to_opt_(cchBufferLength, *lpcchReturnLength) _Post_
-#           _NullNull_terminated_ LPWCH lpszVolumePathNames
-#     - _In_ FILE_SEGMENT_ELEMENT aSegmentArray[]
-#     - _In_reads_bytes_opt_(PropertyBufferSize) CONST PBYTE PropertyBuffer
-#     - _Inout_ _Interlocked_operand_ LONG volatile *Addend
-#
-# Here's a description of the different groups in this regex:
-#     - SAL_tag corresponds to the SAL tag of the argument.
-#     - SAL_tag_args (optional) corresponds to the arguments accompanying the
-#       tag.
-#     - var_type corresponds to the type of the argument.
-#     - var_name corresponds to the name of the argument.
-#
-# For an argument like:
-#     _Out_writes_to_opt_(nBufferLength, return + 1) LPWSTR lpBuffer
-# we'll get the following values:
-#     - SAL_tag: _Out_writes_to_opt_
-#     - SAL_tag_args: nBufferLength, return + 1
-#     - var_type: LPWSTR
-#     - var_name: lpBuffer
-#     - var_keyword corresponds to the potential keyword qualifier accompanying
-#       the variable type (e.g. 'volatile')
-#
-# See http://msdn.microsoft.com/en-us/library/hh916382.aspx for a complete list
-# of the possible annotations.
-_ARG_TOKENS_RE = re.compile(r"""
-    (?P<SAL_tag>(\_\w+\_))            # Match the SAL annotation, it starts and
-                                      # ends with an underscore and usually
-                                      # contains one or several words separated
-                                      # by an underscore.
-    (\((?P<SAL_tag_args>[^\)]*)\))?   # Match the optional arguments
-                                      # accompanying a tag.
-    \s+((\_[^ ]+\s+)*)?               # The annotation is sometimes followed by
-                                      # one or several other tags, all starting
-                                      # with at least one underscore, like:
-                                      #     - _Post_ _NullNull_terminated_
-                                      #     - __out_data_source(FILE)
-    (?P<var_type>(((CONST|FAR)\s*)?[a-zA-Z][a-zA-Z_0-9]+)
-                                      # Match the type of the argument.
-    (\s+(?P<var_keyword>volatile|const))?(\*)?(\s+\*)?)
-                                      # Match the optional keyword of the
-                                      # argument.
-    (\*)?\s+(\*\s*)?(?P<var_name>\w+)(\[\])?
-                                      # Match the name of the argument.
-    """, re.VERBOSE | re.IGNORECASE | re.MULTILINE)
-
-
-# Non-exhaustive dictionary of the annotations that we're interested in. All of
-# these usually refer to a buffer that we should check. The key of the entry
-# is the SAL tag and the value of this key corresponds to the access mode for
-# this tag.
-_TAGS_TO_INTERCEPT = {
-    '_In_reads_bytes_opt_' : 'READ',
-    '_Out_writes_to_opt_' : 'WRITE',
-    '_Out_writes_bytes_opt_' : 'WRITE',
-    '_Out_writes_bytes_to_opt_' : 'WRITE',
-}
-
-
-# List of the SAL tags meaning that an argument should be checked once the call
-# to the intercepted function has returned.
-_TAGS_TO_CHECK_POSTCALL = frozenset(['_Out_', '_Out_opt_'])
-
-
-# List of the SAL tags meaning that an argument should be checked the call to
-# the intercepted function. This includes the tag of some parameters that might
-# become invalid once the call to the original function has returned (i.e. if
-# the parameter is invalidated by the asynchronous callback made by the system
-# call).
-_TAGS_TO_CHECK_PRECALL = frozenset(list(_TAGS_TO_CHECK_POSTCALL) +
-    ['_Inout_', '_Inout_opt_'])
-
-
-_LOGGER = logging.getLogger(__name__)
-
-
-# String template for an entry in an ASan instrumentation filter array.
-#
-# Here's the description of the different identifiers in this template:
-#     - function_name: Name of the function.
-#     - module_name: Name of the module containing this function.
-instrumentation_filter_entry_template = Template("""
-{ "${function_name}", NULL, "${module_name}", NULL, true },
-""")
-
-
-# String template for an ASan interceptor implementation.
-#
-# Here's the description of the different identifiers in this template:
-#     - ret_type: Return type of the function.
-#     - calling_convention: The calling convention of the function.
-#     - function_name: Name of the function.
-#     - function_arguments: Function's arguments, with their types.
-#     - buffer_check: Optional check on the buffer passed to the function.
-#     - function_param_names: String containing the name of the arguments to
-#         pass to the intercepted function.
-#     - param_checks_precall: Optional parameter check done before the call to
-#         the intercepted function.
-#     - param_checks_postcall: Optional parameter check done after the call to
-#         the intercepted function.
-interceptor_template = Template("""
-${ret_type} ${calling_convention} \
-asan_${function_name}(${function_arguments}) {
-  ${buffer_check}
-  ${param_checks_precall}
-
-  ${ret_type} ret = ::${function_name}(${function_param_names});
-
-  if (interceptor_tail_callback != NULL)
-    (*interceptor_tail_callback)();
-
-  ${param_checks_postcall}
-  ${buffer_check}
-
-  return ret;
-}
-""")
-
-
-# String template for an ASan check on a parameter.
-#
-# Here's the description of the different identifiers in this template:
-#     - param_to_check: The parameter to check.
-#     - param_size: Size of the variable that should be checked.
-#     - access_type: The access type to the parameter.
-#     - param_keyword: The optional keyword qualifier accompanying the variable
-#       type (e.g. 'volatile').
-#
-# We need to do a double cast on the parameter to check to convert it to the
-# expected type (via a reinterpret_cast) and to lose the optional keyword
-# qualifier (via a const_cast).
-param_checks_template = Template("""
-  if (${param_to_check} != NULL) {
-    TestMemoryRange(
-        const_cast<const uint8*>(
-            reinterpret_cast<const uint8 ${param_keyword}*>(${param_to_check})),
-        ${param_size},
-        agent::asan::ASAN_${access_type}_ACCESS);
-  }
-""")
-
-
-class ASanSystemInterceptorGenerator(object):
-  """Implement the ASan system interceptor generator class.
-
-  The instances of this class should be created with a 'with' statement to
-  ensure that the output files get correctly closed.
-  """
-
-  def __init__(self, output_base, def_file, overwrite=False):
-    # Creates the output files:
-    #     - output_base + '_impl.gen' : This file will contain the
-    #           implementation of the interceptors.
-    #     - output_base + '_instrumentation_filter.gen : This file will
-    #           contain a list of AsanIntercept entries.
-    #     - output_base + 'def.gen' : This file will contain a copy of the input
-    #           DEF file followed by the list of the new interceptors.
-    output_impl_filename = output_base + '_impl.gen'
-    output_instrumentation_filter_filename = output_base +  \
-        '_instrumentation_filter.gen'
-    output_def_filename = output_base + '.def.gen'
-
-    if (os.path.isfile(output_impl_filename) or  \
-        os.path.isfile(output_instrumentation_filter_filename) or  \
-        os.path.isfile(output_def_filename)) and  \
-        not overwrite:
-      _LOGGER.error('Output files already exist, use the --overwrite flag to '
-                    'overwrite it.')
-      return
-
-    self._output_impl_file = open(output_impl_filename, 'w')
-    self._output_instrumentation_filter_file =  \
-        open(output_instrumentation_filter_filename, 'w')
-    self._def_file = open(output_def_filename, 'w')
-
-    # Copy the input DEF file.
-    with open(def_file, 'r') as f:
-      self._def_file.write(f.read())
-
-    # List of the intercepted functions.
-    self._intercepted_functions = set()
-
-  def __enter__(self):
-    """This generator should be instantiated via a 'with' statement to ensure
-    that it resources are correctly closed.
-    """
-    return self
-
-  def __exit__(self, type, value, traceback):
-    """Close the handle to the allocated files. This is executed when the
-    instance of this generator are created with a 'with' statement.
-    """
-    self._output_impl_file.close()
-    self._output_instrumentation_filter_file.close()
-    self._def_file.close()
-
-  def GenerateFunctionInterceptor(self, function_name, return_type,
-                                  function_arguments, calling_convention,
-                                  module_name):
-    """Generate the interceptor for a given function if necessary.
-
-    Args:
-      function_name: The name of the function for which an interceptor should be
-          generated.
-      return_type: The return type of the function.
-      function_arguments: A string representing the functions arguments
-          (e.g. 'int foo, bool bar'). It can contain newline characters.
-    """
-
-    # Prevent repeatedly intercepting the same function.
-    if (function_name, function_arguments) in self._intercepted_functions:
-      _LOGGER.error('Trying to intercept the same function twice !')
-      return
-
-    # Check if the function should be intercepted. If at least one of its
-    # parameters is annotated with one of the tags we're interested in then it
-    # should be intercepted.
-    m_buffer_size_arg = None
-    for m_iter in _ARG_TOKENS_RE.finditer(function_arguments):
-      if m_iter.group('SAL_tag') in _TAGS_TO_INTERCEPT:
-        # Keep a reference to the argument of interest.
-        m_buffer_size_arg = m_iter
-        break
-
-    # TODO(sebmarchand): Only check the argument type (instead of the raw
-    #     string).
-    self._intercepted_functions.add((function_name, function_arguments))
-
-    _LOGGER.debug('Function to intercept:')
-    _LOGGER.debug('  Function calling convention : %s' % calling_convention)
-    _LOGGER.debug('  Function name : %s' % function_name)
-    _LOGGER.debug('  Function type : %s' % return_type)
-    _LOGGER.debug('  Function module : %s' % module_name)
-    _LOGGER.debug('  Function args : ')
-
-    param_checks_precall = ''
-    param_checks_postcall = ''
-
-    # Form a string containing the name of the arguments separated by a comma
-    # and fill the precall and postcall parameter check strings.
-    function_param_names = ''
-    for m_iter in _ARG_TOKENS_RE.finditer(function_arguments):
-      # Concatenate the argument names.
-      if function_param_names:
-        function_param_names = function_param_names + ', '
-      function_param_names = function_param_names + m_iter.group('var_name')
-      # Check if this argument should be checked prior to a call to the
-      # intercepted function.
-      if m_iter.group('SAL_tag') in _TAGS_TO_CHECK_PRECALL:
-        param_keyword = ''
-        if m_iter.group('var_keyword'):
-          param_keyword = m_iter.group('var_keyword')
-        param_check_str = param_checks_template.substitute(
-            param_to_check=m_iter.group('var_name'),
-            param_size='sizeof(*%s)' % m_iter.group('var_name'),
-            access_type='READ' if 'In' in m_iter.group('SAL_tag') else 'WRITE',
-            param_keyword=param_keyword)
-        param_checks_precall += param_check_str
-        # Check if it should also be checked once the function returns.
-        if m_iter.group('SAL_tag') in _TAGS_TO_CHECK_POSTCALL:
-          param_checks_postcall += param_check_str
-
-      _LOGGER.debug('    %s' %  \
-          ''.join(m_iter.group().replace('\n', ' ').split()))
-      _LOGGER.debug('      SAL tag: %s' % m_iter.group('SAL_tag'))
-      _LOGGER.debug('      SAL tag arguments: %s' %  \
-          m_iter.group('SAL_tag_args'))
-      _LOGGER.debug('      variable type: %s' % m_iter.group('var_type'))
-      _LOGGER.debug('      variable name: %s' % m_iter.group('var_name'))
-      _LOGGER.debug('      variable keyword: %s' % m_iter.group('var_keyword'))
-    _LOGGER.debug('\n')
-
-    buffer_check = ''
-    if m_buffer_size_arg:
-      param_keyword = ''
-      if m_buffer_size_arg.group('var_keyword'):
-        param_keyword = m_buffer_size_arg.group('var_keyword')
-      buffer_check = param_checks_template.substitute(
-          param_to_check=m_buffer_size_arg.group('var_name'),
-          param_size=m_buffer_size_arg.group('SAL_tag_args').split(',')[0],
-          access_type=_TAGS_TO_INTERCEPT[m_buffer_size_arg.group('SAL_tag')],
-          param_keyword=param_keyword)
-
-    # Write the function's implementation in the appropriate file.
-    self._output_impl_file.write(interceptor_template.substitute(
-        ret_type=return_type,
-        calling_convention=calling_convention,
-        function_name=function_name,
-        function_arguments=function_arguments,
-        function_param_names=function_param_names,
-        param_checks_precall=param_checks_precall,
-        param_checks_postcall=param_checks_postcall,
-        buffer_check=buffer_check))
-
-    # Write the entry into the instrumentation filter file.
-    self._output_instrumentation_filter_file.write(
-        instrumentation_filter_entry_template.substitute(
-            function_name=function_name,
-            module_name=module_name))
-
-    # Add the new interceptor to the DEF file.
-    self._def_file.write('asan_' + function_name + '\n')
-
-  def VisitFunctionsInFiles(self, files, callback):
-    """Parse the functions declared in a given list of files and invokes the
-    callback per encountered function.
-
-    Args:
-      files: The files to parse.
-      callback: The callback to invoke per encountered function.
-      output_base: A handle to the output file that will receive the function
-          definitions.
-    """
-    for filename in files:
-      with open(filename, 'r') as f:
-        f_content = f.read()
-
-      for m_iter in _FUNCTION_MATCH_RE.finditer(f_content):
-        callback(m_iter.group('name'), m_iter.group('ret'),
-                 m_iter.group('params'), m_iter.group('conv'),
-                 m_iter.group('module_name'))
-
-
-_USAGE = """\
-%prog [options] [files to process]
-
-Parse a list of files to find the SAL annotated functions.
-"""
-
-
-def ParseOptions(args, parser):
-  parser.add_option('--verbose',
-                    dest='log_level',
-                    default=logging.INFO,
-                    action='store_const',
-                    const=logging.DEBUG,
-                    help='Enable verbose logging.')
-  parser.add_option('--def-file', help='The def file that should be '
-                    'augmented. This file won\'t be modified, instead a new '
-                    'one will be created and will be filled with the content '
-                    'of this one followed by the new interceptors.')
-  parser.add_option('--output-base', help='Base name of the output files to '
-                    'produce (without the extensions).')
-  parser.add_option('--overwrite', default=False, action='store_true',
-                    help='Overwrite the output files if they already exist.')
-  return parser.parse_args(args)
-
-
-def main(args):
-  parser = optparse.OptionParser(usage=_USAGE)
-  (opts, input_files) = ParseOptions(args, parser)
-
-  logging.basicConfig(level=opts.log_level)
-
-  if not opts.output_base:
-    parser.error('You must specify an output base filename.')
-
-  if not opts.def_file:
-    parser.error('You must specify a DEF file to update.')
-
-  # The first argument might be the current script name, remove it and make sure
-  # that there's at least one input file.
-  if __file__ in input_files:
-    input_files.remove(__file__)
-  if not len(input_files):
-    parser.error('You must specify at least one input file.')
-
-  with ASanSystemInterceptorGenerator(opts.output_base,
-                                      opts.def_file,
-                                      opts.overwrite) as generator:
-    generator.VisitFunctionsInFiles(input_files,
-                                    generator.GenerateFunctionInterceptor)
-
-
-if __name__ == '__main__':
-  sys.exit(main(sys.argv))
diff --git a/syzygy/agent/asan/asan_system_interceptor_parser_test.py b/syzygy/agent/asan/asan_system_interceptor_parser_test.py
deleted file mode 100644
index 505a7fc..0000000
--- a/syzygy/agent/asan/asan_system_interceptor_parser_test.py
+++ /dev/null
@@ -1,320 +0,0 @@
-#!python
-# Copyright 2014 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""Unittests for the asan_system_interceptor_parser module."""
-
-import asan_system_interceptor_parser as asan_parser
-import logging
-import optparse
-import os
-import re
-import shutil
-import tempfile
-import unittest
-
-
-class TestInterceptorParser(unittest.TestCase):
-  """Unittests for asan_system_interceptor_parser."""
-
-
-  def setUp(self):
-    self.temp_dir = tempfile.mkdtemp()
-    self.output_base = tempfile.NamedTemporaryFile(delete=False,
-                                                   dir=self.temp_dir)
-    self.def_file = tempfile.NamedTemporaryFile(delete=False, dir=self.temp_dir)
-    self.output_base.close()
-    self.def_file.close()
-    self.generator = asan_parser.ASanSystemInterceptorGenerator(
-        self.output_base.name, self.def_file.name)
-
-
-  def tearDown(self):
-    self.generator = None
-    shutil.rmtree(self.temp_dir)
-
-
-  def testFunctionMatchRegex(self):
-    # Test against a regular function definition.
-    valid_function1 =  \
-        'MODULE: foo.dll\n'  \
-        'VOID\n'  \
-        'WINAPI\n'  \
-        'function1('  \
-        '    type1 param1,\n'  \
-        '    type2 param2,\n'  \
-        '    type3 param3\n'  \
-        '    );\n'
-    valid_function1_m = asan_parser._FUNCTION_MATCH_RE.search(valid_function1)
-    self.assertTrue(valid_function1_m != None)
-    self.assertEqual(valid_function1_m.group('ret'), 'VOID')
-    self.assertEqual(valid_function1_m.group('name'), 'function1')
-
-    # Test against a function definition including some complex annotations.
-    valid_function2 =  \
-        'MODULE: foo.dll\n'  \
-        'BOOL\n'  \
-        'WINAPI\n'  \
-        'function2('  \
-        '    _In_ type1 param1[],\n'  \
-        '     _Out_writes_bytes_opt_(nNumberOfBytesToRead)\n'  \
-        '         __out_data_source(FILE) LPVOID lpBuffer,\n'  \
-        '    _Inout_opt_ type3 param3,\n'  \
-        '    );\n'
-    valid_function2_m = asan_parser._FUNCTION_MATCH_RE.search(valid_function2)
-    self.assertTrue(valid_function2_m != None)
-    self.assertEqual(valid_function2_m.group('ret'), 'BOOL')
-    self.assertEqual(valid_function2_m.group('name'), 'function2')
-
-    # Test against a simple function definition.
-    valid_function3 =  \
-        'MODULE: foo.dll\n'  \
-        'int\n'  \
-        'WINAPI\n'  \
-        'function3(void foo);\n'
-    valid_function3_m = asan_parser._FUNCTION_MATCH_RE.search(valid_function3)
-    self.assertTrue(valid_function3_m != None)
-    self.assertEqual(valid_function3_m.group('ret'), 'int')
-    self.assertEqual(valid_function3_m.group('name'), 'function3')
-
-    # Test against a function definition that doesn't contain the WINAPI
-    # keyword.
-    invalid_function1 =  \
-        'BOOL\n'  \
-        'function1('  \
-        '    type1 param1,\n'  \
-        '    type2 param2,\n'  \
-        '    type3 param3\n'  \
-        '    );\n'
-    invalid_function1_m =  \
-        asan_parser._FUNCTION_MATCH_RE.search(invalid_function1)
-    self.assertTrue(invalid_function1_m == None)
-
-    # Test against a function declaration containing an ifdef group.
-    invalid_function2 =  \
-        'BOOL\n'  \
-        'WINAPI\n'  \
-        '#ifdef FOO'  \
-        'function2('  \
-        'else'  \
-        'function2('  \
-        '#endif'  \
-        '    type1 param1\n'  \
-        '    );\n'
-    invalid_function2_m =  \
-        asan_parser._FUNCTION_MATCH_RE.search(invalid_function2)
-    self.assertTrue(invalid_function2_m == None)
-
-    # Test against an incomplete function definition.
-    invalid_function3 =  \
-        'BOOL\n'  \
-        'function3('  \
-        '    type1 param1,\n'
-    invalid_function3_m =  \
-        asan_parser._FUNCTION_MATCH_RE.search(invalid_function3)
-    self.assertTrue(invalid_function3_m == None)
-
-    # Test against a function with no return type specified.
-    invalid_function4 =  \
-        'WINAPI\n'  \
-        'function4('  \
-        '    type1 param1\n'  \
-        '    );\n'
-    invalid_function4_m =  \
-        asan_parser._FUNCTION_MATCH_RE.search(invalid_function4)
-    self.assertTrue(invalid_function4_m == None)
-
-    # Test against an empty string.
-    invalid_function5 = ''
-    invalid_function5_m =  \
-        asan_parser._FUNCTION_MATCH_RE.search(invalid_function5)
-    self.assertTrue(invalid_function5_m == None)
-
-
-  def testArgTokenizesRegex(self):
-    # Test against some declarations encountered in fileapi.h
-
-    valid_test_1 = '_In_ HANDLE hFile'
-    valid_test_1_match = asan_parser._ARG_TOKENS_RE.search(valid_test_1)
-    self.assertTrue(valid_test_1_match != None)
-    self.assertEqual('_In_', valid_test_1_match.group('SAL_tag'))
-    self.assertEqual(None, valid_test_1_match.group('SAL_tag_args'))
-    self.assertEqual('HANDLE', valid_test_1_match.group('var_type'))
-    self.assertEqual('hFile', valid_test_1_match.group('var_name'))
-    self.assertEqual(None, valid_test_1_match.group('var_keyword'))
-
-    valid_test_2 =  \
-        '_In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer'
-    valid_test_2_match = asan_parser._ARG_TOKENS_RE.search(valid_test_2)
-    self.assertTrue(valid_test_2_match != None)
-    self.assertEqual('_In_reads_bytes_opt_',  \
-                     valid_test_2_match.group('SAL_tag'))
-    self.assertEqual('nNumberOfBytesToWrite',  \
-                    valid_test_2_match.group('SAL_tag_args'))
-    self.assertEqual('LPCVOID', valid_test_2_match.group('var_type'))
-    self.assertEqual('lpBuffer', valid_test_2_match.group('var_name'))
-    self.assertEqual(None, valid_test_2_match.group('var_keyword'))
-
-    valid_test_3 =  \
-        '_Out_writes_to_opt_(nBufferLength, return + 1) LPWSTR lpBuffer'
-    valid_test_3_match = asan_parser._ARG_TOKENS_RE.search(valid_test_3)
-    self.assertTrue(valid_test_3_match != None)
-    self.assertEqual('_Out_writes_to_opt_', valid_test_3_match.group('SAL_tag'))
-    self.assertEqual('nBufferLength, return + 1',  \
-                     valid_test_3_match.group('SAL_tag_args'))
-    self.assertEqual('LPWSTR', valid_test_3_match.group('var_type'))
-    self.assertEqual('lpBuffer', valid_test_3_match.group('var_name'))
-    self.assertEqual(None, valid_test_3_match.group('var_keyword'))
-
-    valid_test_4 =  \
-        '_Out_writes_bytes_opt_(nNumber) __out_data_source(FILE) LPVOID lpBuf'
-    valid_test_4_match = asan_parser._ARG_TOKENS_RE.search(valid_test_4)
-    self.assertTrue(valid_test_4_match != None)
-    self.assertEqual('_Out_writes_bytes_opt_',  \
-                     valid_test_4_match.group('SAL_tag'))
-    self.assertEqual('nNumber', valid_test_4_match.group('SAL_tag_args'))
-    self.assertEqual('LPVOID', valid_test_4_match.group('var_type'))
-    self.assertEqual('lpBuf', valid_test_4_match.group('var_name'))
-    self.assertEqual(None, valid_test_4_match.group('var_keyword'))
-
-    valid_test_5 = '_Out_writes_to_opt_(cchBufferLength, *lpcchReturnLength)'  \
-        ' _Post_ _NullNull_terminated_ LPWCH lpszVolumePathNames'
-    valid_test_5_match = asan_parser._ARG_TOKENS_RE.search(valid_test_5)
-    self.assertTrue(valid_test_5_match != None)
-    self.assertEqual('_Out_writes_to_opt_', valid_test_5_match.group('SAL_tag'))
-    self.assertEqual('cchBufferLength, *lpcchReturnLength',  \
-                     valid_test_5_match.group('SAL_tag_args'))
-    self.assertEqual('LPWCH', valid_test_5_match.group('var_type'))
-    self.assertEqual('lpszVolumePathNames',  \
-                     valid_test_5_match.group('var_name'))
-    self.assertEqual(None, valid_test_5_match.group('var_keyword'))
-
-    valid_test_6 = '_In_ FILE_SEGMENT_ELEMENT aSegmentArray[]'
-    valid_test_6_match = asan_parser._ARG_TOKENS_RE.search(valid_test_6)
-    self.assertTrue(valid_test_6_match != None)
-    self.assertEqual('_In_', valid_test_6_match.group('SAL_tag'))
-    self.assertEqual(None, valid_test_6_match.group('SAL_tag_args'))
-    self.assertEqual('FILE_SEGMENT_ELEMENT',  \
-                     valid_test_6_match.group('var_type'))
-    self.assertEqual('aSegmentArray', valid_test_6_match.group('var_name'))
-    self.assertEqual(None, valid_test_6_match.group('var_keyword'))
-
-    valid_test_7 = '_In_reads_bytes_opt_(PropertyBufferSize) CONST PBYTE '  \
-                       'PropertyBuffer'
-    valid_test_7_match = asan_parser._ARG_TOKENS_RE.search(valid_test_7)
-    self.assertTrue(valid_test_7_match != None)
-    self.assertEqual('_In_reads_bytes_opt_',  \
-        valid_test_7_match.group('SAL_tag'))
-    self.assertEqual('PropertyBufferSize',  \
-        valid_test_7_match.group('SAL_tag_args'))
-    self.assertEqual('CONST PBYTE',  \
-                     valid_test_7_match.group('var_type'))
-    self.assertEqual('PropertyBuffer', valid_test_7_match.group('var_name'))
-    self.assertEqual(None, valid_test_7_match.group('var_keyword'))
-
-    valid_test_8 = '_Inout_ uint64 volatile* Destination'
-    valid_test_8_match = asan_parser._ARG_TOKENS_RE.search(valid_test_8)
-    self.assertTrue(valid_test_8_match != None)
-    self.assertEqual('_Inout_',  valid_test_8_match.group('SAL_tag'))
-    self.assertEqual(None, valid_test_8_match.group('SAL_tag_args'))
-    self.assertEqual('uint64 volatile*', valid_test_8_match.group('var_type'))
-    self.assertEqual('Destination', valid_test_8_match.group('var_name'))
-    self.assertEqual('volatile', valid_test_8_match.group('var_keyword'))
-
-    # Test against a non-annotated argument.
-    invalid_test_1 = 'HANDLE hFile'
-    invalid_test_1_match = asan_parser._ARG_TOKENS_RE.search(invalid_test_1)
-    self.assertTrue(invalid_test_1_match == None)
-
-    # Test against an argument where the variable type is missing.
-    invalid_test_2 = '_Out_writes_to_opt_(cchBufferLength, '  \
-        '*lpcchReturnLength) _Post_ _NullNull_terminated_ lpszVolumePathNames'
-    invalid_test_2_match = asan_parser._ARG_TOKENS_RE.search(invalid_test_2)
-    self.assertTrue(invalid_test_2_match == None)
-
-    # Test against an empty string.
-    invalid_test_3 = ''
-    invalid_test_3_match = asan_parser._ARG_TOKENS_RE.search(invalid_test_3)
-    self.assertTrue(invalid_test_3_match == None)
-
-
-  def testParseFunctionsInFile(self):
-    intercepted_functions = []
-
-    def VisitorCallback(function_name, return_type, function_params,
-          calling_convention, module_name):
-      intercepted_functions.append(function_name)
-
-    self.generator.VisitFunctionsInFiles(
-        ['test_data\\interceptor_parser_test.h'], VisitorCallback)
-    self.assertTrue('valid_function1' in intercepted_functions)
-    self.assertTrue('valid_function2' in intercepted_functions)
-    self.assertTrue('valid_function3' in intercepted_functions)
-    self.assertFalse('invalid_function1' in intercepted_functions)
-    self.assertFalse('invalid_function2' in intercepted_functions)
-    self.assertFalse('invalid_function3' in intercepted_functions)
-    self.assertFalse('invalid_function4' in intercepted_functions)
-    self.assertEqual(3, len(intercepted_functions))
-
-
-  class ScopedTempDir:
-    """A scoped directory that gets automatically removed."""
-    def __init__(self):
-      self.path = tempfile.mkdtemp()
-
-
-    def __enter__(self):
-      return self
-
-
-    def __exit__(self, type, value, traceback):
-      shutil.rmtree(self.path)
-
-
-  def testEndToEnd(self):
-    with self.ScopedTempDir() as temp_dir:
-      with tempfile.NamedTemporaryFile(dir=temp_dir.path) as output_base:
-        args = ['--output-base', output_base.name,
-                '--def-file', 'test_data\\interceptor_parser_test.def',
-                'test_data\\interceptor_parser_test.h']
-        asan_parser.main(args)
-
-
-  def testGenerateFunctionInterceptor(self):
-    self.generator._intercepted_functions.clear()
-    self.generator.GenerateFunctionInterceptor('intercepted_function', 'void',
-        '_In_reads_bytes_opt_(count) int foo', 'WINAPI', 'foo.dll')
-    self.assertTrue(('intercepted_function',
-                     '_In_reads_bytes_opt_(count) int foo')  \
-        in self.generator._intercepted_functions)
-    self.assertEqual(1, len(self.generator._intercepted_functions))
-
-    self.generator.GenerateFunctionInterceptor('intercepted_function', 'void',
-        '_In_reads_bytes_opt_(count) int foo', 'WINAPI', 'foo.dll')
-    # Verify that we don't intercept several time a function with the same
-    # signature.
-    self.assertEqual(1, len(self.generator._intercepted_functions))
-
-    self.generator.GenerateFunctionInterceptor('intercepted_function', 'void',
-        '_In_reads_bytes_opt_(count) int foo, _In_ bar', 'WINAPI', 'foo.dll')
-    self.assertTrue(('intercepted_function',
-                     '_In_reads_bytes_opt_(count) int foo, _In_ bar') \
-        in self.generator._intercepted_functions)
-    self.assertEqual(2, len(self.generator._intercepted_functions))
-
-  # TODO(sebmarchand): Add more tests.
-
-
-if __name__ == '__main__':
-  logging.basicConfig(level=logging.DEBUG)
-  unittest.main()
diff --git a/syzygy/agent/asan/asan_system_interceptors.cc b/syzygy/agent/asan/asan_system_interceptors.cc
deleted file mode 100644
index ef84e04..0000000
--- a/syzygy/agent/asan/asan_system_interceptors.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/asan_system_interceptors.h"
-
-#include <intrin.h>
-
-#include <algorithm>
-
-#include "base/logging.h"
-#include "syzygy/agent/asan/asan_rtl_utils.h"
-#include "syzygy/agent/asan/error_info.h"
-#include "syzygy/agent/asan/shadow.h"
-
-namespace {
-
-using agent::asan::Shadow;
-using agent::asan::TestMemoryRange;
-using agent::asan::TestStructure;
-
-// A callback that will be used in the functions interceptors once the call
-// to the intercepted function has been done. This is for testing purposes
-// only.
-InterceptorTailCallback interceptor_tail_callback = NULL;
-
-}  // namespace
-
-extern "C" {
-
-void asan_SetInterceptorCallback(InterceptorTailCallback callback) {
-  interceptor_tail_callback = callback;
-}
-
-// Bring in the implementation of the system interceptors that have been
-// automatically generated.
-#include "syzygy/agent/asan/asan_system_interceptors_impl.gen"
-
-}  // extern "C"
diff --git a/syzygy/agent/asan/asan_system_interceptors.h b/syzygy/agent/asan/asan_system_interceptors.h
deleted file mode 100644
index fc8442e..0000000
--- a/syzygy/agent/asan/asan_system_interceptors.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Defines the ASan system interceptors.
-#ifndef SYZYGY_AGENT_ASAN_ASAN_SYSTEM_INTERCEPTORS_H_
-#define SYZYGY_AGENT_ASAN_ASAN_SYSTEM_INTERCEPTORS_H_
-
-#include <windows.h>
-
-// Exposes the system interceptors.
-extern "C" {
-
-// Allows specifying a callback that will be called by the function interceptors
-// once the internal call to the intercepted function returns. This is for
-// testing purposes only.
-typedef void (*InterceptorTailCallback)(void);
-void asan_SetInterceptorTailCallback(InterceptorTailCallback callback);
-
-}  // extern "C"
-
-#endif  // SYZYGY_AGENT_ASAN_ASAN_SYSTEM_INTERCEPTORS_H_
diff --git a/syzygy/agent/asan/asan_system_interceptors_function_list.txt b/syzygy/agent/asan/asan_system_interceptors_function_list.txt
deleted file mode 100644
index 65acfe8..0000000
--- a/syzygy/agent/asan/asan_system_interceptors_function_list.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-# Defines the function that we want to intercept. Each entry in this file should
-# have the following format:
-#
-#     MODULE: {module_name}
-#     {return_type}
-#     {calling_convention}
-#     {function_name} (
-#       {SAL_annotated_arguments}
-#     );
-#
-# TODO(sebmarchand): All of this could easily be moved to a JSON file, this will
-#     allow us to easily add support for a new function even if it isn't SAL
-#     annotated and it'll allow us to add more information for every function
-#     (e.g. the decorated name of the function).
-
-MODULE: kernel32.dll
-BOOL
-WINAPI
-ReadFile(
-    _In_ HANDLE hFile,
-    _Out_writes_bytes_to_opt_(nNumberOfBytesToRead, *lpNumberOfBytesRead)
-        __out_data_source(FILE) LPVOID lpBuffer,
-    _In_ DWORD nNumberOfBytesToRead,
-    _Out_opt_ LPDWORD lpNumberOfBytesRead,
-    _Inout_opt_ LPOVERLAPPED lpOverlapped
-    );
-
-MODULE: kernel32.dll
-BOOL
-WINAPI
-ReadFileEx(
-    _In_ HANDLE hFile,
-    _Out_writes_bytes_opt_(nNumberOfBytesToRead)
-        __out_data_source(FILE) LPVOID lpBuffer,
-    _In_ DWORD nNumberOfBytesToRead,
-    _Inout_ LPOVERLAPPED lpOverlapped,
-    _In_opt_ LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
-    );
-
-MODULE: kernel32.dll
-BOOL
-WINAPI
-WriteFile(
-    _In_ HANDLE hFile,
-    _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer,
-    _In_ DWORD nNumberOfBytesToWrite,
-    _Out_opt_ LPDWORD lpNumberOfBytesWritten,
-    _Inout_opt_ LPOVERLAPPED lpOverlapped
-    );
-
-MODULE: kernel32.dll
-BOOL
-WINAPI
-WriteFileEx(
-    _In_ HANDLE hFile,
-    _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer,
-    _In_ DWORD nNumberOfBytesToWrite,
-    _Inout_ LPOVERLAPPED lpOverlapped,
-    _In_opt_ LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
-    );
-
-MODULE: kernel32.dll
-long
-WINAPI
-InterlockedCompareExchange(
-    _Inout_ long volatile* Destination,
-    _In_ long Exchange,
-    _In_ long Comperand
-    );
-
-MODULE: kernel32.dll
-long
-WINAPI
-InterlockedIncrement(
-    _Inout_ long* lpAddend
-    );
-
-MODULE: kernel32.dll
-long
-WINAPI
-InterlockedDecrement(
-    _Inout_ long* lpAddend
-    );
-
-MODULE: kernel32.dll
-long
-WINAPI
-InterlockedExchange(
-    _Inout_ _Interlocked_operand_ long volatile* Target,
-    _In_ long Value
-    );
-
-MODULE: kernel32.dll
-long
-WINAPI
-InterlockedExchangeAdd(
-    _Inout_ _Interlocked_operand_ long volatile* Addend,
-    _In_ long Value
-    );
diff --git a/syzygy/agent/asan/asan_system_interceptors_unittest.cc b/syzygy/agent/asan/asan_system_interceptors_unittest.cc
deleted file mode 100644
index 46f6661..0000000
--- a/syzygy/agent/asan/asan_system_interceptors_unittest.cc
+++ /dev/null
@@ -1,387 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include <windows.h>
-
-#include "base/bind.h"
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/error_info.h"
-#include "syzygy/agent/asan/unittest_util.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-using testing::ScopedASanAlloc;
-
-void AsanErrorCallbackWithoutComparingContext(AsanErrorInfo* error_info) {
-  // All of our unittests should be cleaning up after themselves and not causing
-  // any heap corruption.
-  ASSERT_NE(CORRUPT_BLOCK, error_info->error_type);
-
-  // Raise an exception indicating that an error was encountered. If this isn't
-  // caught and handled by the test then the unittest will fail.
-  ::RaiseException(EXCEPTION_ARRAY_BOUNDS_EXCEEDED, 0, 0, 0);
-}
-
-// Helps to test the asan_ReadFile function.
-class AsanRtlReadFileTest : public testing::TestAsanRtl {
- public:
-  typedef testing::TestAsanRtl Super;
-
-  AsanRtlReadFileTest() : temp_file_handle_(INVALID_HANDLE_VALUE) {
-  }
-
-  void SetUp() OVERRIDE {
-    Super::SetUp();
-    SetCallBackFunction(&AsanErrorCallbackWithoutComparingContext);
-    ASSERT_NO_FATAL_FAILURE(CreateTempFile());
-  }
-
-  void CreateTempFile() {
-    ASSERT_EQ(kTestStringLength,
-              base::WriteFile(temp_file_.path(),
-                              kTestString,
-                              kTestStringLength));
-
-    temp_file_handle_.Set(::CreateFile(temp_file_.path().value().c_str(),
-        GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL));
-
-    ASSERT_NE(INVALID_HANDLE_VALUE, temp_file_handle_.Get());
-  }
-
-  static const char kTestString[];
-  static const size_t kTestStringLength;
-
- protected:
-  testing::ScopedTempFile temp_file_;
-
-  base::win::ScopedHandle temp_file_handle_;
-};
-
-const char AsanRtlReadFileTest::kTestString[] = "Test of asan_ReadFile";
-const size_t AsanRtlReadFileTest::kTestStringLength =
-    sizeof(AsanRtlReadFileTest::kTestString);
-
-}  // namespace
-
-TEST_F(AsanRtlReadFileTest, AsanReadFile) {
-  // Test that the function works correctly with valid parameters. In this case
-  // we don't pass an OVERLAPPED structure to the function.
-  DWORD bytes_read = 0;
-  ScopedASanAlloc<char> alloc(this, kTestStringLength);
-  EXPECT_TRUE(ReadFileFunction(temp_file_handle_.Get(),
-                               alloc.get(),
-                               kTestStringLength,
-                               &bytes_read,
-                               NULL));
-  EXPECT_EQ(kTestStringLength, bytes_read);
-  EXPECT_STREQ(kTestString, alloc.get());
-}
-
-TEST_F(AsanRtlReadFileTest, AsanReadFileWithOverlapped) {
-  ScopedASanAlloc<char> alloc(this, kTestStringLength);
-  // Test that the function works correctly with valid parameters. Here we pass
-  // an OVERLAPPED structure to the function, which indicates that we want to do
-  // the read from a given offset.
-  OVERLAPPED overlapped = {};
-  // Start the read from the middle of the test string.
-  const size_t kOffset = kTestStringLength / 2;
-  overlapped.Offset = kOffset;
-  DWORD bytes_read = 0;
-  EXPECT_TRUE(ReadFileFunction(temp_file_handle_.Get(),
-                               alloc.get(),
-                               kTestStringLength,
-                               &bytes_read,
-                               &overlapped));
-  EXPECT_EQ(kTestStringLength - kOffset, bytes_read);
-  EXPECT_STREQ(kTestString + kOffset, alloc.get());
-}
-
-TEST_F(AsanRtlReadFileTest, AsanReadFileOverflow) {
-  // Test that the function works correctly with valid parameters. In this case
-  // we don't pass an OVERLAPPED structure to the function.
-  DWORD bytes_read = 0;
-  ScopedASanAlloc<char> alloc(this, kTestStringLength);
-  ReadFileFunctionFailing(temp_file_handle_.Get(),
-                          alloc.get(),
-                          kTestStringLength + 1,
-                          &bytes_read,
-                          NULL);
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-}
-
-TEST_F(AsanRtlReadFileTest, AsanReadFileUAFOnOverlapped) {
-  ScopedASanAlloc<char> alloc(this, kTestStringLength);
-  // Test a use-after-free on the overlapped structure.
-  ScopedASanAlloc<OVERLAPPED> overlapped(this, sizeof(OVERLAPPED));
-
-  // Start the read from the middle of the test string.
-  const size_t kOffset = kTestStringLength / 2;
-  overlapped->Offset = kOffset;
-  DWORD bytes_read = 0;
-  OVERLAPPED* overlapped_ptr = overlapped.get();
-  overlapped.reset(NULL);
-  ReadFileFunctionFailing(temp_file_handle_.Get(),
-                          alloc.get(),
-                          kTestStringLength,
-                          &bytes_read,
-                          overlapped_ptr);
-  EXPECT_TRUE(LogContains(kHeapUseAfterFree));
-}
-
-TEST_F(AsanRtlReadFileTest, AsanReadFileUseAfterFree) {
-  // Test if an use-after-free on the destination buffer is correctly detected.
-  DWORD bytes_read = 0;
-  ScopedASanAlloc<char> alloc(this, kTestStringLength);
-  char* alloc_ptr = alloc.get();
-  alloc.reset(NULL);
-  ReadFileFunctionFailing(temp_file_handle_.Get(),
-                          alloc_ptr,
-                          kTestStringLength + 1,
-                          &bytes_read,
-                          NULL);
-  EXPECT_TRUE(LogContains(kHeapUseAfterFree));
-}
-
-namespace {
-
-typedef ScopedASanAlloc<char>* AsanReadFileCallbackData;
-AsanReadFileCallbackData readfile_callback_data = NULL;
-
-void AsanReadFileCallback() {
-  ASSERT_TRUE(readfile_callback_data != NULL);
-  readfile_callback_data->reset(NULL);
-}
-
-}  // namespace
-
-TEST_F(AsanRtlReadFileTest, AsanReadFileUAFAfterInternalCall) {
-  // This test makes sure that use-after-free errors on the input buffer given
-  // to the ReadFile function are correctly detected.
-  ScopedASanAlloc<char> alloc(this, kTestStringLength);
-  ::memset(alloc.get(), 0, kTestStringLength);
-  char* alloc_ptr = alloc.get();
-  readfile_callback_data = &alloc;
-
-  // Set the callback that we want to use once the internal call to ReadFile
-  // returns.
-  SetInterceptorCallbackFunction(&AsanReadFileCallback);
-
-  // Read from the file using the interceptor, this will call the ReadFile
-  // callback once the internal call to ReadFile returns, and result in freeing
-  // the buffer.
-  DWORD bytes_read = 0;
-  ReadFileFunctionFailing(temp_file_handle_.Get(),
-                          alloc.get(),
-                          kTestStringLength,
-                          &bytes_read,
-                          NULL);
-  EXPECT_EQ(kTestStringLength, bytes_read);
-  EXPECT_STREQ(kTestString, alloc_ptr);
-  EXPECT_TRUE(LogContains(kHeapUseAfterFree));
-
-  SetInterceptorCallbackFunction(NULL);
-}
-
-namespace {
-
-// Helps to test the asan_WriteFile function.
-class AsanRtlWriteFileTest : public testing::TestAsanRtl {
- public:
-  typedef testing::TestAsanRtl Super;
-
-  AsanRtlWriteFileTest()
-      : temp_file_handle_(INVALID_HANDLE_VALUE) {
-  }
-
-  void SetUp() OVERRIDE {
-    Super::SetUp();
-
-    temp_file_handle_.Set(::CreateFile(temp_file_.path().value().c_str(),
-                                       GENERIC_READ | GENERIC_WRITE,
-                                       0,
-                                       NULL,
-                                       OPEN_EXISTING,
-                                       FILE_ATTRIBUTE_NORMAL,
-                                       NULL));
-    ASSERT_NE(INVALID_HANDLE_VALUE, temp_file_handle_.Get());
-    SetCallBackFunction(&AsanErrorCallbackWithoutComparingContext);
-  }
-
-  bool ReadFileContent(std::string* pipe_content, size_t kOffset) {
-    EXPECT_TRUE(pipe_content != NULL);
-    const size_t kMaxContentLength = 64;
-    pipe_content->clear();
-    pipe_content->resize(kMaxContentLength);
-    DWORD bytes_read = 0;
-    ::SetFilePointer(temp_file_handle_.Get(), kOffset, 0, FILE_BEGIN);
-    if (::ReadFile(temp_file_handle_.Get(),
-                   &(*pipe_content)[0],
-                   kMaxContentLength,
-                   &bytes_read,
-                   NULL) == FALSE) {
-      return false;
-    }
-    // Ensures that the buffer is big enough to store the pipe content.
-    EXPECT_TRUE(bytes_read < kMaxContentLength);
-
-    return true;
-  }
-
-  static const char kTestString[];
-  static const size_t kTestStringLength;
-
- protected:
-  testing::ScopedTempFile temp_file_;
-
-  base::win::ScopedHandle temp_file_handle_;
-};
-
-const char AsanRtlWriteFileTest::kTestString[] = "Test of asan_WriteFile";
-const size_t AsanRtlWriteFileTest::kTestStringLength =
-    sizeof(AsanRtlWriteFileTest::kTestString);
-
-}  // namespace
-
-TEST_F(AsanRtlWriteFileTest, AsanWriteFile) {
-  // Test that the function works correctly with valid parameters. In this case
-  // we don't pass an OVERLAPPED structure to the function.
-  DWORD bytes_written = 0;
-  ScopedASanAlloc<char> alloc(this, kTestStringLength);
-  EXPECT_TRUE(WriteFileFunction(temp_file_handle_.Get(),
-                                kTestString,
-                                kTestStringLength,
-                                &bytes_written,
-                                NULL));
-  EXPECT_EQ(kTestStringLength, bytes_written);
-  std::string file_content;
-  EXPECT_TRUE(ReadFileContent(&file_content, 0));
-  EXPECT_STREQ(kTestString, file_content.c_str());
-}
-
-TEST_F(AsanRtlWriteFileTest, AsanWriteFileWithOverlapped) {
-  ScopedASanAlloc<char> alloc(this, kTestStringLength);
-  // Test that the function works correctly with valid parameters. Here we pass
-  // an OVERLAPPED structure to the function, which indicates that we want to do
-  // the write after a given offset.
-  OVERLAPPED overlapped = {};
-  // Start the write from the middle of the test string.
-  const size_t kOffset = kTestStringLength / 2;
-  overlapped.Offset = kOffset;
-  DWORD bytes_written = 0;
-  EXPECT_TRUE(WriteFileFunction(temp_file_handle_.Get(),
-                                kTestString + kOffset,
-                                kTestStringLength - kOffset,
-                                &bytes_written,
-                                &overlapped));
-  EXPECT_EQ(kTestStringLength - kOffset, bytes_written);
-  std::string file_content;
-  EXPECT_TRUE(ReadFileContent(&file_content, kOffset));
-  EXPECT_STREQ(kTestString + kOffset, file_content.c_str());
-}
-
-TEST_F(AsanRtlWriteFileTest, AsanWriteFileOverflow) {
-  // Test that the function works correctly with valid parameters. In this case
-  // we don't pass an OVERLAPPED structure to the function.
-  DWORD bytes_written = 0;
-  ScopedASanAlloc<char> alloc(this, kTestStringLength);
-  strcpy(alloc.get(), kTestString);
-  WriteFileFunctionFailing(temp_file_handle_.Get(),
-                           alloc.get(),
-                           kTestStringLength + 1,
-                           &bytes_written,
-                           NULL);
-  EXPECT_TRUE(LogContains(kHeapBufferOverFlow));
-  std::string file_content;
-}
-
-TEST_F(AsanRtlWriteFileTest, AsanWriteFileUAFOnOverlapped) {
-  // Test an use-after-free on the overlapped structure.
-  ScopedASanAlloc<OVERLAPPED> overlapped(this, sizeof(OVERLAPPED));
-  // Start the write from the middle of the test string.
-  const size_t kOffset = kTestStringLength / 2;
-  overlapped->Offset = kOffset;
-  DWORD bytes_written = 0;
-  OVERLAPPED* overlapped_ptr = overlapped.get();
-  overlapped.reset(NULL);
-  WriteFileFunctionFailing(temp_file_handle_.Get(),
-                           kTestString + kOffset,
-                           kTestStringLength - kOffset,
-                           &bytes_written,
-                           overlapped_ptr);
-  EXPECT_TRUE(LogContains(kHeapUseAfterFree));
-}
-
-TEST_F(AsanRtlWriteFileTest, AsanWriteFileUseAfterFree) {
-  // Test if an use-after-free on the destination buffer is correctly detected.
-  DWORD bytes_written = 0;
-  ScopedASanAlloc<char> alloc(this, kTestStringLength);
-  strcpy(alloc.get(), kTestString);
-  char* alloc_ptr = alloc.get();
-  alloc.reset(NULL);
-  WriteFileFunctionFailing(temp_file_handle_.Get(),
-                           alloc_ptr,
-                           kTestStringLength,
-                           &bytes_written,
-                           NULL);
-  EXPECT_TRUE(LogContains(kHeapUseAfterFree));
-}
-
-namespace {
-
-typedef ScopedASanAlloc<char>* AsanWriteFileCallbackData;
-AsanWriteFileCallbackData writefile_callback_data = NULL;
-
-void AsanWriteFileCallback() {
-  ASSERT_TRUE(writefile_callback_data != NULL);
-  writefile_callback_data->reset(NULL);
-}
-
-}  // namespace
-
-TEST_F(AsanRtlWriteFileTest, AsanWriteFileUAFAfterInternalCall) {
-  // This test makes sure that use-after-free errors on the input buffer given
-  // to the WriteFile function are correctly detected.
-  ScopedASanAlloc<char> alloc(this, kTestStringLength);
-  strcpy(alloc.get(), kTestString);
-
-  writefile_callback_data = &alloc;
-
-  // Set the callback that we want to use once the internal call to WriteFile
-  // returns.
-  SetInterceptorCallbackFunction(&AsanWriteFileCallback);
-
-  // Write to the file using the interceptor, this will call the WriteFile
-  // callback once the internal call to WriteFile returns, and result in freeing
-  // the buffer.
-  DWORD bytes_written = 0;
-  WriteFileFunctionFailing(temp_file_handle_.Get(),
-                           alloc.get(),
-                           kTestStringLength,
-                           &bytes_written,
-                           NULL);
-  EXPECT_EQ(kTestStringLength, bytes_written);
-  EXPECT_TRUE(LogContains(kHeapUseAfterFree));
-
-  std::string file_content;
-  EXPECT_TRUE(ReadFileContent(&file_content, 0));
-  EXPECT_STREQ(kTestString, file_content.c_str());
-
-  SetInterceptorCallbackFunction(NULL);
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/block.cc b/syzygy/agent/asan/block.cc
deleted file mode 100644
index 9ebb82d..0000000
--- a/syzygy/agent/asan/block.cc
+++ /dev/null
@@ -1,486 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/block.h"
-
-#include <algorithm>
-
-#include "base/hash.h"
-#include "base/logging.h"
-#include "syzygy/agent/asan/stack_capture_cache.h"
-#include "syzygy/common/align.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-using common::IsAligned;
-
-// Declares a function that returns the maximum value representable by
-// the given bitfield.
-#define DECLARE_GET_MAX_BITFIELD_VALUE_FUNCTION(Type, FieldName)   \
-  size_t GetMaxValue ## Type ## _ ## FieldName() {  \
-    Type t = {};  \
-    t.FieldName = 0;  \
-    --t.FieldName;  \
-    size_t value = t.FieldName;  \
-    return value;  \
-  }
-DECLARE_GET_MAX_BITFIELD_VALUE_FUNCTION(BlockHeader, body_size);
-#undef DECLARE_GET_MAX_BITFIELD_VALUE_FUNCTION
-
-const size_t kMaxBlockHeaderBodySize = GetMaxValueBlockHeader_body_size();
-
-void InitializeBlockHeader(BlockInfo* block_info) {
-  DCHECK_NE(static_cast<BlockInfo*>(NULL), block_info);
-  DCHECK_NE(static_cast<BlockHeader*>(NULL), block_info->header);
-  ::memset(block_info->header, 0, sizeof(BlockHeader));
-  block_info->header->magic = kBlockHeaderMagic;
-  block_info->header->is_nested = block_info->is_nested;
-  block_info->header->has_header_padding = block_info->header_padding_size > 0;
-  block_info->header->has_excess_trailer_padding =
-      block_info->trailer_padding_size > sizeof(uint32);
-  block_info->header->state = ALLOCATED_BLOCK;
-  block_info->header->body_size = block_info->body_size;
-}
-
-void InitializeBlockHeaderPadding(BlockInfo* block_info) {
-  DCHECK_NE(static_cast<BlockInfo*>(NULL), block_info);
-  if (block_info->header_padding_size == 0)
-    return;
-  DCHECK(IsAligned(block_info->header_padding_size, kShadowRatio));
-  DCHECK(IsAligned(block_info->header_padding_size,
-                   2 * sizeof(uint32)));
-
-  ::memset(block_info->header_padding + sizeof(uint32),
-           kBlockHeaderPaddingByte,
-           block_info->header_padding_size - 2 * sizeof(uint32));
-  uint32* head = reinterpret_cast<uint32*>(block_info->header_padding);
-  uint32* tail = reinterpret_cast<uint32*>(
-      block_info->header_padding + block_info->header_padding_size -
-          sizeof(uint32));
-  *head = block_info->header_padding_size;
-  *tail = block_info->header_padding_size;
-}
-
-void InitializeBlockTrailerPadding(BlockInfo* block_info) {
-  DCHECK_NE(static_cast<BlockInfo*>(NULL), block_info);
-  if (block_info->trailer_padding_size == 0)
-    return;
-  ::memset(block_info->trailer_padding, kBlockTrailerPaddingByte,
-           block_info->trailer_padding_size);
-  if (block_info->trailer_padding_size > (kShadowRatio / 2)) {
-    // This is guaranteed by kShadowRatio being >= 8, but we double check
-    // for sanity's sake.
-    DCHECK_LE(sizeof(uint32), block_info->trailer_padding_size);
-    uint32* head = reinterpret_cast<uint32*>(block_info->trailer_padding);
-    *head = block_info->trailer_padding_size;
-  }
-}
-
-void InitializeBlockTrailer(BlockInfo* block_info) {
-  DCHECK_NE(static_cast<BlockInfo*>(NULL), block_info);
-  ::memset(block_info->trailer, 0, sizeof(BlockTrailer));
-  block_info->trailer->alloc_ticks = ::GetTickCount();
-  block_info->trailer->alloc_tid = ::GetCurrentThreadId();
-}
-
-// Combines the bits of a uint32 into the number of bits used to store the
-// block checksum.
-uint32 CombineUInt32IntoBlockChecksum(uint32 val) {
-  uint32 checksum = 0;
-  while (val != 0) {
-    checksum ^= val;
-    val >>= kBlockHeaderChecksumBits;
-  }
-  checksum &= ((1 << kBlockHeaderChecksumBits) - 1);
-  return checksum;
-}
-
-// An exception filter that only catches access violations.
-DWORD AccessViolationFilter(EXCEPTION_POINTERS* e) {
-  if (e->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION)
-    return EXCEPTION_EXECUTE_HANDLER;
-  return EXCEPTION_CONTINUE_SEARCH;
-}
-
-bool BlockInfoFromMemoryImpl(const void* const_raw_block,
-                             BlockInfo* block_info) {
-  DCHECK_NE(static_cast<void*>(NULL), const_raw_block);
-  DCHECK_NE(static_cast<BlockInfo*>(NULL), block_info);
-
-  void* raw_block = const_cast<void*>(const_raw_block);
-
-  // The raw_block header must be minimally aligned and begin with the expected
-  // magic.
-  if (!IsAligned(reinterpret_cast<uint32>(raw_block), kShadowRatio))
-    return false;
-  BlockHeader* header = reinterpret_cast<BlockHeader*>(raw_block);
-  if (header->magic != kBlockHeaderMagic)
-    return false;
-
-  // Parse the header padding if present.
-  uint32 header_padding_size = 0;
-  if (header->has_header_padding) {
-    uint8* padding = reinterpret_cast<uint8*>(header + 1);
-    uint32* head = reinterpret_cast<uint32*>(padding);
-    header_padding_size = *head;
-    if (!IsAligned(header_padding_size, kShadowRatio))
-      return false;
-    uint32* tail = reinterpret_cast<uint32*>(
-        padding + header_padding_size - sizeof(uint32));
-    if (*head != *tail)
-      return false;
-  }
-
-  // Parse the body.
-  uint8* body = reinterpret_cast<uint8*>(header + 1) + header_padding_size;
-
-  // Parse the trailer padding.
-  uint32 trailer_padding_size = 0;
-  if ((header->body_size % kShadowRatio) != (kShadowRatio / 2)) {
-    trailer_padding_size = (kShadowRatio / 2) -
-        (header->body_size % (kShadowRatio / 2));
-  }
-  if (header->has_excess_trailer_padding) {
-    uint32* head = reinterpret_cast<uint32*>(body + header->body_size);
-    if ((*head % (kShadowRatio / 2)) != trailer_padding_size)
-      return false;
-    trailer_padding_size = *head;
-  }
-
-  // Parse the trailer. The end of it must be 8 aligned.
-  BlockTrailer* trailer = reinterpret_cast<BlockTrailer*>(
-      body + header->body_size + trailer_padding_size);
-  if (!IsAligned(reinterpret_cast<uint32>(trailer + 1), kShadowRatio))
-    return false;
-
-  block_info->block = reinterpret_cast<uint8*>(raw_block);
-  block_info->block_size = reinterpret_cast<uint8*>(trailer + 1)
-      - reinterpret_cast<uint8*>(header);
-  block_info->header = header;
-  block_info->header_padding_size = header_padding_size;
-  block_info->header_padding = block_info->block + sizeof(BlockHeader);
-  block_info->body = body;
-  block_info->body_size = header->body_size;
-  block_info->trailer_padding_size = trailer_padding_size;
-  block_info->trailer_padding = body + header->body_size;
-  block_info->trailer = trailer;
-  block_info->is_nested = header->is_nested;
-
-  BlockIdentifyWholePages(block_info);
-  return true;
-}
-
-BlockHeader* BlockGetHeaderFromBodyImpl(const void* const_body) {
-  DCHECK_NE(static_cast<void*>(NULL), const_body);
-
-  void* body = const_cast<void*>(const_body);
-
-  // The header must be appropriately aligned.
-  if (!IsAligned(reinterpret_cast<uint32>(body), kShadowRatio))
-    return NULL;
-
-  // First assume that there is no padding, and check if a valid block header
-  // is found there.
-  BlockHeader* header = reinterpret_cast<BlockHeader*>(body) - 1;
-  if (header->magic == kBlockHeaderMagic && header->has_header_padding == 0)
-    return header;
-
-  // Otherwise assume there is padding. The padding must be formatted
-  // correctly and have a valid length.
-  uint32* tail = reinterpret_cast<uint32*>(body) - 1;
-  if (*tail == 0 || !IsAligned(*tail, kShadowRatio))
-    return NULL;
-  uint32* head = (tail + 1) - ((*tail) / sizeof(uint32));
-  if (*head != *tail)
-    return NULL;
-
-  // Expect there to be a valid block header.
-  header = reinterpret_cast<BlockHeader*>(head) - 1;
-  if (header->magic == kBlockHeaderMagic && header->has_header_padding == 1)
-    return header;
-
-  // No valid block header was found before the provided body address.
-  return NULL;
-}
-
-}  // namespace
-
-void BlockPlanLayout(size_t chunk_size,
-                     size_t alignment,
-                     size_t size,
-                     size_t min_left_redzone_size,
-                     size_t min_right_redzone_size,
-                     BlockLayout* layout) {
-  DCHECK_LE(kShadowRatio, chunk_size);
-  DCHECK(common::IsPowerOfTwo(chunk_size));
-  DCHECK_LE(kShadowRatio, alignment);
-  DCHECK_GE(chunk_size, alignment);
-  DCHECK(common::IsPowerOfTwo(alignment));
-
-  // Calculate minimum redzone sizes that respect the parameters.
-  size_t left_redzone_size = common::AlignUp(
-      std::max(min_left_redzone_size, sizeof(BlockHeader)),
-      alignment);
-  size_t right_redzone_size = std::max(min_right_redzone_size,
-                                       sizeof(BlockTrailer));
-
-  // Calculate the total size of the allocation.
-  size_t total_size = common::AlignUp(
-      left_redzone_size + size + right_redzone_size, chunk_size);
-
-  // Now figure out the sizes of things such that the body of the allocation is
-  // aligned as close as possible to the beginning of the right redzone while
-  // respecting the body alignment requirements. This favors catching overflows
-  // vs underflows when page protection mechanisms are active.
-  size_t body_trailer_size = size + right_redzone_size;
-  size_t body_trailer_size_aligned = common::AlignUp(body_trailer_size,
-                                                     alignment);
-  size_t body_padding_size = body_trailer_size_aligned - body_trailer_size;
-  right_redzone_size += body_padding_size;
-
-  // The left redzone takes up the rest of the space.
-  left_redzone_size = total_size - right_redzone_size - size;
-
-  // Make sure the basic layout invariants are satisfied.
-  DCHECK_LE(min_left_redzone_size, left_redzone_size);
-  DCHECK_LE(min_right_redzone_size, right_redzone_size);
-  DCHECK_EQ(total_size, (left_redzone_size + size + right_redzone_size));
-  DCHECK(IsAligned(total_size, chunk_size));
-  DCHECK(IsAligned(left_redzone_size, alignment));
-
-  // Fill out the layout structure.
-  layout->block_alignment = chunk_size;
-  layout->block_size = total_size;
-  layout->header_size = sizeof(BlockHeader);
-  layout->header_padding_size = left_redzone_size - sizeof(BlockHeader);
-  layout->body_size = size;
-  layout->trailer_padding_size = right_redzone_size - sizeof(BlockTrailer);
-  layout->trailer_size = sizeof(BlockTrailer);
-}
-
-void BlockInitialize(const BlockLayout& layout,
-                     void* allocation,
-                     bool is_nested,
-                     BlockInfo* block_info) {
-  DCHECK_NE(static_cast<void*>(NULL), allocation);
-  DCHECK(IsAligned(reinterpret_cast<uint32>(allocation),
-                   layout.block_alignment));
-
-  // If no output structure is provided then use a local one. We need the data
-  // locally, but the caller might not be interested in it.
-  BlockInfo local_block_info = {};
-  if (block_info == NULL) {
-    block_info = &local_block_info;
-  } else {
-    ::memset(block_info, 0, sizeof(BlockInfo));
-  }
-
-  // Get pointers to the various components of the block.
-  uint8* cursor = reinterpret_cast<uint8*>(allocation);
-  block_info->block = reinterpret_cast<uint8*>(cursor);
-  block_info->block_size = layout.block_size;
-  block_info->is_nested = is_nested;
-  block_info->header = reinterpret_cast<BlockHeader*>(cursor);
-  cursor += sizeof(BlockHeader);
-  block_info->header_padding = cursor;
-  cursor += layout.header_padding_size;
-  block_info->header_padding_size = layout.header_padding_size;
-  block_info->body = reinterpret_cast<uint8*>(cursor);
-  cursor += layout.body_size;
-  block_info->body_size = layout.body_size;
-  block_info->trailer_padding = cursor;
-  cursor += layout.trailer_padding_size;
-  block_info->trailer_padding_size = layout.trailer_padding_size;
-  block_info->trailer = reinterpret_cast<BlockTrailer*>(cursor);
-
-  // Indicates if the block is nested.
-  block_info->is_nested = is_nested;
-
-  // If the block information is being returned to the user then determine
-  // the extents of whole pages within it.
-  if (block_info != &local_block_info)
-    BlockIdentifyWholePages(block_info);
-
-  // Initialize the various portions of the memory. The body is not initialized
-  // as this is an unnecessary performance hit.
-  InitializeBlockHeader(block_info);
-  InitializeBlockHeaderPadding(block_info);
-  InitializeBlockTrailerPadding(block_info);
-  InitializeBlockTrailer(block_info);
-}
-
-bool BlockInfoFromMemory(const void* raw_block, BlockInfo* block_info) {
-  DCHECK_NE(static_cast<void*>(NULL), raw_block);
-  DCHECK_NE(static_cast<BlockInfo*>(NULL), block_info);
-
-  __try {
-    // As little code as possible is inside the body of the __try so that
-    // our code coverage can instrument it.
-    bool result = BlockInfoFromMemoryImpl(raw_block, block_info);
-    return result;
-  } __except (AccessViolationFilter(GetExceptionInformation())) {  // NOLINT
-    // The block is either corrupt, or the pages are protected.
-    return false;
-  }
-}
-
-BlockHeader* BlockGetHeaderFromBody(const void* body) {
-  DCHECK_NE(static_cast<void*>(NULL), body);
-
-  __try {
-    // As little code as possible is inside the body of the __try so that
-    // our code coverage can instrument it.
-    BlockHeader* header = BlockGetHeaderFromBodyImpl(body);
-    return header;
-  } __except (AccessViolationFilter(GetExceptionInformation())) {  // NOLINT
-    // The block is either corrupt, or the pages are protected.
-    return NULL;
-  }
-}
-
-uint32 BlockCalculateChecksum(const BlockInfo& block_info) {
-  // It is much easier to calculate the checksum in place so this actually
-  // causes the block to be modified, but restores the original value.
-  uint32 old_checksum = block_info.header->checksum;
-  block_info.header->checksum = 0;
-  BlockSetChecksum(block_info);
-  uint32 new_checksum = block_info.header->checksum;
-  block_info.header->checksum = old_checksum;
-  return new_checksum;
-}
-
-bool BlockChecksumIsValid(const BlockInfo& block_info) {
-  uint32 checksum = BlockCalculateChecksum(block_info);
-  if (checksum == block_info.header->checksum)
-    return true;
-  return false;
-}
-
-void BlockSetChecksum(const BlockInfo& block_info) {
-  block_info.header->checksum = 0;
-
-  uint32 checksum = 0;
-  switch (block_info.header->state) {
-    case ALLOCATED_BLOCK: {
-      // Only checksum the header and trailer regions.
-      checksum = base::SuperFastHash(
-          reinterpret_cast<const char*>(block_info.block),
-          block_info.body - block_info.block);
-      checksum ^= base::SuperFastHash(
-          reinterpret_cast<const char*>(block_info.trailer_padding),
-          block_info.block + block_info.block_size -
-              block_info.trailer_padding);
-      break;
-    }
-
-    // The checksum is the calculated in the same way in these two cases.
-    // Similary, the catch all default case is calculated in this way so as to
-    // allow the hash to successfully be calculated even for a block with a
-    // corrupt state.
-    case QUARANTINED_BLOCK:
-    case FREED_BLOCK:
-    default: {
-      checksum = base::SuperFastHash(
-          reinterpret_cast<const char*>(block_info.block),
-          block_info.block_size);
-      break;
-    }
-  }
-
-  checksum = CombineUInt32IntoBlockChecksum(checksum);
-  DCHECK_EQ(0u, checksum >> kBlockHeaderChecksumBits);
-  block_info.header->checksum = checksum;
-}
-
-void BlockProtectNone(const BlockInfo& block_info) {
-  if (block_info.block_pages_size == 0)
-    return;
-  DWORD old_protection = 0;
-  DWORD ret = ::VirtualProtect(block_info.block_pages,
-                               block_info.block_pages_size,
-                               PAGE_READWRITE, &old_protection);
-  DCHECK_NE(0u, ret);
-}
-
-void BlockProtectRedzones(const BlockInfo& block_info) {
-  BlockProtectNone(block_info);
-
-  // Protect the left redzone pages if any.
-  DWORD old_protection = 0;
-  DWORD ret = 0;
-  if (block_info.left_redzone_pages_size > 0) {
-    ret = ::VirtualProtect(block_info.left_redzone_pages,
-                           block_info.left_redzone_pages_size,
-                           PAGE_NOACCESS, &old_protection);
-    DCHECK_NE(0u, ret);
-  }
-
-  // Protect the right redzone pages if any.
-  if (block_info.right_redzone_pages_size > 0) {
-    ret = ::VirtualProtect(block_info.right_redzone_pages,
-                           block_info.right_redzone_pages_size,
-                           PAGE_NOACCESS, &old_protection);
-    DCHECK_NE(0u, ret);
-  }
-}
-
-void BlockProtectAll(const BlockInfo& block_info) {
-  if (block_info.block_pages_size == 0)
-    return;
-  DWORD old_protection = 0;
-  DWORD ret = ::VirtualProtect(block_info.block_pages,
-                               block_info.block_pages_size,
-                               PAGE_NOACCESS, &old_protection);
-  DCHECK_NE(0u, ret);
-}
-
-// Identifies whole pages in the given block_info.
-void BlockIdentifyWholePages(BlockInfo* block_info) {
-  DCHECK_NE(static_cast<BlockInfo*>(NULL), block_info);
-
-  if (block_info->block_size < kPageSize)
-    return;
-
-  uint32 alloc_start = reinterpret_cast<uint32>(block_info->block);
-  uint32 alloc_end = alloc_start + block_info->block_size;
-  alloc_start = common::AlignUp(alloc_start, kPageSize);
-  alloc_end = common::AlignDown(alloc_end, kPageSize);
-  if (alloc_start >= alloc_end)
-    return;
-
-  block_info->block_pages = reinterpret_cast<uint8*>(alloc_start);
-  block_info->block_pages_size = alloc_end - alloc_start;
-
-  uint32 left_redzone_end = reinterpret_cast<uint32>(block_info->body);
-  uint32 right_redzone_start = left_redzone_end + block_info->body_size;
-  left_redzone_end = common::AlignDown(left_redzone_end, kPageSize);
-  right_redzone_start = common::AlignUp(right_redzone_start, kPageSize);
-
-  if (alloc_start < left_redzone_end) {
-    block_info->left_redzone_pages = reinterpret_cast<uint8*>(alloc_start);
-    block_info->left_redzone_pages_size = left_redzone_end - alloc_start;
-  }
-
-  if (right_redzone_start < alloc_end) {
-    block_info->right_redzone_pages =
-        reinterpret_cast<uint8*>(right_redzone_start);
-    block_info->right_redzone_pages_size = alloc_end - right_redzone_start;
-  }
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/block.h b/syzygy/agent/asan/block.h
deleted file mode 100644
index 35ed997..0000000
--- a/syzygy/agent/asan/block.h
+++ /dev/null
@@ -1,343 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Describes and declares an ASan block, which is fundamentally a single
-// instrumented allocation of memory.
-//
-// Under ASan instrumentation allocations are instrumented with leading
-// (left) and trailing (right) redzones. The left redzone contains a
-// BlockHeader, while the right redzone contains a BlockTrailer. Each of
-// these contain metadata about the allocation itself. In both cases the
-// redzones may be larger than the headers they contain. Visually, a block is
-// laid out as follows:
-//
-//   +------------------+  <-- N>=8 aligned \
-//   |      header      |                   |
-//   +------------------+                   |- left redzone
-//   |  header padding  |                   |  (mod 8 in size)
-//   |    (optional)    |                   /
-//   +------------------+  <-- N>=8 aligned
-//   |       body       |
-//   +------------------+
-//   | trailer padding  |                   \
-//   |    (optional)    |                   |_ right redzone
-//   +------------------+                   |
-//   |     trailer      |                   /
-//   +------------------+  <-- N>=8 aligned
-//
-// The information contained in the block headers is insufficient to recover
-// the block extents. However, sufficiently detailed bookkeeping information is
-// maintained in the shadow memory to allow inferring this data given a block
-// pointer.
-//
-// NAVIGATING A BLOCK
-//
-// If the block is not corrupt it contains sufficient information to navigate
-// the various components simply from inspecting the contents of memory itself.
-//
-// In the absence of any header padding the body immediately follows the
-// header, and the length of the body is encoded directly in the header. The
-// header has a bit indicating the presence of header padding. If present it
-// has a length of at least kShadowRatio[1], and encodes the total length of
-// the padding in the first 4 *and* last 4 bytes of the padding. This makes it
-// possible to navigate in O(1) time from the body to the header and vice
-// versa.
-//
-// There is always some implicit minimal amount of trailer padding required to
-// flesh out the block body such that the end of the trailer is properly
-// aligned. Another header bit indicates if there is more than this implicit
-// padding present. If so, the trailer padding length is explicitly encoded in
-// the first 4 bytes of the trailer padding. Either way it is possible to
-// navigate to the beginning of the trailer.
-//
-// The rest of the header and trailer padding are filled with constant values
-// as a visual debugging aid. An example block (with body of size 16, header
-// padding of size 16, and trailer padding of 12) is shown in memory:
-//
-//   | 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
-// --+------------------------------------------------
-// 00| 80 CA .. .. .. .. .. .. .. .. .. .. .. .. .. ..
-//   | magic \______________header data______________/
-// 10| 10 00 00 00 1C 1C 1C 1C 1C 1C 1C 1C 10 00 00 00
-//   | \_length__/ \____padding bytes____/ \_length__/
-// 20| .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
-//   | \____________________body_____________________/
-// 30| 0C 00 00 00 C3 C3 C3 C3 C3 C3 C3 C3 .. .. .. ..
-//   | \_length__/ \____padding bytes____/ \___trailer
-// 40| .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
-//   | _________________trailer data_________________/
-//
-// [1] kShadowRatio: The ratio of main memory to shadow memory. This many
-//     bytes of main memory map to a single byte of shadow memory. Currently
-//     8:1, but may be higher.
-
-#ifndef SYZYGY_AGENT_ASAN_BLOCK_H_
-#define SYZYGY_AGENT_ASAN_BLOCK_H_
-
-#include "base/basictypes.h"
-#include "syzygy/agent/asan/constants.h"
-#include "syzygy/agent/asan/heap_manager.h"
-
-namespace agent {
-namespace asan {
-
-// Forward declarations.
-class StackCapture;
-struct BlockLayout;
-
-// Various constants for identifying the beginnings of regions of memory.
-static const uint16 kBlockHeaderMagic = 0xCA80;
-
-// Various constants used for filling regions of memory.
-static const uint8 kBlockHeaderPaddingByte = 0x1C;
-static const uint8 kBlockTrailerPaddingByte = 0xC3;
-
-// The number of bits in the checksum field. This is parameterized so that
-// it can be referred to by the checksumming code.
-static const size_t kBlockHeaderChecksumBits = 13;
-
-// The state of an ASan block. These are in the order that reflects the typical
-// lifespan of an allocation.
-enum BlockState {
-  // The block is allocated and valid for reading/writing.
-  ALLOCATED_BLOCK,
-  // The block has been quarantined, and not valid for reading/writing.
-  // While in the quarantine it is still allocated as far as the underlying
-  // heap is concerned, and won't be reclaimed.
-  QUARANTINED_BLOCK,
-  // The block has been returned to the heap and is eligible to be reused
-  // in a future allocation. In the meantime it is still not valid for
-  // reading and writing.
-  FREED_BLOCK,
-};
-
-// Declares the block header that is found in every left redzone. Since
-// overwrites are far more common than underwrites critical information should
-// be stored here.
-#pragma pack(push, 1)
-struct BlockHeader {
-  struct {
-    // A magic constant that identifies the block header in memory.
-    unsigned magic : 16;
-    // The checksum of the entire block. The semantics of this vary with the
-    // block state.
-    unsigned checksum : kBlockHeaderChecksumBits;
-    // If this bit is set then the block is a nested block.
-    unsigned is_nested : 1;
-    // If this bit is positive then header padding is present. The size of the
-    // header padding is encoded in the padding itself.
-    unsigned has_header_padding : 1;
-    // If this bit is positive then trailer padding in excess of
-    // kShadowRatio/2 is present, and the size of the trailer padding itself
-    // will be encoded in these bytes. Otherwise it is implicit as
-    // (kShadowRatio / 2) - (body_size % (kShadowRatio / 2)).
-    unsigned has_excess_trailer_padding : 1;
-    // This is implicitly a BlockState value.
-    unsigned state : 2;
-    // The size of the body of the allocation, in bytes.
-    unsigned body_size : 30;
-  };
-  // The allocation stack of this block.
-  const StackCapture* alloc_stack;
-  // The free stack of this block (NULL if not yet quarantined/freed).
-  const StackCapture* free_stack;
-};
-#pragma pack(pop)
-COMPILE_ASSERT((sizeof(BlockHeader) % kShadowRatio) == 0,
-               invalid_BlockHeader_mod_size);
-COMPILE_ASSERT(sizeof(BlockHeader) == 16, invalid_BlockHeader_size);
-
-// Declares the block trailer that is found in every right redzone.
-// This should ideally be a multiple of size (n + 1/2) * kShadowRatio. This
-// is because on average we have half of kShadowRatio as padding trailing
-// the body of the allocation. This takes advantage of it, without incurring
-// additional penalty on allocation overhead (on average). As of late 2013
-// this is supported by the actual distribution of allocations in Chrome.
-#pragma pack(push, 1)
-struct BlockTrailer {
-  // The IDs of the threads that allocated/freed the block. If the block is
-  // not yet quarantined/freed then |free_tid| is zero.
-  // TODO(chrisha): Make these thread serial numbers, to deal with thread
-  //     number reuse. This can be accomplished in the agent via the existing
-  //     thread attach/detach callbacks.
-  uint32 alloc_tid;
-  uint32 free_tid;
-  // The time at which the block was allocated. Combined with the address of
-  // the block itself this acts as a (unique with high probability) serial
-  // number for the block (especially if the heap is lazy to reuse
-  // allocations).
-  uint32 alloc_ticks;
-  // The time at which the block was freed (zero if not yet freed).
-  uint32 free_ticks;
-  // The ID of the heap that allocated the block.
-  uint32 heap_id;
-};
-#pragma pack(pop)
-COMPILE_ASSERT((sizeof(BlockTrailer) % kShadowRatio) == (kShadowRatio / 2),
-               invalid_BlockTrailer_mod_size);
-COMPILE_ASSERT(sizeof(BlockTrailer) == 20, invalid_BlockTrailer_size);
-
-// A struct for initializing, modifying and navigating the various portions
-// of an allocated block. This can be initialized as part of the creation of
-// a new block, inferred from an in-memory investigation of an existing block
-// (assuming no corruption), or from an investigation of the shadow memory.
-struct BlockInfo {
-  // Points to the beginning of the entire allocation.
-  uint8* block;
-  // The size of the entire allocation.
-  size_t block_size;
-
-  // Left redzone. If there's no padding |header_padding| and |body| will
-  // point to the same location, and |header_padding_size| will be zero.
-  BlockHeader* header;
-  uint8* header_padding;
-  size_t header_padding_size;
-
-  // Body of the allocation.
-  uint8* body;
-  size_t body_size;
-
-  // Right redzone. If there's no padding |trailer_padding| and |trailer| will
-  // point to the same location, and |trailer_padding_size| will be zero.
-  uint8* trailer_padding;
-  size_t trailer_padding_size;
-  BlockTrailer* trailer;
-
-  // Pages of memory that are *exclusive* to this block. These pages may be a
-  // strict subset of the entire block, depending on how it was allocated.
-  // These pages will have protections toggled as the block changes state.
-  uint8* block_pages;
-  size_t block_pages_size;
-  uint8* left_redzone_pages;
-  size_t left_redzone_pages_size;
-  uint8* right_redzone_pages;
-  size_t right_redzone_pages_size;
-
-  // Indicates if the block is nested.
-  bool is_nested;
-};
-
-// Plans the layout of a block given allocation requirements. The layout will
-// be of minimum size to respect the requested requirements. Padding will be
-// introduced to respect alignment constraints, and it will be added strictly
-// between the allocation body and the header/trailer (this lowers the
-// likelihood of over/underflows corrupting the metadata).
-// @param chunk_size The allocation will be assumed to be made with this
-//     alignment, and will be a multiple of this in length. Must be a power of
-//     2, and >= kShadowRatio.
-// @param alignment The minimum alignment that the body of the allocation must
-//     respect. This must be a power of two and satisfy
-//     kShadowRatio <= |alignment| <= |chunk_size|.
-// @param size The size of the body of the allocation. Can be 0.
-// @param min_left_redzone_size The minimum size of the left redzone.
-// @param min_right_redzone_size The minimum size of the right redzone.
-// @param layout The layout structure to be populated.
-void BlockPlanLayout(size_t chunk_size,
-                     size_t alignment,
-                     size_t size,
-                     size_t min_left_redzone_size,
-                     size_t min_right_redzone_size,
-                     BlockLayout* layout);
-
-// Given a fresh allocation and a block layout, lays out and initializes the
-// given block. Initializes everything except for the allocation stack and the
-// checksum. Initializes the block to the ALLOCATED_BLOCK state, setting
-// |alloc_ticks| and |alloc_tid|. Sets |alloc_stack| to NULL; the caller should
-// set this stack upon return so as to minimize the number of useless frames on
-// the stack. Does not set the checksum.
-// @param layout The layout to be respected.
-// @param allocation The allocation to be filled in. This must be of
-//     |layout.block_size| in size, and be aligned with
-//     |layout.block_alignment|.
-// @param is_nested Indicates if the block is nested.
-// @param block_info Will be filled in with pointers to the various portions
-//     of the block. May be NULL.
-// @note The pages containing the block must be writable and readable.
-void BlockInitialize(const BlockLayout& layout,
-                     void* allocation,
-                     bool is_nested,
-                     BlockInfo* block_info);
-
-// Given a pointer to a block examines memory and extracts the block layout.
-// This protects against invalid memory accesses that may occur as a result of
-// block corruption, or the block pages being protected; in case of error,
-// this will return false.
-// TODO(chrisha): Create an equivalent function for parsing a block layout
-//     from the shadow memory contents.
-// @param raw_block A pointer to the beginning of the block.
-// @param block_info The description of the block to be populated.
-// @returns true if a valid block was encountered at the provided location,
-//     false otherwise.
-bool BlockInfoFromMemory(const void* raw_block, BlockInfo* block_info);
-
-// Given a block body, finds the header. To find any other part of the
-// block first parse it using ParseBlockFromMemory. This protects against
-// invalid memory accesses that may occur as a result of block corruption,
-// or the block pages being protected; in case of error, this will return
-// NULL.
-// @param body The body of the block.
-// @returns a pointer to the block header, NULL if it was not found or in
-//     case of error.
-BlockHeader* BlockGetHeaderFromBody(const void* body);
-
-// @name Checksum related functions.
-// @{
-// Calculates the checksum for the given block. This causes the contents
-// of the block header to be modified temporarily while calculating the
-// checksum, and as such is not thread safe.
-// @param block_info The block to be checksummed.
-// @returns the calculated checksum.
-// @note The pages containing the block must be writable and readable.
-uint32 BlockCalculateChecksum(const BlockInfo& block_info);
-
-// Determines if the block checksum is valid.
-// @param block_info The block to be validated.
-// @returns true on success, false otherwise.
-// @note The pages containing the block must be writable and readable.
-bool BlockChecksumIsValid(const BlockInfo& block_info);
-
-// Calculates and sets the block checksum in place.
-// @param block_info The block to be checksummed.
-// @note The pages containing the block must be writable and readable.
-void BlockSetChecksum(const BlockInfo& block_info);
-// @}
-
-// @name Page protection functions.
-// @{
-// Unprotects all pages fully covered by the given block. All pages
-// intersecting but not fully covered by the block will be left in their
-// current state.
-// @param block_info The block whose protections are to be modified.
-void BlockProtectNone(const BlockInfo& block_info);
-
-// Protects all entire pages that are spanned by the redzones of the
-// block. All pages intersecting the body of the block will be explicitly
-// unprotected. All pages not intersecting the body but only partially
-// covered by the redzone will be left in their current state.
-// @param block_info The block whose protections are to be modified.
-void BlockProtectRedzones(const BlockInfo& block_info);
-
-// Protects all pages completely spanned by the block. All pages
-// intersecting but not fully covered by the block will be left in their
-// current state.
-// @param block_info The block whose protections are to be modified.
-void BlockProtectAll(const BlockInfo& block_info);
-// @}
-
-}  // namespace asan
-}  // namespace agent
-
-#include "syzygy/agent/asan/block_impl.h"
-
-#endif  // SYZYGY_AGENT_ASAN_BLOCK_H_
diff --git a/syzygy/agent/asan/block_impl.h b/syzygy/agent/asan/block_impl.h
deleted file mode 100644
index b15bb0b..0000000
--- a/syzygy/agent/asan/block_impl.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Internal implementation details for block.h. Not meant to be included
-// directly.
-
-#ifndef SYZYGY_AGENT_ASAN_BLOCK_IMPL_H_
-#define SYZYGY_AGENT_ASAN_BLOCK_IMPL_H_
-
-namespace agent {
-namespace asan {
-
-// Forward declaration.
-struct BlockInfo;
-
-// A structure describing the layout of a block. This is largely implementation
-// detail, but exposed for unittesting. As far as the user is concerned this is
-// an opaque blob.
-struct BlockLayout {
-  // The alignment of the entire block.
-  size_t block_alignment;
-  // The size of the entire block (the rest of the fields summed).
-  size_t block_size;
-
-  // Left redzone.
-  size_t header_size;
-  size_t header_padding_size;
-  // Body.
-  size_t body_size;
-  // Right redzone.
-  size_t trailer_padding_size;
-  size_t trailer_size;
-};
-
-// Identifies whole pages that are spanned by the redzones and body of the
-// given block. Directly sets the various *_pages* fields in @p block_info.
-// @param block_info The block information to be inspected and modified.
-// @note This is exposed as a convience function, but it is not meant to be
-//     directly called by the user.
-void BlockIdentifyWholePages(BlockInfo* block_info);
-
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_BLOCK_IMPL_H_
diff --git a/syzygy/agent/asan/block_unittest.cc b/syzygy/agent/asan/block_unittest.cc
deleted file mode 100644
index 9168d69..0000000
--- a/syzygy/agent/asan/block_unittest.cc
+++ /dev/null
@@ -1,772 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/block.h"
-
-#include "windows.h"
-
-#include "base/debug/alias.h"
-#include "base/memory/scoped_ptr.h"
-#include "gtest/gtest.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-BlockLayout BuildBlockLayout(size_t block_alignment,
-                             size_t block_size,
-                             size_t header_size,
-                             size_t header_padding_size,
-                             size_t body_size,
-                             size_t trailer_padding_size,
-                             size_t trailer_size) {
-  BlockLayout layout = { block_alignment, block_size, header_size,
-      header_padding_size, body_size, trailer_padding_size, trailer_size };
-  return layout;
-}
-
-// Checks that the given block is valid, and initialized as expected.
-void IsValidBlockImpl(const BlockInfo& block, bool just_initialized) {
-  EXPECT_EQ(0u, block.block_size % kShadowRatio);
-
-  // Validate the layout of the block.
-  EXPECT_TRUE(block.block != NULL);
-  EXPECT_EQ(0u, block.block_size % kShadowRatio);
-  EXPECT_EQ(block.block, reinterpret_cast<void*>(block.header));
-  EXPECT_EQ(0u, block.header_padding_size % kShadowRatio);
-  EXPECT_EQ(reinterpret_cast<uint8*>(block.header + 1),
-            block.header_padding);
-  EXPECT_EQ(block.header_padding + block.header_padding_size,
-            block.body);
-  EXPECT_EQ(reinterpret_cast<uint8*>(block.body + block.body_size),
-            block.trailer_padding);
-  EXPECT_EQ(block.trailer_padding + block.trailer_padding_size,
-            reinterpret_cast<uint8*>(block.trailer));
-  EXPECT_EQ(block.block + block.block_size,
-            reinterpret_cast<uint8*>(block.trailer + 1));
-
-  // Validate the actual contents of the various parts of the block.
-
-  // Check the header.
-  EXPECT_EQ(kBlockHeaderMagic, block.header->magic);
-  EXPECT_FALSE(block.header->is_nested);
-  EXPECT_LT(0u, block.header->body_size);
-  EXPECT_EQ(block.header->body_size, block.body_size);
-  if (just_initialized) {
-    EXPECT_EQ(0u, block.header->checksum);
-    EXPECT_EQ(NULL, block.header->alloc_stack);
-    EXPECT_EQ(NULL, block.header->free_stack);
-    EXPECT_EQ(ALLOCATED_BLOCK, block.header->state);
-  }
-
-  // By default we assume the blocks to not be nested.
-  EXPECT_FALSE(block.header->is_nested);
-  EXPECT_EQ(static_cast<bool>(block.header->is_nested), block.is_nested);
-
-  // Check the header padding.
-  if (block.header->has_header_padding) {
-    EXPECT_LE(kShadowRatio, block.header_padding_size);
-    EXPECT_EQ(block.header_padding_size,
-              *reinterpret_cast<const uint32*>(block.header_padding));
-    EXPECT_EQ(block.header_padding_size,
-              *reinterpret_cast<const uint32*>(block.header_padding +
-                  block.header_padding_size - sizeof(uint32)));
-    for (size_t i = sizeof(uint32);
-         i < block.header_padding_size - sizeof(uint32);
-         ++i) {
-      EXPECT_EQ(kBlockHeaderPaddingByte, block.header_padding[i]);
-    }
-  }
-
-  // Check the trailer padding.
-  size_t start_of_trailer_iteration = 0;
-  if (block.header->has_excess_trailer_padding) {
-    start_of_trailer_iteration = 4;
-    EXPECT_EQ(block.trailer_padding_size,
-              *reinterpret_cast<const uint32*>(block.trailer_padding));
-  }
-  for (size_t i = start_of_trailer_iteration; i < block.trailer_padding_size;
-       ++i) {
-    EXPECT_EQ(kBlockTrailerPaddingByte, block.trailer_padding[i]);
-  }
-
-  // Check the trailer.
-  EXPECT_NE(0u, block.trailer->alloc_tid);
-  EXPECT_GE(::GetTickCount(), block.trailer->alloc_ticks);
-  if (just_initialized) {
-    EXPECT_EQ(0u, block.trailer->free_tid);
-    EXPECT_EQ(0u, block.trailer->free_ticks);
-  }
-}
-
-void IsValidInitializedBlock(const BlockInfo& block) {
-  IsValidBlockImpl(block, true);
-}
-
-void IsValidBlock(const BlockInfo& block) {
-  IsValidBlockImpl(block, false);
-}
-
-}  // namespace
-
-bool operator==(const BlockLayout& bl1, const BlockLayout& bl2) {
-  return ::memcmp(&bl1, &bl2, sizeof(BlockLayout)) == 0;
-}
-
-bool operator==(const BlockInfo& bi1, const BlockInfo& bi2) {
-  return ::memcmp(&bi1, &bi2, sizeof(BlockInfo)) == 0;
-}
-
-TEST(BlockTest, BlockPlanLayout) {
-  BlockLayout layout = {};
-
-  // Zero sized allocations should work fine.
-  BlockPlanLayout(8, 8, 0, 0, 0, &layout);
-  EXPECT_EQ(BuildBlockLayout(8, 40, 16, 0, 0, 4, 20), layout);
-
-  BlockPlanLayout(8, 8, 60, 32, 32, &layout);
-  EXPECT_EQ(BuildBlockLayout(8, 128, 16, 16, 60, 16, 20), layout);
-
-  BlockPlanLayout(8, 8, 60, 0, 0, &layout);
-  EXPECT_EQ(BuildBlockLayout(8, 96, 16, 0, 60, 0, 20), layout);
-
-  BlockPlanLayout(8, 8, 64, 0, 0, &layout);
-  EXPECT_EQ(BuildBlockLayout(8, 104, 16, 0, 64, 4, 20), layout);
-
-  BlockPlanLayout(8, 8, 61, 0, 0, &layout);
-  EXPECT_EQ(BuildBlockLayout(8, 104, 16, 0, 61, 7, 20), layout);
-
-  // Plan a layout that would use guard pages.
-  BlockPlanLayout(4096, 8, 100, 4096, 4096, &layout);
-  EXPECT_EQ(BuildBlockLayout(4096, 3 * 4096, 16, 8072, 100, 4080, 20), layout);
-}
-
-TEST(BlockTest, EndToEnd) {
-  BlockLayout layout = {};
-  BlockInfo block_info = {};
-
-  BlockPlanLayout(8, 8, 4, 0, 0, &layout);
-  void* block_data = ::malloc(layout.block_size);
-  ASSERT_TRUE(block_data != NULL);
-  BlockInitialize(layout, block_data, false, &block_info);
-  EXPECT_NO_FATAL_FAILURE(IsValidInitializedBlock(block_info));
-  ::free(block_data);
-  block_data = NULL;
-
-  BlockPlanLayout(8, 8, 61, 0, 0, &layout);
-  block_data = ::malloc(layout.block_size);
-  ASSERT_TRUE(block_data != NULL);
-  BlockInitialize(layout, block_data, false, &block_info);
-  EXPECT_NO_FATAL_FAILURE(IsValidInitializedBlock(block_info));
-  ::free(block_data);
-  block_data = NULL;
-
-  BlockPlanLayout(8, 8, 60, 32, 32, &layout);
-  block_data = ::malloc(layout.block_size);
-  ASSERT_TRUE(block_data != NULL);
-  BlockInitialize(layout, block_data, false, &block_info);
-  EXPECT_NO_FATAL_FAILURE(IsValidInitializedBlock(block_info));
-  ::free(block_data);
-  block_data = NULL;
-
-  // Do an allocation that uses entire pages.
-  BlockPlanLayout(4096, 8, 100, 4096, 4096, &layout);
-  block_data = ::VirtualAlloc(NULL, layout.block_size, MEM_COMMIT,
-                              PAGE_READWRITE);
-  ASSERT_TRUE(block_data != NULL);
-  BlockInitialize(layout, block_data, false, &block_info);
-  EXPECT_NO_FATAL_FAILURE(IsValidInitializedBlock(block_info));
-  ASSERT_EQ(TRUE, ::VirtualFree(block_data, 0, MEM_RELEASE));
-  block_data = NULL;
-}
-
-TEST(BlockTest, GetHeaderFromBody) {
-  // Plan two layouts, one with header padding and another without.
-  BlockLayout layout1 = {};
-  BlockLayout layout2 = {};
-  BlockPlanLayout(kShadowRatio, kShadowRatio, 10, 0, 0, &layout1);
-  BlockPlanLayout(kShadowRatio, kShadowRatio, 10, 32, 0, &layout2);
-
-  uint8* data = new uint8[layout2.block_size];
-
-  // First try navigating a block without header padding.
-  BlockInfo info = {};
-  BlockInitialize(layout1, data, false, &info);
-  // This should succeed as expected.
-  EXPECT_EQ(info.header, BlockGetHeaderFromBody(info.body));
-  // This fails because of invalid alignment.
-  EXPECT_TRUE(BlockGetHeaderFromBody(info.body + 1) == NULL);
-  // This fails because the pointer is not at the beginning of the
-  // body.
-  EXPECT_TRUE(BlockGetHeaderFromBody(info.body + 8) == NULL);
-  // This fails because of invalid header magic.
-  ++info.header->magic;
-  EXPECT_TRUE(BlockGetHeaderFromBody(info.body) == NULL);
-  // This fails because the header indicates there's padding.
-  --info.header->magic;
-  info.header->has_header_padding = 1;
-  EXPECT_TRUE(BlockGetHeaderFromBody(info.body) == NULL);
-
-  // Now navigate a block with header padding.
-  BlockInitialize(layout2, data, false, &info);
-  // This should succeed as expected.
-  EXPECT_EQ(info.header, BlockGetHeaderFromBody(info.body));
-  // This fails because of invalid alignment.
-  EXPECT_TRUE(BlockGetHeaderFromBody(info.body + 1) == NULL);
-  // This fails because the pointer is not at the beginning of the
-  // body.
-  EXPECT_TRUE(BlockGetHeaderFromBody(info.body + 8) == NULL);
-  // This fails because of invalid header magic.
-  ++info.header->magic;
-  EXPECT_TRUE(BlockGetHeaderFromBody(info.body) == NULL);
-  // This fails because the header indicates there's no padding.
-  --info.header->magic;
-  info.header->has_header_padding = 0;
-  EXPECT_TRUE(BlockGetHeaderFromBody(info.body) == NULL);
-  // This fails because the padding length is invalid.
-  info.header->has_header_padding = 1;
-  uint32* head = reinterpret_cast<uint32*>(info.header_padding);
-  uint32* tail = head + (info.header_padding_size / sizeof(uint32)) - 1;
-  ++(*tail);
-  EXPECT_TRUE(BlockGetHeaderFromBody(info.body) == NULL);
-  // This fails because the padding lengths don't agree.
-  --(*tail);
-  ++(*head);
-  EXPECT_TRUE(BlockGetHeaderFromBody(info.body) == NULL);
-
-  delete[] data;
-}
-
-TEST(BlockTest, GetHeaderFromBodyProtectedMemory) {
-  BlockLayout layout = {};
-  BlockPlanLayout(4096, 4096, 4096, 4096, 4096, &layout);
-  void* alloc = ::VirtualAlloc(NULL, layout.block_size, MEM_COMMIT,
-                               PAGE_READWRITE);
-  ASSERT_TRUE(alloc != NULL);
-  BlockInfo block_info = {};
-  BlockInitialize(layout, alloc, false, &block_info);
-
-  BlockProtectRedzones(block_info);
-  EXPECT_TRUE(BlockGetHeaderFromBody(block_info.body) == NULL);
-
-  ASSERT_EQ(TRUE, ::VirtualFree(alloc, 0, MEM_RELEASE));
-}
-
-TEST(BlockTest, BlockInfoFromMemory) {
-  // Plan two layouts, one with header padding and another without.
-  BlockLayout layout1 = {};
-  BlockLayout layout2 = {};
-  BlockPlanLayout(kShadowRatio, kShadowRatio, 10, 0, 0, &layout1);
-  BlockPlanLayout(kShadowRatio, kShadowRatio, 10, 32, 0, &layout2);
-
-  scoped_ptr<uint8> data(new uint8[layout2.block_size]);
-
-  // First recover a block without header padding.
-  BlockInfo info = {};
-  BlockInitialize(layout1, data.get(), false, &info);
-  BlockInfo info_recovered = {};
-  EXPECT_TRUE(BlockInfoFromMemory(info.block, &info_recovered));
-  EXPECT_EQ(info, info_recovered);
-  // Failed because its not aligned.
-  EXPECT_FALSE(BlockInfoFromMemory(info.block + 1, &info_recovered));
-  // Failed because the magic is invalid.
-  ++info.header->magic;
-  EXPECT_FALSE(BlockInfoFromMemory(info.block, &info_recovered));
-  --info.header->magic;
-  // This fails because the header indicates there's padding yet there is
-  // none.
-  info.header->has_header_padding = 1;
-  EXPECT_FALSE(BlockInfoFromMemory(info.block, &info_recovered));
-
-  // Now recover a block with header padding.
-  BlockInitialize(layout2, data.get(), false, &info);
-  EXPECT_TRUE(BlockInfoFromMemory(info.block, &info_recovered));
-  EXPECT_EQ(info, info_recovered);
-  // Failed because the magic is invalid.
-  ++info.header->magic;
-  EXPECT_FALSE(BlockInfoFromMemory(info.block, &info_recovered));
-  --info.header->magic;
-  // Failed because the header padding lengths don't match.
-  uint32* head = reinterpret_cast<uint32*>(info.header_padding);
-  uint32* tail = head + (info.header_padding_size / sizeof(uint32)) - 1;
-  ++(*tail);
-  EXPECT_FALSE(BlockInfoFromMemory(info.block, &info_recovered));
-  --(*tail);
-
-  // Finally ensure that we can recover information about blocks of various
-  // sizes.
-  for (size_t block_size = 0; block_size < kShadowRatio * 2; ++block_size) {
-    BlockLayout layout = {};
-    BlockPlanLayout(kShadowRatio, kShadowRatio, block_size, 0, 0, &layout);
-    data.reset(new uint8[layout.block_size]);
-    BlockInitialize(layout, data.get(), false, &info);
-    EXPECT_TRUE(BlockInfoFromMemory(info.block, &info_recovered));
-    EXPECT_EQ(info.body_size, info_recovered.body_size);
-    EXPECT_EQ(info, info_recovered);
-  }
-}
-
-TEST(BlockTest, BlockInfoFromMemoryProtectedMemory) {
-  BlockLayout layout = {};
-  BlockPlanLayout(4096, 4096, 4096, 4096, 4096, &layout);
-  void* alloc = ::VirtualAlloc(NULL, layout.block_size, MEM_COMMIT,
-                               PAGE_READWRITE);
-  ASSERT_TRUE(alloc != NULL);
-  BlockInfo block_info = {};
-  BlockInitialize(layout, alloc, false, &block_info);
-
-  BlockProtectRedzones(block_info);
-  BlockInfo recovered_info = {};
-  EXPECT_FALSE(BlockInfoFromMemory(block_info.block, &recovered_info));
-
-  ASSERT_EQ(TRUE, ::VirtualFree(alloc, 0, MEM_RELEASE));
-}
-
-TEST(BlockTest, BlockInfoFromMemoryForNestedBlock) {
-  BlockLayout layout = {};
-  BlockPlanLayout(kShadowRatio, kShadowRatio, 10, 0, 0, &layout);
-
-  scoped_ptr<uint8> data(new uint8[layout.block_size]);
-  BlockInfo block_info = {};
-  BlockInitialize(layout, data.get(), true, &block_info);
-
-  BlockInfo recovered_info = {};
-  EXPECT_TRUE(BlockInfoFromMemory(block_info.block, &recovered_info));
-
-  EXPECT_TRUE(recovered_info.is_nested);
-  EXPECT_TRUE(recovered_info.header->is_nested);
-}
-
-TEST(BlockTest, ChecksumWorksForAllStates) {
-  BlockLayout layout = {};
-  BlockPlanLayout(kShadowRatio, kShadowRatio, 10, 0, 0, &layout);
-  uint8* data = new uint8[layout.block_size];
-  BlockInfo info = {};
-  BlockInitialize(layout, data, false, &info);
-  while (true) {
-    BlockCalculateChecksum(info);
-    ++info.header->state;
-    if (info.header->state == 0)
-      break;
-  }
-  delete[] data;
-}
-
-namespace {
-
-// Given two arrays of data, compares them byte-by-byte to find the first
-// byte with altered data. Within that byte determines the mask of bits that
-// have been altered. Returns the results via |offset| and |mask|.
-void FindModifiedBits(size_t length,
-                      const uint8* buffer1,
-                      const uint8* buffer2,
-                      size_t* offset,
-                      uint8* mask) {
-  ASSERT_TRUE(buffer1 != NULL);
-  ASSERT_TRUE(buffer2 != NULL);
-  ASSERT_TRUE(offset != NULL);
-  ASSERT_TRUE(mask != NULL);
-
-  for (size_t i = 0; i < length; ++i) {
-    if (buffer1[i] != buffer2[i]) {
-      *offset = i;
-      *mask = buffer1[i] ^ buffer2[i];
-      return;
-    }
-  }
-
-  *offset = 0;
-  *mask = 0;
-}
-
-bool ChecksumDetectsTamperingWithMask(const BlockInfo& block_info,
-                                      void* address_to_modify,
-                                      uint8 mask_to_modify) {
-  uint8* byte_to_modify = reinterpret_cast<uint8*>(address_to_modify);
-
-  // Remember the original contents.
-  uint8 original_value = *byte_to_modify;
-  uint8 original_bits = original_value & ~mask_to_modify;
-
-  // Since the checksum can collide we check a handful of times to build up
-  // some confidence. Since we sometimes expect this to return false the number
-  // of iterations needs to be kept reasonably low to keep the unittest fast.
-  bool detected = false;
-  BlockSetChecksum(block_info);
-  uint32 checksum = block_info.header->checksum;
-  for (size_t i = 0; i < 4; ++i) {
-    // Modify the value, altering only bits in |mask_to_modify|.
-    while (true) {
-      ++(*byte_to_modify);
-      if (((*byte_to_modify) & ~mask_to_modify) == original_bits)
-        break;
-    }
-    BlockSetChecksum(block_info);
-    if (block_info.header->checksum != checksum) {
-      // Success, the checksum detected the change!
-      detected = true;
-      break;
-    }
-  }
-
-  // Restore the original value before returning.
-  *byte_to_modify = original_value;
-  return detected;
-}
-
-bool ChecksumDetectsTampering(const BlockInfo& block_info,
-                              void* address_to_modify) {
-  if (!ChecksumDetectsTamperingWithMask(block_info, address_to_modify, 0xFF))
-    return false;
-  return true;
-}
-
-void TestChecksumDetectsTampering(const BlockInfo& block_info) {
-  uint32 checksum = BlockCalculateChecksum(block_info);
-  block_info.header->checksum = checksum;
-  EXPECT_TRUE(BlockChecksumIsValid(block_info));
-  ++block_info.header->checksum;
-  EXPECT_FALSE(BlockChecksumIsValid(block_info));
-  BlockSetChecksum(block_info);
-  EXPECT_EQ(checksum, block_info.header->checksum);
-
-  // Get the offset of the byte and the mask of the bits containing the
-  // block state. This is resilient to changes in the BlockHeader layout.
-  static size_t state_offset = -1;
-  static uint8 state_mask = 0;
-  if (state_offset == -1) {
-    BlockHeader header1 = {};
-    BlockHeader header2 = {};
-    header2.state = -1;
-    FindModifiedBits(sizeof(BlockHeader),
-                     reinterpret_cast<const uint8*>(&header1),
-                     reinterpret_cast<const uint8*>(&header2),
-                     &state_offset,
-                     &state_mask);
-  }
-
-  // Header bytes should be tamper proof.
-  EXPECT_TRUE(ChecksumDetectsTampering(block_info, block_info.header));
-  EXPECT_TRUE(ChecksumDetectsTampering(block_info,
-                                       &block_info.header->alloc_stack));
-  EXPECT_TRUE(ChecksumDetectsTamperingWithMask(
-      block_info,
-      block_info.block + state_offset,
-      state_mask));
-
-  // Header padding should be tamper proof.
-  if (block_info.header_padding_size > 0) {
-    EXPECT_TRUE(ChecksumDetectsTampering(block_info,
-        block_info.header_padding + block_info.header_padding_size / 2));
-  }
-
-  // Trailer padding should be tamper proof.
-  if (block_info.trailer_padding_size > 0) {
-    EXPECT_TRUE(ChecksumDetectsTampering(block_info,
-        block_info.trailer_padding + block_info.trailer_padding_size / 2));
-  }
-
-  // Trailer bytes should be tamper proof.
-  EXPECT_TRUE(ChecksumDetectsTampering(block_info, block_info.trailer));
-  EXPECT_TRUE(ChecksumDetectsTampering(block_info,
-                                       &block_info.trailer->alloc_ticks));
-
-  // Expect the checksum to detect body tampering in quarantined and freed
-  // states, but not in the allocated state.
-  bool expected = (block_info.header->state != ALLOCATED_BLOCK);
-  EXPECT_EQ(expected, ChecksumDetectsTampering(block_info, block_info.body));
-  EXPECT_EQ(expected, ChecksumDetectsTampering(block_info,
-      block_info.body + block_info.body_size / 2));
-  EXPECT_EQ(expected, ChecksumDetectsTampering(block_info,
-      block_info.body + block_info.body_size - 1));
-}
-
-}  // namespace
-
-TEST(BlockTest, ChecksumDetectsTampering) {
-  size_t kSizes[] = { 1, 4, 7, 16, 23, 32, 117, 1000, 4096 };
-
-  // Doing a single allocation makes this test a bit faster.
-  size_t kAllocSize = 4 * 4096;
-  void* alloc = ::VirtualAlloc(NULL, kAllocSize, MEM_COMMIT, PAGE_READWRITE);
-  ASSERT_TRUE(alloc != NULL);
-
-  // We test 9 different sizes, 9 different chunk sizes, 1 to 9 different
-  // alignments, and 2 different redzone sizes. This is 810 different
-  // combinations. We test each of these block allocations in all 3 possible
-  // states. The probe itself tests the block at 7 to 9 different points, and
-  // the tests require multiple iterations. Be careful playing with these
-  // constants or the unittest time can easily spiral out of control! This
-  // currently requires less than half a second, and is strictly CPU bound.
-  for (size_t chunk_size = kShadowRatio; chunk_size <= kPageSize;
-       chunk_size *= 2) {
-    for (size_t align = kShadowRatio; align <= chunk_size; align *= 2) {
-      for (size_t redzone = 0; redzone <= chunk_size; redzone += chunk_size) {
-        for (size_t i = 0; i < arraysize(kSizes); ++i) {
-          BlockLayout layout = {};
-          BlockPlanLayout(chunk_size, align, kSizes[i], redzone, redzone,
-                          &layout);
-          ASSERT_GT(kAllocSize, layout.block_size);
-
-          BlockInfo block_info = {};
-          BlockInitialize(layout, alloc, false, &block_info);
-
-          // Test that the checksum detects tampering as expected in each block
-          // state.
-          block_info.header->state = ALLOCATED_BLOCK;
-          ASSERT_NO_FATAL_FAILURE(TestChecksumDetectsTampering(block_info));
-          block_info.header->state = QUARANTINED_BLOCK;
-          ASSERT_NO_FATAL_FAILURE(TestChecksumDetectsTampering(block_info));
-          block_info.header->state = FREED_BLOCK;
-          ASSERT_NO_FATAL_FAILURE(TestChecksumDetectsTampering(block_info));
-        }  // kSizes[i]
-      }  // redzone
-    }  // align
-  }  // chunk_size
-
-  ASSERT_EQ(TRUE, ::VirtualFree(alloc, 0, MEM_RELEASE));
-}
-
-namespace {
-
-// An exception filter that grabs and sets an exception pointer, and
-// triggers only for access violations.
-DWORD AccessViolationFilter(EXCEPTION_POINTERS* e,
-                            EXCEPTION_POINTERS** pe) {
-  *pe = e;
-  if (e->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION)
-    return EXCEPTION_EXECUTE_HANDLER;
-  return EXCEPTION_CONTINUE_SEARCH;
-}
-
-// Tries to access the given address, validating whether or not an
-// access violation occurs.
-bool TestAccess(void* address, bool expect_access_violation) {
-  uint8* m = reinterpret_cast<uint8*>(address);
-  ULONG_PTR p = reinterpret_cast<ULONG_PTR>(address);
-
-  // Try a read.
-  uint8 value = 0;
-  EXCEPTION_POINTERS* e = NULL;
-  __try {
-    value = m[0];
-    if (expect_access_violation)
-      return false;
-  } __except (AccessViolationFilter(GetExceptionInformation(), &e)) {
-    if (!expect_access_violation)
-      return false;
-    if (e->ExceptionRecord == NULL ||
-        e->ExceptionRecord->NumberParameters < 2 ||
-        e->ExceptionRecord->ExceptionInformation[1] != p) {
-      return false;
-    }
-    return true;
-  }
-
-  // Try a write.
-  __try {
-    m[0] = 0;
-    if (expect_access_violation)
-      return false;
-  } __except (AccessViolationFilter(GetExceptionInformation(), &e)) {
-    if (!expect_access_violation)
-      return false;
-    if (e->ExceptionRecord == NULL ||
-        e->ExceptionRecord->NumberParameters < 2 ||
-        e->ExceptionRecord->ExceptionInformation[1] != p) {
-      return false;
-    }
-  }
-
-  // Ensure that |value| doesn't get optimized away. If so, the attempted
-  // read never occurs.
-  base::debug::Alias(&value);
-
-  return true;
-}
-
-// Readable wrappers to TestAccess.
-bool IsAccessible(void* address) {
-  return TestAccess(address, false);
-}
-bool IsNotAccessible(void* address) {
-  return TestAccess(address, true);
-}
-
-enum Protection {
-  kProtectNone,
-  kProtectRedzones,
-  kProtectAll,
-};
-
-void TestAccessUnderProtection(const BlockInfo& block_info,
-                               Protection protection) {
-  // Grab a set of points to sample for access, scattered across the various
-  // components of the block.
-  std::set<void*> samples;
-  samples.insert(block_info.header);
-  samples.insert(block_info.header_padding - 1);
-  samples.insert(block_info.header_padding);
-  samples.insert(block_info.header_padding +
-      block_info.header_padding_size / 2);
-  samples.insert(block_info.header_padding +
-      block_info.header_padding_size - 1);
-  samples.insert(block_info.body);
-  samples.insert(block_info.body + block_info.body_size / 2);
-  samples.insert(block_info.body + block_info.body_size - 1);
-  samples.insert(block_info.trailer_padding);
-  samples.insert(block_info.trailer_padding +
-      block_info.trailer_padding_size / 2);
-  samples.insert(block_info.trailer_padding +
-      block_info.trailer_padding_size - 1);
-  samples.insert(block_info.trailer);
-  samples.insert(block_info.trailer);
-  samples.insert(block_info.block + block_info.block_size - 1);
-
-  // Also sample at points at the edges of the pages in the redzones.
-  if (block_info.left_redzone_pages_size > 0) {
-    if (block_info.block < block_info.left_redzone_pages)
-      samples.insert(block_info.left_redzone_pages - 1);
-    samples.insert(block_info.left_redzone_pages);
-    samples.insert(block_info.left_redzone_pages +
-        block_info.left_redzone_pages_size - 1);
-    samples.insert(block_info.left_redzone_pages +
-        block_info.left_redzone_pages_size);
-  }
-  if (block_info.right_redzone_pages_size > 0) {
-    samples.insert(block_info.right_redzone_pages - 1);
-    samples.insert(block_info.right_redzone_pages);
-    samples.insert(block_info.right_redzone_pages +
-        block_info.right_redzone_pages_size - 1);
-    uint8* past_end = block_info.right_redzone_pages +
-        block_info.right_redzone_pages_size;
-    if (past_end < block_info.block + block_info.block_size)
-      samples.insert(past_end);
-  }
-
-  uint8* left_end = block_info.left_redzone_pages +
-      block_info.left_redzone_pages_size;
-  uint8* right_end = block_info.right_redzone_pages +
-      block_info.right_redzone_pages_size;
-  uint8* block_end = block_info.block_pages + block_info.block_pages_size;
-
-  std::set<void*>::const_iterator it = samples.begin();
-  for (; it != samples.end(); ++it) {
-    if ((*it >= block_info.left_redzone_pages && *it < left_end) ||
-        (*it >= block_info.right_redzone_pages && *it < right_end)) {
-      // In the left or right guard pages.
-      if (protection == kProtectNone) {
-        EXPECT_TRUE(IsAccessible(*it));
-      } else {
-        EXPECT_TRUE(IsNotAccessible(*it));
-      }
-    } else if (*it >= block_info.block_pages && *it < block_end) {
-      // In the block pages, but not a left or right guard page.
-      if (protection == kProtectAll) {
-        EXPECT_TRUE(IsNotAccessible(*it));
-      } else {
-        EXPECT_TRUE(IsAccessible(*it));
-      }
-    } else {
-      // In the block, but in a page that is only partially covered.
-      EXPECT_TRUE(IsAccessible(*it));
-    }
-  }
-}
-
-// Tests that the page protections are as expected after calling
-// BlockProtectNone.
-void TestProtectNone(const BlockInfo& block_info) {
-  BlockProtectNone(block_info);
-  EXPECT_NO_FATAL_FAILURE(TestAccessUnderProtection(block_info,
-                                                    kProtectNone));
-}
-
-// Tests that the page protections are as expected after calling
-// BlockProtectRedzones.
-void TestProtectRedzones(const BlockInfo& block_info) {
-  BlockProtectRedzones(block_info);
-  EXPECT_NO_FATAL_FAILURE(TestAccessUnderProtection(block_info,
-                                                    kProtectRedzones));
-}
-
-// Tests that the page protections are as expected after calling
-// BlockProtectAll.
-void TestProtectAll(const BlockInfo& block_info) {
-  BlockProtectAll(block_info);
-  EXPECT_NO_FATAL_FAILURE(TestAccessUnderProtection(block_info,
-                                                    kProtectAll));
-}
-
-// Tests that all page protection transitions work.
-void TestAllProtectionTransitions(size_t chunk_size,
-                                  size_t alignment,
-                                  size_t size,
-                                  size_t min_left_redzone_size,
-                                  size_t min_right_redzone_size) {
-  // Create and initialize the given block.
-  BlockLayout layout = {};
-  BlockPlanLayout(chunk_size, alignment, size, min_left_redzone_size,
-                  min_right_redzone_size, &layout);
-  void* alloc = ::VirtualAlloc(NULL, layout.block_size, MEM_COMMIT,
-                               PAGE_READWRITE);
-  ASSERT_TRUE(alloc != NULL);
-  BlockInfo block_info = {};
-  BlockInitialize(layout, alloc, false, &block_info);
-
-  // By default the protections should be disabled for a fresh allocation.
-  EXPECT_NO_FATAL_FAILURE(TestAccessUnderProtection(block_info,
-                                                    kProtectNone));
-
-  // Try a full cycle of page protections. This tests all possible
-  // transitions, including self transitions.
-  EXPECT_NO_FATAL_FAILURE(TestProtectNone(block_info));
-  EXPECT_NO_FATAL_FAILURE(TestProtectNone(block_info));
-  EXPECT_NO_FATAL_FAILURE(TestProtectRedzones(block_info));
-  EXPECT_NO_FATAL_FAILURE(TestProtectRedzones(block_info));
-  EXPECT_NO_FATAL_FAILURE(TestProtectAll(block_info));
-  EXPECT_NO_FATAL_FAILURE(TestProtectAll(block_info));
-  EXPECT_NO_FATAL_FAILURE(TestProtectNone(block_info));
-  EXPECT_NO_FATAL_FAILURE(TestProtectAll(block_info));
-  EXPECT_NO_FATAL_FAILURE(TestProtectRedzones(block_info));
-  EXPECT_NO_FATAL_FAILURE(TestProtectNone(block_info));
-
-  ASSERT_EQ(TRUE, ::VirtualFree(alloc, 0, MEM_RELEASE));
-}
-
-}  // namespace
-
-TEST(BlockTest, ProtectionTransitions) {
-  // Left and right guard pages, everything page aligned.
-  EXPECT_NO_FATAL_FAILURE(TestAllProtectionTransitions(
-      4096, 4096, 4096, 4096, 4096));
-
-  // Left and right guard pages will contain entire pages, but
-  // not be entirely covered by pages.
-  EXPECT_NO_FATAL_FAILURE(TestAllProtectionTransitions(
-      8, 8, 128, 4100, 8200));
-
-  // An allocation that will contain no pages whatsoever.
-  EXPECT_NO_FATAL_FAILURE(TestAllProtectionTransitions(
-      8, 8, 67, 0, 0));
-
-  // An allocation with redzones containing no pages, but that covers an
-  // entire page.
-  EXPECT_NO_FATAL_FAILURE(TestAllProtectionTransitions(
-      4096, 8, 67, 0, 0));
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/block_utils.cc b/syzygy/agent/asan/block_utils.cc
deleted file mode 100644
index 94b773f..0000000
--- a/syzygy/agent/asan/block_utils.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/block_utils.h"
-
-namespace agent {
-namespace asan {
-
-bool IsBlockCorrupt(const uint8* block_header, BlockInfo* block_info) {
-  // If no output structure is provided then use a local one.
-  BlockInfo local_block_info = {};
-  if (block_info == NULL) {
-    block_info = &local_block_info;
-  } else {
-    ::memset(block_info, 0, sizeof(BlockInfo));
-  }
-
-  if (!Shadow::BlockInfoFromShadow(block_header, block_info) ||
-      block_info->header->magic != kBlockHeaderMagic ||
-      !BlockChecksumIsValid(*block_info)) {
-    return true;
-  }
-  return false;
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/block_utils.h b/syzygy/agent/asan/block_utils.h
deleted file mode 100644
index 1aa3fbe..0000000
--- a/syzygy/agent/asan/block_utils.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Utility functions for working with ASan Blocks.
-
-#ifndef SYZYGY_AGENT_ASAN_BLOCK_UTILS_H_
-#define SYZYGY_AGENT_ASAN_BLOCK_UTILS_H_
-
-#include "base/logging.h"
-#include "syzygy/agent/asan/block.h"
-#include "syzygy/agent/asan/shadow.h"
-
-namespace agent {
-namespace asan {
-
-// A functor that retrieves the total size of an ASan allocation.
-struct GetTotalBlockSizeFunctor {
-  size_t operator()(const BlockHeader* block) {
-    DCHECK_NE(reinterpret_cast<const BlockHeader*>(NULL), block);
-    BlockInfo info = {};
-    if (!Shadow::BlockInfoFromShadow(block, &info))
-      return 0;
-    return info.block_size;
-  }
-};
-
-// A functor for calculating a hash value associated with a block. This is used
-// by the sharded quarantine.
-struct GetBlockHashFunctor {
-  size_t operator()(const BlockHeader* block) {
-    DCHECK_NE(reinterpret_cast<const BlockHeader*>(NULL), block);
-    BlockInfo info = {};
-    if (!Shadow::BlockInfoFromShadow(block, &info))
-      return 0;
-    return info.trailer->alloc_ticks + reinterpret_cast<size_t>(block);
-  }
-};
-
-// Checks if a block is corrupt. This checks the block's metadata and its
-// checksum.
-// @param block_header A pointer to the block header of the block.
-// @param block_info Will be filled in with pointers to the various portions
-//     of the block if this function succeeds. May be NULL.
-// @returns true if the block is corrupt, false otherwise.
-// @note The pages containing the block redzones must be readable.
-bool IsBlockCorrupt(const uint8* block_header, BlockInfo* block_info);
-
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_BLOCK_UTILS_H_
diff --git a/syzygy/agent/asan/block_utils_unittest.cc b/syzygy/agent/asan/block_utils_unittest.cc
deleted file mode 100644
index a21a093..0000000
--- a/syzygy/agent/asan/block_utils_unittest.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/block_utils.h"
-
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/asan_logger.h"
-#include "syzygy/agent/asan/unittest_util.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-typedef testing::TestWithAsanRuntime BlockUtilTest;
-
-}  // namespace
-
-TEST_F(BlockUtilTest, IsBlockCorruptInvalidMagicNumber) {
-  const size_t kAllocSize = 100;
-  testing::FakeAsanBlock fake_block(kShadowRatioLog, runtime_.stack_cache());
-  EXPECT_TRUE(fake_block.InitializeBlock(kAllocSize));
-
-  fake_block.block_info.header->magic = ~kBlockHeaderMagic;
-  EXPECT_TRUE(IsBlockCorrupt(fake_block.block_info.block, NULL));
-  fake_block.block_info.header->magic = kBlockHeaderMagic;
-  EXPECT_FALSE(IsBlockCorrupt(fake_block.block_info.block, NULL));
-}
-
-TEST_F(BlockUtilTest, IsBlockCorruptInvalidChecksum) {
-  const size_t kAllocSize = 100;
-  static const size_t kChecksumRepeatCount = 10;
-
-  // This can fail because of a checksum collision. However, we run it a
-  // handful of times to keep the chances as small as possible.
-  for (size_t i = 0; i < kChecksumRepeatCount; ++i) {
-    testing::FakeAsanBlock fake_block(kShadowRatioLog, runtime_.stack_cache());
-    EXPECT_TRUE(fake_block.InitializeBlock(kAllocSize));
-    EXPECT_TRUE(fake_block.MarkBlockAsQuarantined());
-
-    // Change some of the block content and verify that the block is now being
-    // seen as corrupt.
-    size_t original_checksum = fake_block.block_info.header->checksum;
-    uint8 original_value = fake_block.block_info.body[0];
-    fake_block.block_info.body[0]++;
-
-    // Try again for all but the last attempt if this appears to have failed.
-    if (!IsBlockCorrupt(fake_block.block_info.body, NULL) &&
-        i + 1 < kChecksumRepeatCount) {
-      continue;
-    }
-
-    ASSERT_TRUE(IsBlockCorrupt(fake_block.block_info.body, NULL));
-    fake_block.block_info.body[0] = original_value;
-    ASSERT_FALSE(IsBlockCorrupt(fake_block.block_info.body, NULL));
-    break;
-  }
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/circular_queue.h b/syzygy/agent/asan/circular_queue.h
deleted file mode 100644
index edf8406..0000000
--- a/syzygy/agent/asan/circular_queue.h
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// A simple circular queue.
-// The queue has two ends, the front/head and the back/tail.
-// Elements are pushed in the back/tail end, and popped from the front/head end.
-// The queue will refuse to push elements when it is full.
-// The underlying container reserves the memory only once, making the queue
-// memory-wise efficient, avoiding the memory fragmentation caused by lots of
-// small allocations.
-// To avoid misuse, the constructor taking a MemoryNotiferInterface*
-// parameter is enabled IFF the specified allocator is of type
-// MemoryNotifierAllocator<T>.
-//
-// CORRECT USAGE:
-// CircularQueue<int, MemoryNotifierAllocator<int>> q(capacity, &notifier);
-// CircularQueue<int> q(capacity);  // Using default allocator without notifier.
-//
-// INCORRECT USAGE (causes compilation error):
-// CircularQueue<int> q(capacity, &notifier);
-
-#ifndef SYZYGY_AGENT_ASAN_CIRCULAR_QUEUE_H_
-#define SYZYGY_AGENT_ASAN_CIRCULAR_QUEUE_H_
-
-#include <memory>
-#include <vector>
-
-#include "syzygy/agent/asan/memory_notifier.h"
-
-namespace agent {
-namespace asan {
-
-// A simple circular queue.
-// @tparam T the type of the elements.
-// @tparam Alloc the type of the allocator used by the underlying container.
-template<typename T, typename Alloc = std::allocator<T>>
-class CircularQueue {
- public:
-  typedef typename std::vector<T, Alloc> Container;
-
-  // Constructor.
-  // @param max_capacity Maximum number of elements the queue can store.
-  explicit CircularQueue(size_t max_capacity);
-
-  // Constructor.
-  // @param max_capacity Maximum number of elements the queue can store.
-  // @param alloc The allocator to use with this container.
-  CircularQueue(size_t max_capacity, const Alloc& alloc);
-
-  // Inserts an element in the back/tail of the queue if possible.
-  // @param the element to be inserted.
-  // @returns true if the operation succeeded and the element was inserted,
-  //     false if the queue is full.
-  bool push(const T&);
-
-  // Removes an element from the front/head of the queue if possible.
-  // @returns true if an element was popped fron the front/head,
-  //     false if the queue is empty.
-  bool pop();
-
-  // @returns the element in the front/head of the queue.
-  const T& front() const;
-
-  // Gives the current number of elements in the queue.
-  // @returns the number of elements currently stored in the queue.
-  size_t size() const;
-
-  // Tests if the queue is empty.
-  // @returns true if the queue is empty, false otherwise.
-  bool empty() const;
-
-  // @returns the maximum number of elements the queue can handle.
-  size_t max_capacity() const;
-
- private:
-  // The index of the first enqueued/pushed element.
-  size_t head_;
-
-  // The index of the next free position.
-  // The index to be used to store an element in the next call to Push.
-  size_t tail_;
-
-  // The number of elements contained in the queue.
-  size_t size_;
-
-  // The queue underlying container.
-  Container buffer_;
-};
-
-}  // namespace asan
-}  // namespace agent
-
-#include "syzygy/agent/asan/circular_queue_impl.h"
-
-#endif  // SYZYGY_AGENT_ASAN_CIRCULAR_QUEUE_H_
diff --git a/syzygy/agent/asan/circular_queue_impl.h b/syzygy/agent/asan/circular_queue_impl.h
deleted file mode 100644
index 24dfd19..0000000
--- a/syzygy/agent/asan/circular_queue_impl.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Internal implementation details for circular_queue.h. Not meant to
-// be included directly.
-
-#ifndef SYZYGY_AGENT_ASAN_CIRCULAR_QUEUE_IMPL_H_
-#define SYZYGY_AGENT_ASAN_CIRCULAR_QUEUE_IMPL_H_
-
-#include "base/logging.h"
-#include "syzygy/agent/asan/memory_notifier.h"
-
-namespace agent {
-namespace asan {
-
-template<typename T, typename Alloc>
-CircularQueue<T, Alloc>::CircularQueue(size_t max_capacity)
-    : head_(0u), tail_(0u), size_(0u) {
-  buffer_.resize(max_capacity);
-}
-
-template<typename T, typename Alloc>
-CircularQueue<T, Alloc>::CircularQueue(
-    size_t max_capacity, const Alloc& alloc)
-    : buffer_(alloc),
-      head_(0u),
-      tail_(0u),
-      size_(0u) {
-  buffer_.resize(max_capacity);
-}
-
-template<typename T, typename Alloc>
-bool CircularQueue<T, Alloc>::push(const T& elem) {
-  DCHECK_LE(size_, buffer_.size());
-  if (size_ == buffer_.size())
-    return false;
-  DCHECK_LT(tail_, buffer_.size());
-  buffer_[tail_++] = elem;
-  if (tail_ >= buffer_.size())
-    tail_ = 0;
-  ++size_;
-  return true;
-}
-
-template<typename T, typename Alloc>
-bool CircularQueue<T, Alloc>::pop() {
-  if (empty())
-    return false;
-  DCHECK_LT(head_, buffer_.size());
-  ++head_;
-  if (head_ == buffer_.size())
-    head_ = 0;
-  --size_;
-  return true;
-}
-
-template<typename T, typename Alloc>
-const T& CircularQueue<T, Alloc>::front() const {
-  DCHECK(!empty());
-  return buffer_[head_];
-}
-
-template<typename T, typename Alloc>
-size_t CircularQueue<T, Alloc>::size() const {
-  return size_;
-}
-
-template<typename T, typename Alloc>
-bool CircularQueue<T, Alloc>::empty() const {
-  return size() == 0;
-}
-
-template<typename T, typename Alloc>
-size_t CircularQueue<T, Alloc>::max_capacity() const {
-  return buffer_.size();
-}
-
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_CIRCULAR_QUEUE_IMPL_H_
diff --git a/syzygy/agent/asan/circular_queue_unittest.cc b/syzygy/agent/asan/circular_queue_unittest.cc
deleted file mode 100644
index 11d894a..0000000
--- a/syzygy/agent/asan/circular_queue_unittest.cc
+++ /dev/null
@@ -1,180 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/circular_queue.h"
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/allocators.h"
-#include "syzygy/agent/asan/unittest_util.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-  using testing::MockMemoryNotifier;
-
-  using ::testing::_;
-  using ::testing::AtLeast;
-}
-
-TEST(CircularQueue, MaxCapacity) {
-  size_t capacity = 100;
-  CircularQueue<int> q(capacity);
-  EXPECT_EQ(capacity, q.max_capacity());
-}
-
-TEST(CircularQueue, PushIncreasesSize) {
-  size_t capacity = 100;
-  CircularQueue<int> q(capacity);
-
-  for (size_t i = 0; i < capacity; ++i) {
-    EXPECT_EQ(i, q.size());
-    q.push(i);
-    EXPECT_EQ(i + 1, q.size());
-  }
-}
-
-TEST(CircularQueue, PopDecreasesSize) {
-  size_t capacity = 100;
-  CircularQueue<int> q(capacity);
-
-  for (size_t i = 0; i < capacity; ++i) {
-    for (size_t j = 0; j < i; ++j)
-      q.push(i);
-    for (size_t j = 0; j < i; ++j) {
-      EXPECT_EQ(i - j, q.size());
-      q.pop();
-      EXPECT_EQ(i - j - 1, q.size());
-    }
-  }
-}
-
-TEST(CircularQueue, ComplyWithLIFO) {
-  size_t capacity = 100;
-  CircularQueue<int> q(capacity);
-
-  size_t initial = 10;
-  for (size_t i = 0; i < initial; ++i)
-    EXPECT_TRUE(q.push(i));
-
-  for (size_t i = initial; i < 1000 * capacity; ++i) {
-    EXPECT_TRUE(q.push(i));
-    EXPECT_EQ(i - initial, q.front());
-    EXPECT_TRUE(q.pop());
-  }
-}
-
-TEST(CircularQueue, Stress) {
-  size_t capacity = 100;
-  CircularQueue<int> q(capacity);
-  EXPECT_TRUE(q.empty());
-
-  for (size_t i = 0; i < capacity; ++i) {
-    for (size_t j = 0; j < i; ++j) {
-      EXPECT_TRUE(q.push(i));
-      EXPECT_FALSE(q.empty());
-    }
-    for (size_t j = 0; j < i; ++j) {
-      EXPECT_FALSE(q.empty());
-      EXPECT_TRUE(q.pop());
-    }
-    EXPECT_TRUE(q.empty());
-  }
-  EXPECT_TRUE(q.empty());
-}
-
-TEST(CircularQueue, PushWhenFull) {
-  size_t capacity = 100;
-  CircularQueue<int> q(capacity);
-  EXPECT_TRUE(q.empty());
-
-  for (size_t i = 0; i < capacity; ++i) {
-    EXPECT_TRUE(q.push(i));
-    EXPECT_FALSE(q.empty());
-  }
-
-  EXPECT_EQ(capacity, q.size());
-
-  EXPECT_FALSE(q.push(1));
-  EXPECT_FALSE(q.push(2));
-  EXPECT_FALSE(q.push(3));
-
-  EXPECT_EQ(capacity, q.size());
-}
-
-TEST(CircularQueue, PopWhenEmpty) {
-  size_t capacity = 100;
-  CircularQueue<int> q(capacity);
-  EXPECT_FALSE(q.pop());
-  EXPECT_TRUE(q.push(0));
-  EXPECT_TRUE(q.pop());
-  EXPECT_TRUE(q.empty());
-}
-
-TEST(CircularQueue, PopUntilEmpty) {
-  size_t capacity = 100;
-  CircularQueue<int> q(capacity);
-
-  for (size_t i = 0; i < capacity; ++i) {
-    EXPECT_TRUE(q.push(i));
-    EXPECT_FALSE(q.empty());
-  }
-
-  while (q.pop()) { }
-  EXPECT_TRUE(q.empty());
-  EXPECT_EQ(0u, q.size());
-}
-
-TEST(CircularQueue, EmptyAndZeroSize) {
-  size_t capacity = 100;
-  CircularQueue<int> q(capacity);
-
-  EXPECT_TRUE(q.empty());
-  EXPECT_EQ(0u, q.size());
-
-  EXPECT_TRUE(q.push(1));
-  EXPECT_TRUE(q.pop());
-
-  EXPECT_TRUE(q.empty());
-  EXPECT_EQ(0u, q.size());
-}
-
-TEST(CircularQueue, MemoryNotifierIsCalled) {
-  MockMemoryNotifier mock_notifier;
-
-  // Should be called by the underlying container.
-  EXPECT_CALL(mock_notifier,
-    NotifyInternalUse(_, _))
-    .Times(AtLeast(1));
-
-  // Ensure no calls to NotifyFutureHeapUse.
-  EXPECT_CALL(mock_notifier,
-    NotifyFutureHeapUse(_, _))
-    .Times(0);
-
-  // Should be called by the underlying container.
-  EXPECT_CALL(mock_notifier,
-    NotifyReturnedToOS(_, _))
-    .Times(AtLeast(1));
-
-  size_t capacity = 100000;
-  CircularQueue<int, MemoryNotifierAllocator<int>> q(
-      capacity,
-      MemoryNotifierAllocator<int>(&mock_notifier));
-}
-
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/constants.cc b/syzygy/agent/asan/constants.cc
deleted file mode 100644
index 716209f..0000000
--- a/syzygy/agent/asan/constants.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/constants.h"
-
-#include <windows.h>
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-// Gets the page size from the OS.
-size_t GetPageSize() {
-  SYSTEM_INFO system_info = {};
-  ::GetSystemInfo(&system_info);
-  return system_info.dwPageSize;
-}
-
-}  // namespace
-
-const size_t kPageSize = GetPageSize();
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/constants.h b/syzygy/agent/asan/constants.h
deleted file mode 100644
index ce777b0..0000000
--- a/syzygy/agent/asan/constants.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Declares some constants that are used across ASan.
-
-#ifndef SYZYGY_AGENT_ASAN_CONSTANTS_H_
-#define SYZYGY_AGENT_ASAN_CONSTANTS_H_
-
-namespace agent {
-namespace asan {
-
-// The ratio of shadow memory to actual memory. This governs the behaviour, size
-// and alignment requirements of many ASan structures.
-static const size_t kShadowRatioLog = 3;
-static const size_t kShadowRatio = (1 << kShadowRatioLog);
-
-// The size of a page on the OS.
-extern const size_t kPageSize;
-
-// The default sharding factor of the quarantine. This is used to give us linear
-// access for random removal and insertion of elements into the quarantine.
-static const size_t kQuarantineDefaultShardingFactor = 128;
-
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_CONSTANTS_H_
diff --git a/syzygy/agent/asan/error_info.cc b/syzygy/agent/asan/error_info.cc
deleted file mode 100644
index dfaf107..0000000
--- a/syzygy/agent/asan/error_info.cc
+++ /dev/null
@@ -1,299 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/error_info.h"
-
-#include "base/strings/string_util.h"
-#include "syzygy/agent/asan/block_utils.h"
-#include "syzygy/agent/asan/shadow.h"
-#include "syzygy/agent/asan/stack_capture_cache.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-// Returns the time since the block @p header was freed (in milliseconds).
-// @param header The block for which we want the time since free.
-// @returns the time since the block was freed.
-uint32 GetTimeSinceFree(const BlockHeader* header) {
-  DCHECK(header != NULL);
-
-  if (header->state == ALLOCATED_BLOCK)
-    return 0;
-
-  BlockInfo block_info = {};
-  Shadow::BlockInfoFromShadow(header, &block_info);
-  DCHECK(block_info.trailer != NULL);
-
-  uint32 time_since_free = ::GetTickCount() - block_info.trailer->free_ticks;
-
-  return time_since_free;
-}
-
-// Copy a stack capture object into an array.
-// @param stack_capture The stack capture that we want to copy.
-// @param dst Will receive the stack frames.
-// @param dst_size Will receive the number of frames that has been copied.
-void CopyStackCaptureToArray(const StackCapture* stack_capture,
-                             void* dst, uint8* dst_size) {
-  DCHECK_NE(reinterpret_cast<const StackCapture*>(NULL), stack_capture);
-  DCHECK_NE(reinterpret_cast<void*>(NULL), dst);
-  DCHECK_NE(reinterpret_cast<uint8*>(NULL), dst_size);
-  ::memcpy(dst,
-           stack_capture->frames(),
-           stack_capture->num_frames() * sizeof(void*));
-  *dst_size = stack_capture->num_frames();
-}
-
-// Get the information about an address relative to a block.
-// @param header The header of the block containing this address.
-// @param bad_access_info Will receive the information about this address.
-void GetAddressInformation(BlockHeader* header,
-                           AsanErrorInfo* bad_access_info) {
-  DCHECK(header != NULL);
-  DCHECK(bad_access_info != NULL);
-
-  DCHECK(header != NULL);
-  DCHECK(bad_access_info != NULL);
-  DCHECK(bad_access_info->location != NULL);
-
-  BlockInfo block_info = {};
-  Shadow::BlockInfoFromShadow(header, &block_info);
-  int offset = 0;
-  char* offset_relativity = "";
-  switch (bad_access_info->error_type) {
-    case HEAP_BUFFER_OVERFLOW: {
-      offset = static_cast<const uint8*>(bad_access_info->location)
-          - block_info.body - block_info.body_size;
-      offset_relativity = "beyond";
-      break;
-    }
-    case HEAP_BUFFER_UNDERFLOW: {
-      offset = block_info.body -
-          static_cast<const uint8*>(bad_access_info->location);
-      offset_relativity = "before";
-      break;
-    }
-    case USE_AFTER_FREE: {
-      offset = static_cast<const uint8*>(bad_access_info->location)
-          - block_info.body;
-      offset_relativity = "inside";
-      break;
-    }
-    case WILD_ACCESS:
-    case DOUBLE_FREE:
-    case UNKNOWN_BAD_ACCESS:
-    case CORRUPT_BLOCK:
-      return;
-    default:
-      NOTREACHED() << "Error trying to dump address information.";
-  }
-
-  size_t shadow_info_bytes = base::snprintf(
-      bad_access_info->shadow_info,
-      arraysize(bad_access_info->shadow_info) - 1,
-      "%08X is %d bytes %s %d-byte block [%08X,%08X)\n",
-      bad_access_info->location,
-      offset,
-      offset_relativity,
-      block_info.body_size,
-      block_info.body,
-      block_info.trailer_padding);
-
-  std::string shadow_memory;
-  Shadow::AppendShadowArrayText(bad_access_info->location, &shadow_memory);
-  size_t shadow_mem_bytes = base::snprintf(
-      bad_access_info->shadow_memory,
-      arraysize(bad_access_info->shadow_memory) - 1,
-      "%s",
-      shadow_memory.c_str());
-
-  // Ensure that we had enough space to store the full shadow information.
-  DCHECK_LE(shadow_info_bytes, arraysize(bad_access_info->shadow_info) - 1);
-  DCHECK_LE(shadow_mem_bytes, arraysize(bad_access_info->shadow_memory) - 1);
-}
-
-}  // namespace
-
-const char kHeapUseAfterFree[] = "heap-use-after-free";
-const char kHeapBufferUnderFlow[] = "heap-buffer-underflow";
-const char kHeapBufferOverFlow[] = "heap-buffer-overflow";
-const char kAttemptingDoubleFree[] = "attempting double-free";
-const char kInvalidAddress[] = "invalid-address";
-const char kWildAccess[] = "wild-access";
-const char kHeapUnknownError[] = "heap-unknown-error";
-const char kHeapCorruptBlock[] = "corrupt-block";
-const char kCorruptHeap[] = "corrupt-heap";
-
-const char* ErrorInfoAccessTypeToStr(BadAccessKind bad_access_kind) {
-  switch (bad_access_kind) {
-    case USE_AFTER_FREE:
-      return kHeapUseAfterFree;
-    case HEAP_BUFFER_UNDERFLOW:
-      return kHeapBufferUnderFlow;
-    case HEAP_BUFFER_OVERFLOW:
-      return kHeapBufferOverFlow;
-    case WILD_ACCESS:
-      return kWildAccess;
-    case INVALID_ADDRESS:
-      return kInvalidAddress;
-    case DOUBLE_FREE:
-      return kAttemptingDoubleFree;
-    case UNKNOWN_BAD_ACCESS:
-      return kHeapUnknownError;
-    case CORRUPT_BLOCK:
-      return kHeapCorruptBlock;
-    case CORRUPT_HEAP:
-      return kCorruptHeap;
-    default:
-      NOTREACHED() << "Unexpected bad access kind.";
-      return NULL;
-  }
-}
-
-bool ErrorInfoGetBadAccessInformation(StackCaptureCache* stack_cache,
-                                      AsanErrorInfo* bad_access_info) {
-  DCHECK_NE(reinterpret_cast<StackCaptureCache*>(NULL), stack_cache);
-  DCHECK_NE(reinterpret_cast<AsanErrorInfo*>(NULL), bad_access_info);
-  BlockInfo block_info = {};
-  if (!Shadow::BlockInfoFromShadow(bad_access_info->location, &block_info))
-    return false;
-
-  if (bad_access_info->error_type != DOUBLE_FREE &&
-      bad_access_info->error_type != CORRUPT_BLOCK) {
-    bad_access_info->error_type =
-        ErrorInfoGetBadAccessKind(bad_access_info->location, block_info.header);
-  }
-
-  // Makes sure that we don't try to use an invalid stack capture pointer.
-  if (bad_access_info->error_type == CORRUPT_BLOCK) {
-    // Set the invalid stack captures to NULL.
-    if (!stack_cache->StackCapturePointerIsValid(
-        block_info.header->alloc_stack)) {
-      block_info.header->alloc_stack = NULL;
-    }
-    if (!stack_cache->StackCapturePointerIsValid(
-        block_info.header->free_stack)) {
-      block_info.header->free_stack = NULL;
-    }
-  }
-
-  // Checks if there's a containing block in the case of a use after free on a
-  // block owned by a nested heap.
-  BlockInfo containing_block = {};
-  if (bad_access_info->error_type == USE_AFTER_FREE &&
-      block_info.header->state != QUARANTINED_BLOCK) {
-     Shadow::ParentBlockInfoFromShadow(block_info, &containing_block);
-  }
-
-  // Get the bad access description if we've been able to determine its kind.
-  if (bad_access_info->error_type != UNKNOWN_BAD_ACCESS) {
-    bad_access_info->milliseconds_since_free =
-        GetTimeSinceFree(block_info.header);
-
-    DCHECK(block_info.header->alloc_stack != NULL);
-    CopyStackCaptureToArray(block_info.header->alloc_stack,
-                            bad_access_info->alloc_stack,
-                            &bad_access_info->alloc_stack_size);
-    bad_access_info->alloc_tid = block_info.trailer->alloc_tid;
-
-    if (block_info.header->state != ALLOCATED_BLOCK) {
-      const StackCapture* free_stack = block_info.header->free_stack;
-      BlockTrailer* free_stack_trailer = block_info.trailer;
-      // Use the free metadata of the containing block if there's one.
-      // TODO(chrisha): This should report all of the nested stack information
-      //     from innermost to outermost. For now, innermost is best.
-      if (containing_block.block != NULL) {
-        free_stack = containing_block.header->free_stack;
-        free_stack_trailer = containing_block.trailer;
-      }
-      CopyStackCaptureToArray(block_info.header->free_stack,
-                              bad_access_info->free_stack,
-                              &bad_access_info->free_stack_size);
-      bad_access_info->free_tid = free_stack_trailer->free_tid;
-    }
-    GetAddressInformation(block_info.header, bad_access_info);
-    return true;
-  }
-
-  return false;
-}
-
-BadAccessKind ErrorInfoGetBadAccessKind(const void* addr,
-                                        const BlockHeader* header) {
-  DCHECK_NE(reinterpret_cast<const void*>(NULL), addr);
-  DCHECK_NE(reinterpret_cast<const BlockHeader*>(NULL), header);
-
-  BadAccessKind bad_access_kind = UNKNOWN_BAD_ACCESS;
-
-  if (header->state == QUARANTINED_BLOCK) {
-    bad_access_kind = USE_AFTER_FREE;
-  } else {
-    BlockInfo block_info = {};
-    Shadow::BlockInfoFromShadow(header, &block_info);
-    if (addr < block_info.body) {
-      bad_access_kind = HEAP_BUFFER_UNDERFLOW;
-    } else if (addr >= (block_info.body + block_info.body_size)) {
-      bad_access_kind = HEAP_BUFFER_OVERFLOW;
-    } else if (Shadow::GetShadowMarkerForAddress(addr) == kHeapFreedMarker) {
-      // This is a use after free on a block managed by a nested heap.
-      bad_access_kind = USE_AFTER_FREE;
-    }
-  }
-  return bad_access_kind;
-}
-
-void ErrorInfoGetAsanBlockInfo(StackCaptureCache* stack_cache,
-                               AsanBlockInfo* asan_block_info) {
-  DCHECK_NE(reinterpret_cast<StackCaptureCache*>(NULL), stack_cache);
-  DCHECK_NE(reinterpret_cast<AsanBlockInfo*>(NULL), asan_block_info);
-  const BlockHeader* header =
-      reinterpret_cast<const BlockHeader*>(asan_block_info->header);
-
-  asan_block_info->alloc_stack_size = 0;
-  asan_block_info->free_stack_size = 0;
-  asan_block_info->corrupt = IsBlockCorrupt(
-      reinterpret_cast<const uint8*>(asan_block_info->header), NULL);
-
-  // Copy the alloc and free stack traces if they're valid.
-  if (stack_cache->StackCapturePointerIsValid(header->alloc_stack)) {
-    CopyStackCaptureToArray(header->alloc_stack,
-                            asan_block_info->alloc_stack,
-                            &asan_block_info->alloc_stack_size);
-  }
-  if (header->state != ALLOCATED_BLOCK &&
-      stack_cache->StackCapturePointerIsValid(header->free_stack)) {
-    CopyStackCaptureToArray(header->free_stack,
-                            asan_block_info->free_stack,
-                            &asan_block_info->free_stack_size);
-  }
-
-  // Only check the trailer if the block isn't marked as corrupt.
-  if (!asan_block_info->corrupt) {
-    BlockInfo block_info = {};
-    Shadow::BlockInfoFromShadow(asan_block_info->header, &block_info);
-    asan_block_info->alloc_tid = block_info.trailer->alloc_tid;
-    asan_block_info->free_tid = block_info.trailer->free_tid;
-  } else {
-    asan_block_info->alloc_tid = 0;
-    asan_block_info->free_tid = 0;
-  }
-
-  asan_block_info->state = header->state;
-  asan_block_info->user_size = header->body_size;
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/error_info.h b/syzygy/agent/asan/error_info.h
deleted file mode 100644
index feb4a3d..0000000
--- a/syzygy/agent/asan/error_info.h
+++ /dev/null
@@ -1,204 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Declares some structure and some utility functions used to get some
-// information about an ASan error.
-
-#ifndef SYZYGY_AGENT_ASAN_ERROR_INFO_H_
-#define SYZYGY_AGENT_ASAN_ERROR_INFO_H_
-
-#include "base/callback.h"
-#include "syzygy/agent/asan/stack_capture.h"
-
-namespace agent {
-namespace asan {
-
-// Forward declarations.
-class StackCaptureCache;
-struct BlockHeader;
-
-// The different memory access modes that we can encounter.
-enum AccessMode {
-  ASAN_READ_ACCESS,
-  ASAN_WRITE_ACCESS,
-  ASAN_UNKNOWN_ACCESS
-};
-
-// Enumeration of the different kinds of bad heap accesses that we can
-// encounter.
-enum BadAccessKind {
-  // This enum should start with bad access type that are not relative to a
-  // heap block.
-  // @note The ordering is important because those labels are used in
-  //     numeric inequalities.
-  UNKNOWN_BAD_ACCESS,
-  WILD_ACCESS,
-  INVALID_ADDRESS,
-  CORRUPT_BLOCK,
-  CORRUPT_HEAP,
-
-  // This enum should end with bad access types that are relative to heap
-  // blocks.
-  USE_AFTER_FREE,
-  HEAP_BUFFER_OVERFLOW,
-  HEAP_BUFFER_UNDERFLOW,
-  DOUBLE_FREE
-};
-
-// The different types of errors we can encounter.
-extern const char kHeapUseAfterFree[];
-extern const char kHeapBufferUnderFlow[];
-extern const char kHeapBufferOverFlow[];
-extern const char kAttemptingDoubleFree[];
-extern const char kInvalidAddress[];
-extern const char kWildAccess[];
-extern const char kHeapUnknownError[];
-extern const char kHeapCorruptBlock[];
-extern const char kCorruptHeap[];
-
-// Store the information that we want to report about a block.
-// TODO(sebmarchand): Rename this to avoid the confusion with the BlockInfo
-//     structure ?
-struct AsanBlockInfo {
-  // The address of the header for this block.
-  const void* header;
-  // The user size of the block.
-  size_t user_size : 30;
-  // This is implicitly a BlockState value.
-  size_t state : 2;
-  // The ID of the allocation thread.
-  DWORD alloc_tid;
-  // The ID of the free thread.
-  DWORD free_tid;
-  // True iff the block is corrupt.
-  bool corrupt;
-  // The allocation stack trace.
-  void* alloc_stack[agent::asan::StackCapture::kMaxNumFrames];
-  // The free stack trace.
-  void* free_stack[agent::asan::StackCapture::kMaxNumFrames];
-  // The size of the allocation stack trace.
-  uint8 alloc_stack_size;
-  // The size of the free stack trace.
-  uint8 free_stack_size;
-};
-
-struct AsanCorruptBlockRange {
-  // The beginning address of the range.
-  const void* address;
-  // The length of the range.
-  size_t length;
-  // The number of blocks in this range.
-  size_t block_count;
-  // The number of blocks in the |block_info| array.
-  size_t block_info_count;
-  // The information about the blocks in this range. This may include one or
-  // more of the corrupt blocks and/or the valid blocks surrounding them; at the
-  // very least it will contain the first corrupt block in the range. The real
-  // length of this array will be stored in |block_info_count|. The array itself
-  // is allocated on the stack so that it gets shipped with minidumps.
-  AsanBlockInfo* block_info;
-};
-
-// Store the information about a bad memory access.
-struct AsanErrorInfo {
-  // The address where the bad access happened.
-  void* location;
-  // The context prior to the crash.
-  CONTEXT context;
-  // The allocation stack trace.
-  void* alloc_stack[agent::asan::StackCapture::kMaxNumFrames];
-  // The size of the allocation stack trace.
-  uint8 alloc_stack_size;
-  // The ID of the allocation thread.
-  DWORD alloc_tid;
-  // The free stack trace.
-  void* free_stack[agent::asan::StackCapture::kMaxNumFrames];
-  // The size of the free stack trace.
-  uint8 free_stack_size;
-  // The ID of the free thread.
-  DWORD free_tid;
-  // The ID of the crash stack, this is needed to be able to blacklist some
-  // known bugs.
-  StackCapture::StackId crash_stack_id;
-  // The error type.
-  BadAccessKind error_type;
-  // The access mode.
-  AccessMode access_mode;
-  // The access size.
-  size_t access_size;
-  // The information about the shadow memory for this address, this would be
-  // something like: "0x12345678 is located 8 bytes inside of a 10-byte region
-  // [0x12345670,0x1234567A)."
-  char shadow_info[128];
-  // A textual description of the shadow memory around |location|.
-  char shadow_memory[512];
-  // The time since the memory block containing this address has been freed.
-  // This would be equal to zero if the block is still allocated.
-  uint32 milliseconds_since_free;
-  // Indicates if the heap is corrupt.
-  bool heap_is_corrupt;
-  // The number of corrupt ranges encountered.
-  size_t corrupt_range_count;
-  // The number of corrupt blocks encountered.
-  size_t corrupt_block_count;
-  // The number of corrupt ranges reported in |corrupt_ranges|.
-  size_t corrupt_ranges_reported;
-  // The information about the corrupt ranges of memory. The real length of this
-  // array will be stored in |corrupt_ranges_reported|. This will be NULL if
-  // |corrupt_ranges_reported| is zero.
-  AsanCorruptBlockRange* corrupt_ranges;
-};
-
-// This callback allows a heap manager to report heap consistency problems that
-// it encounters during its operation. This is usually plumbed into the ASan
-// runtime so that the errors may be appropriately reported.
-//
-// |asan_error_info| contains information about the primary heap error that
-// was encountered. It is guaranteed to be on the stack.
-typedef base::Callback<void(AsanErrorInfo* asan_error_info)>
-    HeapErrorCallback;
-
-// Returns a string describing a bad access kind.
-// @param bad_access_kind The bad access kind for which we want a textual
-//     representation.
-// @returns a string describing the bad access kind.
-const char* ErrorInfoAccessTypeToStr(BadAccessKind bad_access_kind);
-
-// Get information about a bad access.
-// @param stack_cache The stack cache that owns the alloc and free stack traces
-//     of the blocks.
-// @param bad_access_info Will receive the information about this access.
-// @returns true if the address belongs to a memory block, false otherwise.
-bool ErrorInfoGetBadAccessInformation(StackCaptureCache* stack_cache,
-                                      AsanErrorInfo* bad_access_info);
-
-// Give the type of a bad heap access corresponding to an address.
-// @param addr The address causing a bad heap access.
-// @param header The header of the block containing this address.
-// @returns The type of the bad heap access corresponding to this address.
-// @note Exposed for unittesting.
-BadAccessKind ErrorInfoGetBadAccessKind(const void* addr,
-                                        const BlockHeader* header);
-
-// Retrieves a block's metadata.
-// @param stack_cache The stack cache that owns the alloc and free stack traces
-//     of this block.
-// @param asan_block_info Will receive the block's metadata.
-void ErrorInfoGetAsanBlockInfo(StackCaptureCache* stack_cache,
-                               AsanBlockInfo* asan_block_info);
-
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_ERROR_INFO_H_
diff --git a/syzygy/agent/asan/error_info_unittest.cc b/syzygy/agent/asan/error_info_unittest.cc
deleted file mode 100644
index 15d7399..0000000
--- a/syzygy/agent/asan/error_info_unittest.cc
+++ /dev/null
@@ -1,223 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/error_info.h"
-
-#include <windows.h>
-
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/unittest_util.h"
-
-namespace agent {
-namespace asan {
-
-namespace {
-
-typedef testing::TestWithAsanRuntime AsanErrorInfoTest;
-
-}  // namespace
-
-TEST_F(AsanErrorInfoTest, ErrorInfoAccessTypeToStr) {
-  EXPECT_EQ(kHeapUseAfterFree, ErrorInfoAccessTypeToStr(USE_AFTER_FREE));
-  EXPECT_EQ(kHeapBufferUnderFlow,
-            ErrorInfoAccessTypeToStr(HEAP_BUFFER_UNDERFLOW));
-  EXPECT_EQ(kHeapBufferOverFlow,
-            ErrorInfoAccessTypeToStr(HEAP_BUFFER_OVERFLOW));
-  EXPECT_EQ(kAttemptingDoubleFree, ErrorInfoAccessTypeToStr(DOUBLE_FREE));
-  EXPECT_EQ(kInvalidAddress, ErrorInfoAccessTypeToStr(INVALID_ADDRESS));
-  EXPECT_EQ(kWildAccess, ErrorInfoAccessTypeToStr(WILD_ACCESS));
-  EXPECT_EQ(kHeapUnknownError, ErrorInfoAccessTypeToStr(UNKNOWN_BAD_ACCESS));
-  EXPECT_EQ(kHeapCorruptBlock, ErrorInfoAccessTypeToStr(CORRUPT_BLOCK));
-  EXPECT_EQ(kCorruptHeap, ErrorInfoAccessTypeToStr(CORRUPT_HEAP));
-}
-
-TEST_F(AsanErrorInfoTest, ErrorInfoGetBadAccessInformation) {
-  testing::FakeAsanBlock fake_block(kShadowRatioLog, runtime_.stack_cache());
-  const size_t kAllocSize = 100;
-  EXPECT_TRUE(fake_block.InitializeBlock(kAllocSize));
-
-  AsanErrorInfo error_info = {};
-  error_info.location = fake_block.block_info.body +
-      kAllocSize + 1;
-  EXPECT_TRUE(ErrorInfoGetBadAccessInformation(runtime_.stack_cache(),
-                                               &error_info));
-  EXPECT_EQ(HEAP_BUFFER_OVERFLOW, error_info.error_type);
-
-  EXPECT_TRUE(fake_block.MarkBlockAsQuarantined());
-  error_info.location = fake_block.block_info.body;
-  EXPECT_TRUE(ErrorInfoGetBadAccessInformation(runtime_.stack_cache(),
-                                               &error_info));
-  EXPECT_EQ(USE_AFTER_FREE, error_info.error_type);
-
-  error_info.location = fake_block.buffer_align_begin - 1;
-  EXPECT_FALSE(ErrorInfoGetBadAccessInformation(runtime_.stack_cache(),
-                                                &error_info));
-}
-
-TEST_F(AsanErrorInfoTest, GetBadAccessInformationNestedBlock) {
-  // Test a nested use after free. We allocate an outer block and an inner block
-  // inside it, then we mark the outer block as quarantined and we test a bad
-  // access inside the inner block.
-
-  testing::FakeAsanBlock fake_block(kShadowRatioLog, runtime_.stack_cache());
-  const size_t kInnerBlockAllocSize = 100;
-
-  // Allocates the outer block.
-  BlockLayout outer_block_layout = {};
-  BlockPlanLayout(kShadowRatio, kShadowRatio, kInnerBlockAllocSize, 0, 0,
-      &outer_block_layout);
-  EXPECT_TRUE(fake_block.InitializeBlock(outer_block_layout.block_size));
-
-  StackCapture stack;
-  stack.InitFromStack();
-
-  // Initializes the inner block.
-  BlockLayout inner_block_layout = {};
-  BlockPlanLayout(kShadowRatio,
-                  kShadowRatio,
-                  kInnerBlockAllocSize,
-                  0,
-                  0,
-                  &inner_block_layout);
-  BlockInfo inner_block_info = {};
-  BlockInitialize(inner_block_layout, fake_block.block_info.body, true,
-      &inner_block_info);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), inner_block_info.body);
-  Shadow::PoisonAllocatedBlock(inner_block_info);
-  inner_block_info.header->alloc_stack =
-      runtime_.stack_cache()->SaveStackTrace(stack);
-  BlockHeader* inner_header = inner_block_info.header;
-  BlockHeader* outer_header = reinterpret_cast<BlockHeader*>(
-      fake_block.buffer_align_begin);
-
-  AsanErrorInfo error_info = {};
-
-  // Mark the inner block as quarantined and check that we detect a use after
-  // free when trying to access its data.
-  inner_block_info.header->free_stack =
-      runtime_.stack_cache()->SaveStackTrace(stack);
-  EXPECT_NE(reinterpret_cast<void*>(NULL), inner_header->free_stack);
-  inner_header->state = QUARANTINED_BLOCK;
-
-  error_info.location = fake_block.block_info.body;
-  EXPECT_TRUE(ErrorInfoGetBadAccessInformation(runtime_.stack_cache(),
-                                               &error_info));
-  EXPECT_EQ(USE_AFTER_FREE, error_info.error_type);
-  EXPECT_NE(reinterpret_cast<void*>(NULL), error_info.free_stack);
-
-  EXPECT_EQ(inner_header->free_stack->num_frames(), error_info.free_stack_size);
-  for (size_t i = 0; i < inner_header->free_stack->num_frames(); ++i)
-    EXPECT_EQ(inner_header->free_stack->frames()[i], error_info.free_stack[i]);
-
-  // Mark the outer block as quarantined, we should detect a use after free
-  // when trying to access the data of the inner block, and the free stack
-  // should be the one of the inner block.
-  EXPECT_TRUE(fake_block.MarkBlockAsQuarantined());
-  EXPECT_NE(ALLOCATED_BLOCK, static_cast<BlockState>(outer_header->state));
-  EXPECT_NE(reinterpret_cast<void*>(NULL), outer_header->free_stack);
-
-  // Tests an access in the inner block.
-  error_info.location = inner_block_info.body;
-  EXPECT_TRUE(ErrorInfoGetBadAccessInformation(runtime_.stack_cache(),
-                                               &error_info));
-  EXPECT_EQ(USE_AFTER_FREE, error_info.error_type);
-  EXPECT_NE(reinterpret_cast<void*>(NULL), error_info.free_stack);
-
-  EXPECT_EQ(inner_header->free_stack->num_frames(), error_info.free_stack_size);
-  for (size_t i = 0; i < inner_header->free_stack->num_frames(); ++i)
-    EXPECT_EQ(inner_header->free_stack->frames()[i], error_info.free_stack[i]);
-}
-
-TEST_F(AsanErrorInfoTest, ErrorInfoGetBadAccessKind) {
-  const size_t kAllocSize = 100;
-  testing::FakeAsanBlock fake_block(kShadowRatioLog, runtime_.stack_cache());
-  EXPECT_TRUE(fake_block.InitializeBlock(kAllocSize));
-  uint8* heap_underflow_address = fake_block.block_info.body - 1;
-  uint8* heap_overflow_address = fake_block.block_info.body +
-      kAllocSize * sizeof(uint8);
-  EXPECT_EQ(HEAP_BUFFER_UNDERFLOW,
-            ErrorInfoGetBadAccessKind(heap_underflow_address,
-                                      fake_block.block_info.header));
-  EXPECT_EQ(HEAP_BUFFER_OVERFLOW,
-            ErrorInfoGetBadAccessKind(heap_overflow_address,
-                                      fake_block.block_info.header));
-  EXPECT_TRUE(fake_block.MarkBlockAsQuarantined());
-  EXPECT_EQ(USE_AFTER_FREE, ErrorInfoGetBadAccessKind(
-      fake_block.block_info.body, fake_block.block_info.header));
-}
-
-TEST_F(AsanErrorInfoTest, ErrorInfoGetAsanBlockInfo) {
-  const size_t kAllocSize = 100;
-  testing::FakeAsanBlock fake_block(kShadowRatioLog, runtime_.stack_cache());
-  EXPECT_TRUE(fake_block.InitializeBlock(kAllocSize));
-
-  AsanBlockInfo asan_block_info = {};
-  asan_block_info.header = fake_block.block_info.header;
-  asan_block_info.corrupt = !BlockChecksumIsValid(fake_block.block_info);
-  ErrorInfoGetAsanBlockInfo(runtime_.stack_cache(), &asan_block_info);
-
-  // Test ErrorInfoGetAsanBlockInfo with an allocated block.
-  EXPECT_EQ(fake_block.block_info.body_size, asan_block_info.user_size);
-  EXPECT_EQ(ALLOCATED_BLOCK, static_cast<BlockState>(asan_block_info.state));
-  EXPECT_EQ(fake_block.block_info.header->state,
-            static_cast<BlockState>(asan_block_info.state));
-  EXPECT_EQ(::GetCurrentThreadId(), asan_block_info.alloc_tid);
-  EXPECT_EQ(0, asan_block_info.free_tid);
-  EXPECT_FALSE(asan_block_info.corrupt);
-  EXPECT_EQ(fake_block.block_info.header->alloc_stack->num_frames(),
-            asan_block_info.alloc_stack_size);
-  EXPECT_EQ(0, asan_block_info.free_stack_size);
-
-  // Now test it with a quarantined block.
-  EXPECT_TRUE(fake_block.MarkBlockAsQuarantined());
-  ErrorInfoGetAsanBlockInfo(runtime_.stack_cache(), &asan_block_info);
-  EXPECT_EQ(QUARANTINED_BLOCK, static_cast<BlockState>(asan_block_info.state));
-  EXPECT_EQ(fake_block.block_info.header->state,
-            static_cast<BlockState>(asan_block_info.state));
-  EXPECT_EQ(::GetCurrentThreadId(), asan_block_info.free_tid);
-  EXPECT_EQ(fake_block.block_info.header->free_stack->num_frames(),
-            asan_block_info.free_stack_size);
-
-  // Ensure that the block is correctly tagged as corrupt if the header is
-  // invalid.
-  fake_block.block_info.header->magic = ~kBlockHeaderMagic;
-  ErrorInfoGetAsanBlockInfo(runtime_.stack_cache(), &asan_block_info);
-  EXPECT_TRUE(asan_block_info.corrupt);
-  fake_block.block_info.header->magic = kBlockHeaderMagic;
-}
-
-TEST_F(AsanErrorInfoTest, GetTimeSinceFree) {
-  const size_t kAllocSize = 100;
-  const size_t kSleepTime = 25;
-  testing::FakeAsanBlock fake_block(kShadowRatioLog, runtime_.stack_cache());
-  EXPECT_TRUE(fake_block.InitializeBlock(kAllocSize));
-
-  uint32 ticks_before_free = ::GetTickCount();
-  EXPECT_TRUE(fake_block.MarkBlockAsQuarantined());
-  ::Sleep(kSleepTime);
-  AsanErrorInfo error_info = {};
-  error_info.error_type = USE_AFTER_FREE;
-  error_info.location = fake_block.block_info.body;
-  EXPECT_TRUE(ErrorInfoGetBadAccessInformation(runtime_.stack_cache(),
-                                               &error_info));
-  EXPECT_NE(0U, error_info.milliseconds_since_free);
-
-  uint32 ticks_delta = ::GetTickCount() - ticks_before_free;
-  EXPECT_GT(ticks_delta, 0U);
-
-  EXPECT_GE(ticks_delta, error_info.milliseconds_since_free);
-}
-
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heap.h b/syzygy/agent/asan/heap.h
deleted file mode 100644
index 9cba350..0000000
--- a/syzygy/agent/asan/heap.h
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Declares the interface that all heap implementations must implement.
-// This is a vastly simplified interface as the instrumentation layer
-// provides more advanced features (validation, iteration, etc).
-//
-// This also declares the interface for an instrumented heap. An instrumented
-// heap has explicit knowledge of the fact that it is laying out blocks
-// with redzones, as due to heap implementation details it may need to grow
-// the redzones of the block being allocated.
-
-#ifndef SYZYGY_AGENT_ASAN_HEAP_H_
-#define SYZYGY_AGENT_ASAN_HEAP_H_
-
-#include "syzygy/agent/asan/block.h"
-
-namespace agent {
-namespace asan {
-
-// An extremely simple heap interface. More advanced heap features are
-// provided by the instrumentation layer which is overlaid on top of a
-// raw heap. This is the API for a heap that performs actual memory
-// management of simple contiguous chunks of memory. Instrumented heaps
-// (for allocating Blocks, with redzones, etc) are allocated and laid out
-// by BlockHeap implementations.
-class HeapInterface {
- public:
-  // A bitset of features supported by this heap.
-  enum HeapFeatures {
-    // If this is set then the heap reports reserved memory via the
-    // MemoryNotifierInterface. This implies that allocations will come
-    // from regions of memory that have been previously redzoned, and
-    // guides the heap manager in maintaining consistent shadow memory.
-    kHeapReportsReservations = 1 << 0,
-
-    // If this bit is set then the heap is able to determine if a given
-    // address is part of an active allocation owned by the heap, via the
-    // 'IsAllocated' function.
-    kHeapSupportsIsAllocated = 1 << 1,
-
-    // If this bit is set then the heap supports returning allocation sizes.
-    kHeapSupportsGetAllocationSize = 1 << 2,
-
-    // If this bit is set then the results returned by GetAllocationSize are
-    // approximate, and reflect the size of the block of memory returned for
-    // the allocation, not the actual initially requested amount. Can only be
-    // set in conjunction with kHeapSupportsGetAllocationSize.
-    kHeapGetAllocationSizeIsUpperBound = 1 << 3,
-  };
-
-  // The return value of GetAllocationSize if the heap does not support it.
-  static const size_t kUnknownSize = ~0;
-
-  // Virtual destructor.
-  virtual ~HeapInterface() { }
-
-  // @returns the heap features.
-  virtual uint32 GetHeapFeatures() const = 0;
-
-  // Allocates memory from the heap. It is valid to request an allocation
-  // of size zero, in which case any return address is valid. If @p bytes
-  // is non-zero and the request fails this should return NULL. The allocation
-  // must have an alignment of at least kShadowRatio.
-  // @param bytes The size of the requested allocation, in bytes.
-  // @returns a valid pointer on success, or NULL on failure.
-  virtual void* Allocate(size_t bytes) = 0;
-
-  // Frees an allocation, returning the memory to the underlying heap. It is
-  // invalid to attempt to free memory not previously allocated by this heap,
-  // or double free previously freed memory.
-  // @param alloc The address of the allocation.
-  // @returns true on success, false otherwise.
-  virtual bool Free(void* alloc) = 0;
-
-  // Determines if the heap owns the given allocation.
-  // @param alloc An address.
-  // @returns true if @p alloc is an address previously returned by a call
-  //     to 'Allocate', and not yet returned via 'Free'.
-  // @note This will always return false unless the heap has the
-  //     kHeapSupportsIsAllocated feature.
-  virtual bool IsAllocated(void* alloc) = 0;
-
-  // Returns the size of the given allocation.
-  // @param alloc An address previously returned by Allocate.
-  // @returns the size of the allocation.
-  // @note This will always return kUnknownSize unless the heap has the
-  //     kHeapSupportsGetAllocationSize feature.
-  virtual size_t GetAllocationSize(void* alloc) = 0;
-
-  // Locks the heap. All other calls to the heap will be blocked until
-  // a corresponding call to Unlock.
-  virtual void Lock() = 0;
-
-  // Unlocks the heap.
-  virtual void Unlock() = 0;
-};
-
-// Declares the interface that a block-allocating heap must implement. The API
-// reflects the fact that the heap implementation is aware that it is
-// allocating Block objects with redzones, and allows for the implementation to
-// potentially grow the redzones of the requested block. This is an extension
-// of HeapInterface.
-class BlockHeapInterface : public HeapInterface {
- public:
-  // Virtual destructor.
-  virtual ~BlockHeapInterface() { }
-
-  // Allocates a block from the heap. If this heap is unable to satisfy the
-  // allocation then it can simply return NULL and not initialize the block
-  // layout.
-  // @param size The size of the body of the allocation. Can be 0.
-  // @param min_left_redzone_size The minimum size of the left redzone.
-  // @param min_right_redzone_size The minimum size of the right redzone.
-  // @param layout The layout structure to be populated.
-  // @returns a pointer to the allocation upon success, otherwise NULL.
-  virtual void* AllocateBlock(size_t size,
-                              size_t min_left_redzone_size,
-                              size_t min_right_redzone_size,
-                              BlockLayout* layout) = 0;
-
-  // Frees the block at the given address.
-  // @returns true on success, false otherwise.
-  virtual bool FreeBlock(const BlockInfo& block_info) = 0;
-};
-
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_HEAP_H_
diff --git a/syzygy/agent/asan/heap_manager.h b/syzygy/agent/asan/heap_manager.h
deleted file mode 100644
index 5d6817b..0000000
--- a/syzygy/agent/asan/heap_manager.h
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Declares a minimal heap manager interface.
-
-#ifndef SYZYGY_AGENT_ASAN_HEAP_MANAGER_H_
-#define SYZYGY_AGENT_ASAN_HEAP_MANAGER_H_
-
-#include "base/basictypes.h"
-
-namespace agent {
-namespace asan {
-
-// A heap manager is responsible for creating and managing heaps. It also acts
-// as a proxy between the heap function interceptors and the underlying heaps.
-class HeapManagerInterface {
- public:
-  typedef uintptr_t HeapId;
-
-  // Virtual destructor.
-  virtual ~HeapManagerInterface() { }
-
-  // Creates a new heap.
-  // @returns the ID of the heap that has been created.
-  virtual HeapId CreateHeap() = 0;
-
-  // Destroy a heap.
-  // @param heap The ID of the heap to destroy.
-  // @returns true on success, false otherwise.
-  virtual bool DestroyHeap(HeapId heap) = 0;
-
-  // Do an allocation in a given heap.
-  // @param heap The ID of the heap that should preferably be used for the
-  //     allocation. The implementation is free to use this heap or not.
-  // @param bytes The requested size of the allocation, in bytes.
-  // @returns A pointer to the new allocation on success, NULL otherwise.
-  virtual void* Allocate(HeapId heap, size_t bytes) = 0;
-
-  // Free a given heap allocation.
-  // @param heap A hint on the heap that might contain this allocation.
-  // @param alloc The pointer to the allocation to be freed. This must be a
-  //     value that was previously returned by a call to 'Allocate'.
-  // @returns true on failure, false otherwise.
-  virtual bool Free(HeapId heap, void* alloc) = 0;
-
-  // Returns the size of a heap allocation.
-  // @param heap A hint on the heap that might contain this allocation.
-  // @param alloc The pointer to the allocation whose size is to be calculated.
-  //     This must be a value that was previously returned by a call to
-  //     'Allocate'.
-  // @returns the size of the block on success, 0 otherwise.
-  virtual size_t Size(HeapId heap, const void* alloc) = 0;
-
-  // Locks a heap.
-  // @param heap The ID of the heap that should be locked.
-  virtual void Lock(HeapId heap) = 0;
-
-  // Unlocks a heap.
-  // @param heap The ID of the heap that should be unlocked.
-  virtual void Unlock(HeapId heap) = 0;
-};
-
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_HEAP_MANAGER_H_
diff --git a/syzygy/agent/asan/heap_managers/block_heap_manager.cc b/syzygy/agent/asan/heap_managers/block_heap_manager.cc
deleted file mode 100644
index f45ab9c..0000000
--- a/syzygy/agent/asan/heap_managers/block_heap_manager.cc
+++ /dev/null
@@ -1,436 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heap_managers/block_heap_manager.h"
-
-#include <utility>
-
-#include "base/bind.h"
-#include "base/rand_util.h"
-#include "syzygy/agent/asan/asan_runtime.h"
-#include "syzygy/agent/asan/shadow.h"
-#include "syzygy/agent/asan/heaps/simple_block_heap.h"
-#include "syzygy/common/asan_parameters.h"
-
-namespace agent {
-namespace asan {
-namespace heap_managers {
-
-namespace {
-
-typedef HeapManagerInterface::HeapId HeapId;
-using heaps::ZebraBlockHeap;
-
-}  // namespace
-
-BlockHeapManager::BlockHeapManager(StackCaptureCache* stack_cache)
-    : stack_cache_(stack_cache),
-      zebra_block_heap_(NULL),
-      internal_heap_(&shadow_memory_notifier_, &internal_win_heap_) {
-  DCHECK_NE(static_cast<StackCaptureCache*>(NULL), stack_cache);
-  SetDefaultAsanParameters(&parameters_);
-  PropagateParameters();
-
-  // Creates the process heap.
-  HeapInterface* process_heap_underlying_heap =
-      new heaps::WinHeap(::GetProcessHeap());
-  process_heap_ = new heaps::SimpleBlockHeap(process_heap_underlying_heap);
-  underlying_heaps_map_.insert(std::make_pair(process_heap_,
-                                              process_heap_underlying_heap));
-  heaps_.insert(std::make_pair(process_heap_, &shared_quarantine_));
-}
-
-BlockHeapManager::~BlockHeapManager() {
-  base::AutoLock lock(lock_);
-  // Delete all the heaps.
-  HeapQuarantineMap::iterator iter_heaps = heaps_.begin();
-  for (; iter_heaps != heaps_.end(); ++iter_heaps)
-    DestroyHeapUnlocked(iter_heaps->first, iter_heaps->second);
-  heaps_.clear();
-
-  process_heap_ = NULL;
-  // Clear the zebra heap reference since it was deleted.
-  zebra_block_heap_ = NULL;
-}
-
-HeapId BlockHeapManager::CreateHeap() {
-  // Creates the underlying heap used by this heap.
-  HeapInterface* win_heap = new heaps::WinHeap();
-  // Creates the heap.
-  BlockHeapInterface* heap = new heaps::SimpleBlockHeap(win_heap);
-
-  base::AutoLock lock(lock_);
-  underlying_heaps_map_.insert(std::make_pair(heap, win_heap));
-  heaps_.insert(std::make_pair(heap, &shared_quarantine_));
-
-  return reinterpret_cast<HeapId>(heap);
-}
-
-bool BlockHeapManager::DestroyHeap(HeapId heap_id) {
-  base::AutoLock lock(lock_);
-  HeapQuarantineMap::iterator iter = heaps_.find(
-      reinterpret_cast<BlockHeapInterface*>(heap_id));
-  // We should always be able to retrieve a heap that we previously passed to
-  // the user.
-  CHECK(iter != heaps_.end());
-  // Destroy the heap and flush its quarantine.
-  DestroyHeapUnlocked(iter->first, iter->second);
-
-  heaps_.erase(iter);
-  return true;
-}
-
-void* BlockHeapManager::Allocate(HeapId heap_id, size_t bytes) {
-  DCHECK_NE(static_cast<HeapId>(NULL), heap_id);
-
-  // Some allocations can pass through without instrumentation.
-  if (parameters_.allocation_guard_rate < 1.0 &&
-      base::RandDouble() >= parameters_.allocation_guard_rate) {
-    void* alloc =
-        reinterpret_cast<BlockHeapInterface*>(heap_id)->Allocate(bytes);
-    return alloc;
-  }
-
-  void* alloc = NULL;
-  BlockLayout block_layout = {};
-
-  // Always try to allocate in the zebra heap.
-  if (parameters_.enable_zebra_block_heap) {
-    CHECK_NE(reinterpret_cast<heaps::ZebraBlockHeap*>(NULL),
-             zebra_block_heap_);
-
-    alloc = zebra_block_heap_->AllocateBlock(
-        bytes,
-        0,
-        parameters_.trailer_padding_size + sizeof(BlockTrailer),
-        &block_layout);
-
-    if (alloc != NULL)
-      heap_id = reinterpret_cast<HeapId>(zebra_block_heap_);
-  }
-
-  // Fallback to the provided heap.
-  if (alloc == NULL) {
-    alloc = reinterpret_cast<BlockHeapInterface*>(heap_id)->AllocateBlock(
-        bytes,
-        0,
-        parameters_.trailer_padding_size + sizeof(BlockTrailer),
-        &block_layout);
-  }
-
-  DCHECK_NE(reinterpret_cast<void*>(NULL), alloc);
-  DCHECK_EQ(0u, reinterpret_cast<size_t>(alloc) % kShadowRatio);
-  BlockInfo block = {};
-  BlockInitialize(block_layout, alloc, false, &block);
-
-  // Capture the current stack. InitFromStack is inlined to preserve the
-  // greatest number of stack frames.
-  StackCapture stack;
-  stack.InitFromStack();
-  block.header->alloc_stack = stack_cache_->SaveStackTrace(stack);
-  block.header->free_stack = NULL;
-
-  block.trailer->heap_id = heap_id;
-
-  BlockSetChecksum(block);
-  Shadow::PoisonAllocatedBlock(block);
-  return block.body;
-}
-
-bool BlockHeapManager::Free(HeapId heap_id, void* alloc) {
-  DCHECK_NE(static_cast<HeapId>(NULL), heap_id);
-
-  BlockInfo block_info = {};
-  if (!Shadow::IsBeginningOfBlockBody(alloc) ||
-      !Shadow::BlockInfoFromShadow(alloc, &block_info)) {
-    // TODO(chrisha|sebmarchand): Handle invalid allocation addresses.
-
-    // Assume that this block was allocated without guards.
-    return reinterpret_cast<BlockHeapInterface*>(heap_id)->Free(alloc);
-  }
-
-  if (!BlockChecksumIsValid(block_info)) {
-    // The free stack hasn't yet been set, but may have been filled with junk.
-    // Reset it.
-    block_info.header->free_stack = NULL;
-    ReportHeapError(alloc, CORRUPT_BLOCK);
-    return FreeCorruptBlock(&block_info);
-  }
-
-  if (block_info.header->state == QUARANTINED_BLOCK) {
-    ReportHeapError(alloc, DOUBLE_FREE);
-    return false;
-  }
-
-  // heap_id is just a hint, the block trailer contains the heap used for the
-  // allocation.
-  heap_id = block_info.trailer->heap_id;
-  DCHECK_NE(static_cast<HeapId>(NULL), heap_id);
-
-  BlockQuarantineInterface* quarantine = NULL;
-  {
-    base::AutoLock lock(lock_);
-    HeapQuarantineMap::iterator iter_heap = heaps_.find(
-        reinterpret_cast<BlockHeapInterface*>(heap_id));
-    // We should always be able to retrieve a heap that we previously passed to
-    // the user.
-    CHECK(iter_heap != heaps_.end());
-
-    DCHECK_NE(reinterpret_cast<ShardedBlockQuarantine*>(NULL),
-              iter_heap->second);
-    quarantine = iter_heap->second;
-  }
-
-  if (quarantine->Push(block_info.header)) {
-    StackCapture stack;
-    stack.InitFromStack();
-    block_info.header->free_stack =
-        stack_cache_->SaveStackTrace(stack);
-    block_info.trailer->free_ticks = ::GetTickCount();
-    block_info.trailer->free_tid = ::GetCurrentThreadId();
-
-    block_info.header->state = QUARANTINED_BLOCK;
-
-    // Poison the released alloc (marked as freed) and quarantine the block.
-    // Note that the original data is left intact. This may make it easier
-    // to debug a crash report/dump on access to a quarantined block.
-    Shadow::MarkAsFreed(block_info.body, block_info.body_size);
-    BlockSetChecksum(block_info);
-    TrimQuarantine(quarantine);
-  } else {
-    return FreePristineBlock(&block_info);
-  }
-
-  return true;
-}
-
-size_t BlockHeapManager::Size(HeapId heap_id, const void* alloc) {
-  DCHECK_NE(static_cast<HeapId>(NULL), heap_id);
-  BlockHeader* header = BlockGetHeaderFromBody(alloc);
-  if (header == NULL)
-    return 0;
-  return header->body_size;
-}
-
-void BlockHeapManager::Lock(HeapId heap_id) {
-  DCHECK_NE(static_cast<HeapId>(NULL), heap_id);
-  reinterpret_cast<HeapInterface*>(heap_id)->Lock();
-}
-
-void BlockHeapManager::Unlock(HeapId heap_id) {
-  DCHECK_NE(static_cast<HeapId>(NULL), heap_id);
-  reinterpret_cast<HeapInterface*>(heap_id)->Unlock();
-}
-
-void BlockHeapManager::set_parameters(
-    const common::AsanParameters& parameters) {
-  {
-    base::AutoLock lock(lock_);
-    parameters_ = parameters;
-  }
-  // Releases the lock before propagating the parameters.
-  PropagateParameters();
-}
-
-void BlockHeapManager::PropagateParameters() {
-  size_t quarantine_size = shared_quarantine_.max_quarantine_size();
-  shared_quarantine_.set_max_quarantine_size(parameters_.quarantine_size);
-  shared_quarantine_.set_max_object_size(parameters_.quarantine_block_size);
-
-  // Trim the quarantine if its maximum size has decreased.
-  if (quarantine_size > parameters_.quarantine_size)
-    TrimQuarantine(&shared_quarantine_);
-
-  if (parameters_.enable_zebra_block_heap && zebra_block_heap_ == NULL) {
-    // Initialize the zebra heap only if it isn't already initialized.
-    // The zebra heap cannot be resized once created.
-    base::AutoLock lock(lock_);
-    zebra_block_heap_ = new ZebraBlockHeap(parameters_.zebra_block_heap_size,
-                                           &shadow_memory_notifier_,
-                                           &internal_heap_);
-    heaps_.insert(std::make_pair(zebra_block_heap_, zebra_block_heap_));
-  }
-
-  if (zebra_block_heap_ != NULL) {
-    zebra_block_heap_->set_quarantine_ratio(
-        parameters_.zebra_block_heap_quarantine_ratio);
-    TrimQuarantine(zebra_block_heap_);
-  }
-
-  // TODO(chrisha|sebmarchand): Clean up existing blocks that exceed the
-  //     maximum block size? This will require an entirely new TrimQuarantine
-  //     function. Since this is never changed at runtime except in our
-  //     unittests, this is not clearly useful.
-}
-
-bool BlockHeapManager::DestroyHeapUnlocked(
-    BlockHeapInterface* heap,
-    BlockQuarantineInterface* quarantine) {
-  DCHECK_NE(reinterpret_cast<BlockHeapInterface*>(NULL), heap);
-  DCHECK_NE(reinterpret_cast<BlockQuarantineInterface*>(NULL), quarantine);
-
-  // Starts by removing all the block from this heap from the quarantine.
-
-  BlockQuarantineInterface::ObjectVector blocks_vec;
-
-  // We'll keep the blocks that don't belong to this heap in a temporary list.
-  // While this isn't optimal in terms of performance, destroying a heap isn't a
-  // common operation.
-  // TODO(sebmarchand): Add a version of the ShardedBlockQuarantine::Empty
-  //     method that accepts a functor to filter the blocks to remove.
-  BlockQuarantineInterface::ObjectVector blocks_to_reinsert;
-  quarantine->Empty(&blocks_vec);
-  BlockQuarantineInterface::ObjectVector::iterator iter_block =
-      blocks_vec.begin();
-
-  for (; iter_block != blocks_vec.end(); ++iter_block) {
-    BlockInfo block_info = {};
-    // If we can't retrieve the block information from the shadow then it means
-    // that something went terribly wrong and that the shadow has been
-    // corrupted, there's nothing we can do in this case.
-    CHECK(Shadow::BlockInfoFromShadow(*iter_block, &block_info));
-    if (reinterpret_cast<BlockHeapInterface*>(block_info.trailer->heap_id) ==
-        heap) {
-      if (!FreePotentiallyCorruptBlock(&block_info))
-        return false;
-    } else {
-      blocks_to_reinsert.push_back(*iter_block);
-    }
-  }
-  // Restore the blocks that don't belong to this quarantine.
-  iter_block = blocks_to_reinsert.begin();
-  for (; iter_block != blocks_to_reinsert.end(); ++iter_block)
-    quarantine->Push(*iter_block);
-
-  UnderlyingHeapMap::iterator iter = underlying_heaps_map_.find(heap);
-
-  // Not all the heaps have an underlying heap.
-  if (iter != underlying_heaps_map_.end()) {
-    DCHECK_NE(reinterpret_cast<HeapInterface*>(NULL), iter->second);
-    delete iter->second;
-    underlying_heaps_map_.erase(iter);
-  }
-
-  delete heap;
-
-  return true;
-}
-
-void BlockHeapManager::TrimQuarantine(BlockQuarantineInterface* quarantine) {
-  DCHECK_NE(reinterpret_cast<BlockQuarantineInterface*>(NULL), quarantine);
-
-  BlockQuarantineInterface::ObjectVector blocks_to_free;
-
-  // Trim the quarantine to the new maximum size.
-  if (parameters_.quarantine_size == 0) {
-    quarantine->Empty(&blocks_to_free);
-  } else {
-    BlockHeader* block_to_free = NULL;
-    while (quarantine->Pop(&block_to_free))
-      blocks_to_free.push_back(block_to_free);
-  }
-
-  BlockQuarantineInterface::ObjectVector::iterator iter_block =
-      blocks_to_free.begin();
-  for (; iter_block != blocks_to_free.end(); ++iter_block) {
-    DCHECK_NE(reinterpret_cast<BlockHeader*>(NULL), *iter_block);
-    BlockInfo block_info = {};
-    CHECK(Shadow::BlockInfoFromShadow(*iter_block, &block_info));
-    CHECK(FreePotentiallyCorruptBlock(&block_info));
-  }
-}
-
-bool BlockHeapManager::FreePotentiallyCorruptBlock(BlockInfo* block_info) {
-  DCHECK_NE(static_cast<BlockInfo*>(NULL), block_info);
-  if (block_info->header->magic != kBlockHeaderMagic ||
-      !BlockChecksumIsValid(*block_info)) {
-    ReportHeapError(block_info->block, CORRUPT_BLOCK);
-    return FreeCorruptBlock(block_info);
-  } else {
-    return FreePristineBlock(block_info);
-  }
-}
-
-bool BlockHeapManager::FreeCorruptBlock(BlockInfo* block_info) {
-  DCHECK_NE(static_cast<BlockInfo*>(NULL), block_info);
-  ClearCorruptBlockMetadata(block_info);
-  return FreePristineBlock(block_info);
-}
-
-bool BlockHeapManager::FreePristineBlock(BlockInfo* block_info) {
-  DCHECK_NE(static_cast<BlockInfo*>(NULL), block_info);
-
-  BlockHeapInterface* heap = reinterpret_cast<BlockHeapInterface*>(
-      block_info->trailer->heap_id);
-
-  if (heap == NULL) {
-    // TODO(sebmarchand): Iterates over the heaps to find the one owning this
-    //     block. This is currently useless as we're using the WinHeap which
-    //     doesn't have the kHeapSupportsIsAllocated feature.
-    return false;
-  }
-
-  // Return pointers to the stacks for reference counting purposes.
-  if (block_info->header->alloc_stack != NULL) {
-    stack_cache_->ReleaseStackTrace(block_info->header->alloc_stack);
-    block_info->header->alloc_stack = NULL;
-  }
-  if (block_info->header->free_stack != NULL) {
-    stack_cache_->ReleaseStackTrace(block_info->header->free_stack);
-    block_info->header->free_stack = NULL;
-  }
-
-  block_info->header->state = FREED_BLOCK;
-
-  Shadow::Unpoison(block_info->header, block_info->block_size);
-  return heap->FreeBlock(*block_info);
-}
-
-void BlockHeapManager::ClearCorruptBlockMetadata(BlockInfo* block_info) {
-  DCHECK_NE(static_cast<BlockInfo*>(NULL), block_info);
-  DCHECK_NE(static_cast<BlockHeader*>(NULL), block_info->header);
-
-  // Set the invalid stack captures to NULL.
-  if (!stack_cache_->StackCapturePointerIsValid(
-      block_info->header->alloc_stack)) {
-    block_info->header->alloc_stack = NULL;
-  }
-  if (!stack_cache_->StackCapturePointerIsValid(
-      block_info->header->free_stack)) {
-    block_info->header->free_stack = NULL;
-  }
-}
-
-void BlockHeapManager::ReportHeapError(void* address, BadAccessKind kind) {
-  DCHECK_NE(reinterpret_cast<void*>(NULL), address);
-
-  // Collect information about the error.
-  AsanErrorInfo error_info = {};
-  ::RtlCaptureContext(&error_info.context);
-  error_info.access_mode = agent::asan::ASAN_UNKNOWN_ACCESS;
-  error_info.location = address;
-  error_info.error_type = kind;
-  ErrorInfoGetBadAccessInformation(stack_cache_, &error_info);
-  agent::asan::StackCapture stack;
-  stack.InitFromStack();
-  error_info.crash_stack_id = stack.ComputeRelativeStackId();
-
-  // We expect a callback to be set.
-  DCHECK(!heap_error_callback_.is_null());
-  heap_error_callback_.Run(&error_info);
-}
-
-}  // namespace heap_managers
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heap_managers/block_heap_manager.h b/syzygy/agent/asan/heap_managers/block_heap_manager.h
deleted file mode 100644
index 7045b9d..0000000
--- a/syzygy/agent/asan/heap_managers/block_heap_manager.h
+++ /dev/null
@@ -1,228 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Implementation of a heap manager that allocates blocks.
-
-#ifndef SYZYGY_AGENT_ASAN_HEAP_MANAGERS_BLOCK_HEAP_MANAGER_H_
-#define SYZYGY_AGENT_ASAN_HEAP_MANAGERS_BLOCK_HEAP_MANAGER_H_
-
-#include <windows.h>
-
-#include <unordered_map>
-
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-#include "syzygy/agent/asan/block_utils.h"
-#include "syzygy/agent/asan/error_info.h"
-#include "syzygy/agent/asan/heap.h"
-#include "syzygy/agent/asan/heap_manager.h"
-#include "syzygy/agent/asan/quarantine.h"
-#include "syzygy/agent/asan/stack_capture_cache.h"
-#include "syzygy/agent/asan/heaps/internal_heap.h"
-#include "syzygy/agent/asan/heaps/win_heap.h"
-#include "syzygy/agent/asan/heaps/zebra_block_heap.h"
-#include "syzygy/agent/asan/memory_notifiers/shadow_memory_notifier.h"
-#include "syzygy/agent/asan/quarantines/sharded_quarantine.h"
-#include "syzygy/common/asan_parameters.h"
-
-namespace agent {
-namespace asan {
-
-namespace heap_managers {
-
-// A block heap manager is an implementation of a heap manager that allocates
-// and manages blocks.
-//
-// It is responsible for maintaining the state of the shadow memory, and thus
-// updating it when a block's state changes. This also takes care of maintaining
-// a quarantine of freed blocks.
-//
-// When the user requests a new heap he will receive a pointer to a
-// SimpleBlockHeap by default. However the goal of this manager is to
-// automatically choose the most appropriate heap for a given allocation so the
-// actual heap that serves an allocation can be different from the one returned
-// to the user.
-//
-// The zebra heap is created once, when enabled for the first time, with a
-// specified size. It can't be resized after creation. Disabling the zebra
-// heap only disables allocations on it, deallocations will continue to work.
-// TODO(sebmarchand): Plug in other heaps, like the zebra heap and the large
-//     block heap.
-// TODO(sebmarchand): Add page protection support.
-class BlockHeapManager : public HeapManagerInterface {
- public:
-  // Constructor.
-  // @param stack_cache The stack cache to use.
-  explicit BlockHeapManager(StackCaptureCache* stack_cache);
-
-  // Destructor.
-  virtual ~BlockHeapManager();
-
-  // @name HeapManagerInterface functions.
-  // @{
-  virtual HeapId CreateHeap();
-  virtual bool DestroyHeap(HeapId heap_id);
-  virtual void* Allocate(HeapId heap_id, size_t bytes);
-  virtual bool Free(HeapId heap_id, void* alloc);
-  virtual size_t Size(HeapId heap_id, const void* alloc);
-  virtual void Lock(HeapId heap_id);
-  virtual void Unlock(HeapId heap_id);
-  // @}
-
-  // Set the parameters of this heap manager.
-  // @param trailer_padding_size The trailer padding size, in bytes.
-  void set_parameters(const common::AsanParameters& parameters);
-
-  // Get the parameters.
-  common::AsanParameters parameters() {
-    return parameters_;
-  }
-
-  // Sets the callback that this heap will invoke when heap corruption is
-  // encountered.
-  // @param heap_error_callback The callback to be invoked when heap
-  //     corruption is encountered.
-  void SetHeapErrorCallback(HeapErrorCallback heap_error_callback) {
-    heap_error_callback_ = heap_error_callback;
-  }
-
-  // Returns the process heap.
-  HeapId process_heap() { return reinterpret_cast<HeapId>(process_heap_); }
-
- protected:
-  // The type of quarantine that we use internally.
-  typedef quarantines::ShardedQuarantine<BlockHeader*,
-                                         GetTotalBlockSizeFunctor,
-                                         GetBlockHashFunctor,
-                                         kQuarantineDefaultShardingFactor>
-      ShardedBlockQuarantine;
-
-  // A map associating a block heap with its underlying heap.
-  typedef std::unordered_map<BlockHeapInterface*, HeapInterface*>
-      UnderlyingHeapMap;
-
-  // A map associating a block heap with the quarantine it will use. Many heaps
-  // may share a single quarantine.
-  typedef std::unordered_map<BlockHeapInterface*, BlockQuarantineInterface*>
-      HeapQuarantineMap;
-
-  // Propagates the parameters to the appropriate modules.
-  // @note This function is responsible for acquiring lock_ when necessary.
-  void PropagateParameters();
-
-  // Destroy a heap and flush its quarantine. If this heap has an underlying
-  // heap it'll also destroy it. All the block belonging to this heap that are
-  // in the quarantine will be freed.
-  //
-  // @param heap The heap to destroy.
-  // @param quarantine The quarantine of this heap.
-  // @returns true on success, false otherwise.
-  // @note The heap pointer will be invalid if this function succeeds.
-  // @note This must be called under lock_.
-  bool DestroyHeapUnlocked(BlockHeapInterface* heap,
-                           BlockQuarantineInterface* quarantine);
-
-  // If the quarantine of a heap is over its maximum size, trim it down until
-  // it's below the limit. If parameters_.quarantine_size is 0 then
-  // then quarantine is flushed.
-  // @param quarantine The quarantine to trim.
-  // TODO(peterssen): Change the 0-size contract. The quarantine 'contract'
-  //    establish that when the size is 0, it means unlimited, this is rather
-  //    awkward since trimming with size 0 should flush the quarantine.
-  void TrimQuarantine(BlockQuarantineInterface* quarantine);
-
-  // Free a block that might be corrupt. If the block is corrupt first reports
-  // an error before safely releasing the block.
-  // @param block_info The information about this block.
-  // @returns true if the block has been successfully freed, false otherwise.
-  bool FreePotentiallyCorruptBlock(BlockInfo* block_info);
-
-  // Free a corrupt block. This takes care of cleaning its metadata before
-  // trying to free it.
-  // @param block_info The information about this block.
-  // @returns true if the block has been successfully freed, false otherwise.
-  bool FreeCorruptBlock(BlockInfo* block_info);
-
-  // Free an allocated block. This should be called when a block is removed from
-  // the quarantine or directly freed. This takes care of updating the shadow
-  // memory and releasing the resources acquired by this block (like its stack
-  // traces). The block should either not be corrupt or cleaned from its unsafe
-  // metadata.
-  // @param block_info The information about this block.
-  // @returns true on success, false otherwise.
-  bool FreePristineBlock(BlockInfo* block_info);
-
-  // Clears the metadata of a corrupt block. After calling this function the
-  // block can safely be passed to FreeBlock.
-  // @param block_info The information about this block.
-  void ClearCorruptBlockMetadata(BlockInfo* block_info);
-
-  // Reports a heap error via the heap error callback. This is for originating
-  // errors that are detected while performing operations on a heap metadata.
-  // Read/write errors are detected outside of the manager, and query the heap
-  // for information about the error itself.
-  // @param address The address that was being accessed/manipulating when the
-  //     error was detected.
-  // @param kind The type of error encountered.
-  void ReportHeapError(void* address, BadAccessKind kind);
-
-  // The stack cache used to store the stack traces.
-  StackCaptureCache* stack_cache_;
-
-  // Protects concurrent access to the heap manager internals.
-  base::Lock lock_;
-
-  // Contains the heaps owned by this manager.
-  HeapQuarantineMap heaps_;  // Under lock_.
-
-  // The quarantine shared by the heaps created by this manager.
-  ShardedBlockQuarantine shared_quarantine_;
-
-  // Map the block heaps to their underlying heap.
-  UnderlyingHeapMap underlying_heaps_map_;  // Under lock_.
-
-  // The parameters of this heap manager.
-  common::AsanParameters parameters_;
-
-  // The callback this manager uses to expose internal state errors. These are
-  // caused by uninstrumented code (system libraries, etc), thus aren't caught
-  // at their source. Catching their side effect as early as possible allows the
-  // recovery of some useful debugging information.
-  HeapErrorCallback heap_error_callback_;
-
-  // The process's heap.
-  BlockHeapInterface* process_heap_;
-
-  // Memory notifier used to update the shadow memory.
-  memory_notifiers::ShadowMemoryNotifier shadow_memory_notifier_;
-
-  // The heap that gets used for allocation of internal data structures.
-  heaps::WinHeap internal_win_heap_;
-  heaps::InternalHeap internal_heap_;
-
-  // Hold the single ZebraBlockHeap instance used by this heap manager.
-  // The lifetime management of the zebra heap is provided by the
-  // HeapQuarantineMap, this is simply a useful pointer for finding the
-  // zebra heap directly.
-  heaps::ZebraBlockHeap* zebra_block_heap_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(BlockHeapManager);
-};
-
-}  // namespace heap_managers
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_HEAP_MANAGERS_BLOCK_HEAP_MANAGER_H_
diff --git a/syzygy/agent/asan/heap_managers/block_heap_manager_unittest.cc b/syzygy/agent/asan/heap_managers/block_heap_manager_unittest.cc
deleted file mode 100644
index dee9f5a..0000000
--- a/syzygy/agent/asan/heap_managers/block_heap_manager_unittest.cc
+++ /dev/null
@@ -1,1048 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heap_managers/block_heap_manager.h"
-
-#include <vector>
-
-#include "base/bind.h"
-#include "base/compiler_specific.h"
-#include "base/rand_util.h"
-#include "base/sha1.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/asan_runtime.h"
-#include "syzygy/agent/asan/heap.h"
-#include "syzygy/agent/asan/unittest_util.h"
-
-namespace agent {
-namespace asan {
-namespace heap_managers {
-
-namespace {
-
-using heaps::ZebraBlockHeap;
-
-typedef BlockHeapManager::HeapId HeapId;
-
-testing::NullMemoryNotifier null_memory_notifier;
-testing::DummyHeap dummy_heap;
-
-// A fake ZebraBlockHeap to simplify unit testing.
-// Wrapper with switches to enable/disable the quarantine and accept/refuse
-// allocations.
-class TestZebraBlockHeap : public heaps::ZebraBlockHeap {
- public:
-  using ZebraBlockHeap::set_quarantine_ratio;
-  using ZebraBlockHeap::quarantine_ratio;
-
-  // Constructor.
-  TestZebraBlockHeap()
-      : ZebraBlockHeap(1024 * 1024, &null_memory_notifier, &dummy_heap) {
-    refuse_allocations_ = false;
-    refuse_push_ = false;
-  }
-
-  // Virtual destructor.
-  virtual ~TestZebraBlockHeap() { }
-
-  // Wrapper that allows easily disabling allocations.
-  virtual void* AllocateBlock(size_t size,
-                              size_t min_left_redzone_size,
-                              size_t min_right_redzone_size,
-                              BlockLayout* layout) OVERRIDE {
-    if (refuse_allocations_)
-      return NULL;
-    return ZebraBlockHeap::AllocateBlock(size,
-                                         min_left_redzone_size,
-                                         min_right_redzone_size,
-                                         layout);
-  }
-
-  // Wrapper that allows easily disabling the insertion of new blocks in the
-  // quarantine.
-  virtual bool Push(BlockHeader* const &object) OVERRIDE {
-    if (refuse_push_)
-      return false;
-    return ZebraBlockHeap::Push(object);
-  }
-
-  // Enable/Disable future allocations.
-  void set_refuse_allocations(bool value) {
-    refuse_allocations_ = value;
-  }
-
-  // Enable/Disable the insertion of blocks in the quarantine.
-  void set_refuse_push(bool value) {
-    refuse_push_ = value;
-  }
-
- protected:
-  bool refuse_allocations_;
-  bool refuse_push_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(TestZebraBlockHeap);
-};
-
-// A derived class to expose protected members for unit-testing.
-class TestBlockHeapManager : public BlockHeapManager {
- public:
-  using BlockHeapManager::FreePotentiallyCorruptBlock;
-  using BlockHeapManager::HeapQuarantineMap;
-  using BlockHeapManager::SetHeapErrorCallback;
-  using BlockHeapManager::ShardedBlockQuarantine;
-  using BlockHeapManager::TrimQuarantine;
-
-  using BlockHeapManager::heaps_;
-  using BlockHeapManager::parameters_;
-  using BlockHeapManager::zebra_block_heap_;
-
-  // A derived class to expose protected members for unit-testing. This has to
-  // be nested into this one because ShardedBlockQuarantine accesses some
-  // protected fields of BlockHeapManager.
-  //
-  // This class should only expose some members or expose new functions, no new
-  // member should be added.
-  class TestQuarantine : public ShardedBlockQuarantine {
-   public:
-    using ShardedBlockQuarantine::Node;
-    using ShardedBlockQuarantine::kShardingFactor;
-    using ShardedBlockQuarantine::heads_;
-  };
-
-  // Constructor.
-  explicit TestBlockHeapManager(StackCaptureCache* stack_cache)
-      : BlockHeapManager(stack_cache) {
-  }
-
-  // Returns the quarantine associated with a heap.
-  BlockQuarantineInterface* GetHeapQuarantine(HeapId heap_id) {
-    TestBlockHeapManager::HeapQuarantineMap::iterator iter_heap =
-        heaps_.find(reinterpret_cast<BlockHeapInterface*>(heap_id));
-    if (iter_heap == heaps_.end())
-      return NULL;
-    return iter_heap->second;
-  }
-};
-
-// A derived class to expose protected members for unit-testing.
-class TestShadow : public Shadow {
- public:
-  using Shadow::kShadowSize;
-  using Shadow::shadow_;
-};
-
-// A utility class for manipulating a heap. This automatically delete the heap
-// and its content in the destructor and provides some utility functions.
-class ScopedHeap {
- public:
-  typedef TestBlockHeapManager::TestQuarantine TestQuarantine;
-
-  // Constructor.
-  explicit ScopedHeap(TestBlockHeapManager* heap_manager)
-      : heap_manager_(heap_manager) {
-    heap_id_ = heap_manager->CreateHeap();
-    EXPECT_NE(static_cast<HeapId>(NULL), heap_id_);
-  }
-
-  // Destructor. Destroy the heap, this will flush its quarantine and delete all
-  // the structures associated with this heap.
-  ~ScopedHeap() {
-    ReleaseHeap();
-  }
-
-  void ReleaseHeap() {
-    if (heap_id_ != static_cast<HeapId>(NULL)) {
-      EXPECT_TRUE(heap_manager_->DestroyHeap(heap_id_));
-      heap_id_ = static_cast<HeapId>(NULL);
-    }
-  }
-
-  // Retrieves the quarantine associated with this heap.
-  BlockQuarantineInterface* GetQuarantine() {
-    return heap_manager_->GetHeapQuarantine(heap_id_);
-  }
-
-  // Allocate a block of @p size bytes.
-  void* Allocate(size_t size) {
-    void* alloc = heap_manager_->Allocate(heap_id_, size);
-    EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-    return alloc;
-  }
-
-  // Free the block @p mem.
-  bool Free(void* mem) {
-    return heap_manager_->Free(heap_id_, mem);
-  }
-
-  // Flush the quarantine of this heap.
-  void FlushQuarantine() {
-    BlockQuarantineInterface* quarantine =  GetQuarantine();
-    EXPECT_NE(static_cast<BlockQuarantineInterface*>(NULL),
-              quarantine);
-    BlockQuarantineInterface::ObjectVector blocks_to_free;
-    quarantine->Empty(&blocks_to_free);
-    BlockQuarantineInterface::ObjectVector::iterator iter_block =
-        blocks_to_free.begin();
-    for (; iter_block != blocks_to_free.end(); ++iter_block) {
-      DCHECK_NE(reinterpret_cast<BlockHeader*>(NULL), *iter_block);
-      BlockInfo block_info = {};
-      CHECK(Shadow::BlockInfoFromShadow(*iter_block, &block_info));
-      CHECK(heap_manager_->FreePotentiallyCorruptBlock(&block_info));
-    }
-  }
-
-  // Returns the underlying heap ID.
-  HeapId Id() { return heap_id_; }
-
-  // Determines if the address @p mem corresponds to a block in the quarantine
-  // of this heap.
-  bool InQuarantine(const void* mem) {
-    // As we'll cast an AsanShardedQuarantine directly into a TestQuarantine
-    // there shouldn't be any new field defined by this class, this should only
-    // act as an interface allowing to access some private fields.
-    COMPILE_ASSERT(
-        sizeof(TestQuarantine) ==
-            sizeof(TestBlockHeapManager::ShardedBlockQuarantine),
-        test_quarantine_is_not_an_interface);
-    TestQuarantine* test_quarantine =
-        reinterpret_cast<TestQuarantine*>(GetQuarantine());
-    EXPECT_NE(reinterpret_cast<TestQuarantine*>(NULL), test_quarantine);
-    // Search through all of the shards.
-    for (size_t i = 0; i < test_quarantine->kShardingFactor; ++i) {
-      // Search through all blocks in each shard.
-      TestQuarantine::Node* current_node = test_quarantine->heads_[i];
-      while (current_node != NULL) {
-        BlockInfo block_info = {};
-        EXPECT_TRUE(BlockInfoFromMemory(current_node->object, &block_info));
-        if (block_info.body == mem) {
-          EXPECT_EQ(QUARANTINED_BLOCK, current_node->object->state);
-          return true;
-        }
-        current_node = current_node->next;
-      }
-    }
-
-    return false;
-  }
-
- private:
-  // The heap manager owning the underlying heap.
-  TestBlockHeapManager* heap_manager_;
-
-  // The underlying heap.
-  HeapId heap_id_;
-};
-
-class BlockHeapManagerTest : public testing::Test {
- public:
-  typedef TestBlockHeapManager::ShardedBlockQuarantine ShardedBlockQuarantine;
-
-  BlockHeapManagerTest() : heap_manager_(), test_zebra_block_heap_(NULL) {
-  }
-
-  virtual void SetUp() OVERRIDE {
-    runtime_.SetUp(L"");
-    heap_manager_.reset(new TestBlockHeapManager(runtime_.stack_cache()));
-
-    // Set the error callback that the manager will use.
-    heap_manager_->SetHeapErrorCallback(
-        base::Bind(&BlockHeapManagerTest::OnHeapError, base::Unretained(this)));
-
-    common::AsanParameters params;
-    common::SetDefaultAsanParameters(&params);
-    heap_manager_->set_parameters(params);
-  }
-
-  virtual void TearDown() OVERRIDE {
-    // Artificially clear the ZebraBlockHeap before releasing runtime_ to avoid
-    // runtime error.
-    // TearDown is called before destructing the zebra heap.
-    // The blocks contains stack-related information somehow linked to the
-    // runtime_ instance. If the runtime_ instance is cleared before the
-    // zebra heap and there are still blocks in its quarantine, some
-    // non-deterministic errors (failed DCHECKS) may arise.
-    if (test_zebra_block_heap_ != NULL) {
-      heap_manager_->parameters_.quarantine_size = 0;
-      heap_manager_->TrimQuarantine(test_zebra_block_heap_);
-    }
-
-    runtime_.TearDown();
-    heap_manager_.reset(NULL);
-  }
-
-  void OnHeapError(AsanErrorInfo* error) {
-    errors_.push_back(*error);
-  }
-
-  // Calculates the ASan size for an allocation of @p user_size bytes.
-  size_t GetAllocSize(size_t user_size) {
-    BlockLayout layout = {};
-    BlockPlanLayout(kShadowRatio,
-                    kShadowRatio,
-                    user_size,
-                    0,
-                    heap_manager_->parameters().trailer_padding_size +
-                        sizeof(BlockTrailer),
-                    &layout);
-    return layout.block_size;
-  }
-
-  void EnableTestZebraBlockHeap() {
-    // Erase previous ZebraBlockHeap.
-    if (heap_manager_->zebra_block_heap_ != NULL) {
-      heap_manager_->heaps_.erase(heap_manager_->zebra_block_heap_);
-      delete heap_manager_->zebra_block_heap_;
-    }
-    // Plug a mock ZebraBlockHeap by default disabled.
-    test_zebra_block_heap_ = new TestZebraBlockHeap();
-    heap_manager_->zebra_block_heap_ = test_zebra_block_heap_;
-    heap_manager_->heaps_.insert(std::make_pair(test_zebra_block_heap_,
-        test_zebra_block_heap_));
-
-    // Turn on the zebra_block_heap_enabled flag.
-    common::AsanParameters params = heap_manager_->parameters();
-    common::SetDefaultAsanParameters(&params);
-    params.enable_zebra_block_heap = true;
-    heap_manager_->set_parameters(params);
-  }
-
-  // Verifies that [alloc, alloc + size) is accessible, and that
-  // [alloc - 1] and [alloc+size] are poisoned.
-  void VerifyAllocAccess(void* alloc, size_t size) {
-    uint8* mem = reinterpret_cast<uint8*>(alloc);
-    ASSERT_FALSE(Shadow::IsAccessible(mem - 1));
-    ASSERT_TRUE(Shadow::IsLeftRedzone(mem - 1));
-    for (size_t i = 0; i < size; ++i)
-      ASSERT_TRUE(Shadow::IsAccessible(mem + i));
-    ASSERT_FALSE(Shadow::IsAccessible(mem + size));
-  }
-
-  // Verifies that [alloc-1, alloc+size] is poisoned.
-  void VerifyFreedAccess(void* alloc, size_t size) {
-    uint8* mem = reinterpret_cast<uint8*>(alloc);
-    ASSERT_FALSE(Shadow::IsAccessible(mem - 1));
-    ASSERT_TRUE(Shadow::IsLeftRedzone(mem - 1));
-    for (size_t i = 0; i < size; ++i) {
-      ASSERT_FALSE(Shadow::IsAccessible(mem + i));
-      ASSERT_EQ(Shadow::GetShadowMarkerForAddress(mem + i),
-                kHeapFreedMarker);
-    }
-    ASSERT_FALSE(Shadow::IsAccessible(mem + size));
-  }
-
- protected:
-  // The heap manager used in those tests.
-  scoped_ptr<TestBlockHeapManager> heap_manager_;
-
-  // The runtime used by the heap manager.
-  AsanRuntime runtime_;
-
-  // Info about the last errors reported.
-  std::vector<AsanErrorInfo> errors_;
-
-  // The mock ZebraBlockHeap used in those tests.
-  TestZebraBlockHeap* test_zebra_block_heap_;
-};
-
-}  // namespace
-
-TEST_F(BlockHeapManagerTest, AllocAndFree) {
-  const size_t kAllocSize = 17;
-  HeapId heap_id = heap_manager_->CreateHeap();
-  EXPECT_NE(static_cast<HeapId>(NULL), heap_id);
-  void* alloc = heap_manager_->Allocate(heap_id, kAllocSize);
-  EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-  EXPECT_EQ(kAllocSize, heap_manager_->Size(heap_id, alloc));
-  EXPECT_TRUE(heap_manager_->Free(heap_id, alloc));
-  EXPECT_TRUE(heap_manager_->DestroyHeap(heap_id));
-}
-
-TEST_F(BlockHeapManagerTest, SetQuarantinesMaxSize) {
-  ScopedHeap heap(heap_manager_.get());
-
-  common::AsanParameters original_parameters = heap_manager_->parameters();
-  common::AsanParameters new_parameters = original_parameters;
-  new_parameters.quarantine_size = original_parameters.quarantine_size * 2;
-  // Increments the quarantine max size if it was set to 0.
-  if (new_parameters.quarantine_size == 0)
-    new_parameters.quarantine_size++;
-  heap_manager_->set_parameters(new_parameters);
-
-  // Ensure that the maximum size of the quarantine of the 2 heaps has been
-  // correctly set.
-  BlockQuarantineInterface* quarantine =
-      heap.GetQuarantine();
-  ASSERT_NE(reinterpret_cast<BlockQuarantineInterface*>(NULL),
-            quarantine);
-  EXPECT_EQ(new_parameters.quarantine_size,
-            heap_manager_->parameters_.quarantine_size);
-}
-
-TEST_F(BlockHeapManagerTest, PopOnSetQuarantineMaxSize) {
-  const size_t kAllocSize = 100;
-  size_t real_alloc_size = GetAllocSize(kAllocSize);
-  ScopedHeap heap(heap_manager_.get());
-  void* mem = heap.Allocate(kAllocSize);
-  ASSERT_FALSE(heap.InQuarantine(mem));
-
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = real_alloc_size;
-  heap_manager_->set_parameters(parameters);
-
-  ASSERT_TRUE(heap.Free(mem));
-  ASSERT_TRUE(heap.InQuarantine(mem));
-
-  // We resize the quarantine to a smaller size, the block should pop out.
-  parameters.quarantine_size = real_alloc_size - 1;
-  heap_manager_->set_parameters(parameters);
-  ASSERT_FALSE(heap.InQuarantine(mem));
-}
-
-TEST_F(BlockHeapManagerTest, Quarantine) {
-  const size_t kAllocSize = 100;
-  size_t real_alloc_size = GetAllocSize(kAllocSize);
-  const size_t number_of_allocs = 16;
-  ScopedHeap heap(heap_manager_.get());
-
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = real_alloc_size * number_of_allocs;
-  heap_manager_->set_parameters(parameters);
-
-  // Allocate a bunch of blocks until exactly one is removed from the
-  // quarantine.
-  std::vector<void*> blocks;
-  for (size_t i = 0; i < number_of_allocs + 1; ++i) {
-    void* mem = heap.Allocate(kAllocSize);
-    ASSERT_TRUE(mem != NULL);
-    heap.Free(mem);
-    blocks.push_back(mem);
-    if (i < number_of_allocs)
-      ASSERT_TRUE(heap.InQuarantine(mem));
-  }
-
-  size_t blocks_in_quarantine = 0;
-  for (size_t i = 0; i < blocks.size(); ++i) {
-    if (heap.InQuarantine(blocks[i]))
-      ++blocks_in_quarantine;
-  }
-  EXPECT_EQ(number_of_allocs, blocks_in_quarantine);
-}
-
-TEST_F(BlockHeapManagerTest, QuarantineLargeBlock) {
-  const size_t kLargeAllocSize = 100;
-  const size_t kSmallAllocSize = 25;
-  size_t real_large_alloc_size = GetAllocSize(kLargeAllocSize);
-  size_t real_small_alloc_size = GetAllocSize(kSmallAllocSize);
-
-  ScopedHeap heap(heap_manager_.get());
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = real_large_alloc_size;
-  parameters.quarantine_block_size = real_large_alloc_size;
-  heap_manager_->set_parameters(parameters);
-
-  // A block larger than the quarantine should not make it in.
-  void* mem1 = heap.Allocate(real_large_alloc_size + 1);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), mem1);
-  EXPECT_TRUE(heap.Free(mem1));
-  EXPECT_FALSE(heap.InQuarantine(mem1));
-  EXPECT_EQ(0u, heap.GetQuarantine()->GetCount());
-
-  // A smaller block should make it because our current max block size allows
-  // it.
-  void* mem2 = heap.Allocate(kSmallAllocSize);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), mem2);
-  EXPECT_TRUE(heap.Free(mem2));
-  EXPECT_TRUE(heap.InQuarantine(mem2));
-
-  parameters.quarantine_block_size = real_small_alloc_size - 1;
-  heap_manager_->set_parameters(parameters);
-
-  // A second small block should not make it in since we changed the block size.
-  // However, the other block should remain in the quarantine.
-  void* mem3 = heap.Allocate(kSmallAllocSize);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), mem3);
-  EXPECT_TRUE(heap.Free(mem3));
-  EXPECT_TRUE(heap.InQuarantine(mem2));
-  EXPECT_FALSE(heap.InQuarantine(mem3));
-}
-
-TEST_F(BlockHeapManagerTest, UnpoisonsQuarantine) {
-  const size_t kAllocSize = 100;
-  const size_t real_alloc_size = GetAllocSize(kAllocSize);
-
-  ScopedHeap heap(heap_manager_.get());
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = real_alloc_size;
-  heap_manager_->set_parameters(parameters);
-
-  // Allocate a memory block and directly free it, this puts it in the
-  // quarantine.
-  void* mem = heap.Allocate(kAllocSize);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), mem);
-  ASSERT_TRUE(heap.Free(mem));
-  ASSERT_TRUE(heap.InQuarantine(mem));
-
-  // Assert that the shadow memory has been correctly poisoned.
-  intptr_t mem_start = reinterpret_cast<intptr_t>(BlockGetHeaderFromBody(mem));
-  ASSERT_EQ(0, (mem_start & 7) );
-  size_t shadow_start = mem_start >> 3;
-  size_t shadow_alloc_size = real_alloc_size >> 3;
-  for (size_t i = shadow_start; i < shadow_start + shadow_alloc_size; ++i)
-    ASSERT_NE(kHeapAddressableMarker, TestShadow::shadow_[i]);
-
-  // Flush the quarantine.
-  heap.FlushQuarantine();
-
-  // Assert that the quarantine has been correctly unpoisoned.
-  for (size_t i = shadow_start; i < shadow_start + shadow_alloc_size; ++i)
-    ASSERT_EQ(kHeapAddressableMarker, TestShadow::shadow_[i]);
-}
-
-TEST_F(BlockHeapManagerTest, QuarantineIsShared) {
-  const size_t kAllocSize = 100;
-  const size_t real_alloc_size = GetAllocSize(kAllocSize);
-  ScopedHeap heap_1(heap_manager_.get());
-  ScopedHeap heap_2(heap_manager_.get());
-
-  ASSERT_EQ(heap_1.GetQuarantine(), heap_2.GetQuarantine());
-
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = real_alloc_size * 4;
-  heap_manager_->set_parameters(parameters);
-
-  void* heap_1_mem1 = heap_1.Allocate(kAllocSize);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), heap_1_mem1);
-  void* heap_1_mem2 = heap_1.Allocate(kAllocSize);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), heap_1_mem2);
-  void* heap_2_mem1 = heap_2.Allocate(kAllocSize);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), heap_2_mem1);
-  void* heap_2_mem2 = heap_2.Allocate(kAllocSize);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), heap_2_mem2);
-
-  EXPECT_TRUE(heap_1.Free(heap_1_mem1));
-  EXPECT_TRUE(heap_1.Free(heap_1_mem2));
-  EXPECT_TRUE(heap_2.Free(heap_2_mem1));
-  EXPECT_TRUE(heap_2.Free(heap_2_mem2));
-
-  EXPECT_TRUE(heap_1.InQuarantine(heap_1_mem1));
-  EXPECT_TRUE(heap_1.InQuarantine(heap_1_mem2));
-  EXPECT_TRUE(heap_2.InQuarantine(heap_2_mem1));
-  EXPECT_TRUE(heap_2.InQuarantine(heap_2_mem2));
-
-  BlockQuarantineInterface* quarantine = heap_1.GetQuarantine();
-  EXPECT_EQ(4, quarantine->GetCount());
-  heap_2.ReleaseHeap();
-  EXPECT_EQ(2, quarantine->GetCount());
-  heap_1.ReleaseHeap();
-  EXPECT_EQ(0, quarantine->GetCount());
-}
-
-TEST_F(BlockHeapManagerTest, AllocZeroBytes) {
-  ScopedHeap heap(heap_manager_.get());
-  void* mem1 = heap.Allocate(0);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), mem1);
-  void* mem2 = heap.Allocate(0);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), mem2);
-  ASSERT_NE(mem1, mem2);
-  ASSERT_TRUE(heap.Free(mem1));
-  ASSERT_TRUE(heap.Free(mem2));
-}
-
-TEST_F(BlockHeapManagerTest, Size) {
-  const size_t kMaxAllocSize = 134584;
-  ScopedHeap heap(heap_manager_.get());
-  for (size_t size = 10; size < kMaxAllocSize; size = size * 5 + 123) {
-    void* mem = heap.Allocate(size);
-    ASSERT_NE(reinterpret_cast<void*>(NULL), mem);
-    ASSERT_EQ(size, heap_manager_->Size(heap.Id(), mem));
-    ASSERT_TRUE(heap.Free(mem));
-  }
-}
-
-TEST_F(BlockHeapManagerTest, AllocsAccessibility) {
-  const size_t kMaxAllocSize = 134584;
-  ScopedHeap heap(heap_manager_.get());
-  // Ensure that the quarantine is large enough to keep the allocated blocks in
-  // this test.
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = kMaxAllocSize * 2;
-  heap_manager_->set_parameters(parameters);
-  for (size_t size = 10; size < kMaxAllocSize; size = size * 5 + 123) {
-    // Do an alloc/free and test that access is correctly managed.
-    void* mem = heap.Allocate(size);
-    ASSERT_NE(reinterpret_cast<void*>(NULL), mem);
-    ASSERT_NO_FATAL_FAILURE(VerifyAllocAccess(mem, size));
-    ASSERT_TRUE(heap.Free(mem));
-    ASSERT_NO_FATAL_FAILURE(VerifyFreedAccess(mem, size));
-  }
-}
-
-TEST_F(BlockHeapManagerTest, LockUnlock) {
-  ScopedHeap heap(heap_manager_.get());
-  // We can't really test these, aside from not crashing.
-  ASSERT_NO_FATAL_FAILURE(heap_manager_->Lock(heap.Id()));
-  ASSERT_NO_FATAL_FAILURE(heap_manager_->Unlock(heap.Id()));
-}
-
-TEST_F(BlockHeapManagerTest, CaptureTID) {
-  const size_t kAllocSize = 13;
-  ScopedHeap heap(heap_manager_.get());
-  // Ensure that the quarantine is large enough to keep this block.
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = GetAllocSize(kAllocSize);
-  heap_manager_->set_parameters(parameters);
-  uint8* mem = static_cast<uint8*>(heap.Allocate(kAllocSize));
-  ASSERT_TRUE(heap.Free(mem));
-  EXPECT_EQ(QUARANTINED_BLOCK,
-            static_cast<BlockState>(BlockGetHeaderFromBody(mem)->state));
-
-  BlockHeader* header = BlockGetHeaderFromBody(mem);
-  ASSERT_NE(reinterpret_cast<BlockHeader*>(NULL), header);
-  BlockInfo block_info = {};
-  EXPECT_TRUE(BlockInfoFromMemory(header, &block_info));
-  EXPECT_NE(reinterpret_cast<BlockTrailer*>(NULL), block_info.trailer);
-
-  EXPECT_EQ(block_info.trailer->alloc_tid, ::GetCurrentThreadId());
-  EXPECT_EQ(block_info.trailer->free_tid, ::GetCurrentThreadId());
-}
-
-TEST_F(BlockHeapManagerTest, QuarantineDoesntAlterBlockContents) {
-  const size_t kAllocSize = 13;
-  ScopedHeap heap(heap_manager_.get());
-  // Ensure that the quarantine is large enough to keep this block.
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = GetAllocSize(kAllocSize);
-  heap_manager_->set_parameters(parameters);
-  void* mem = heap.Allocate(kAllocSize);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), mem);
-  base::RandBytes(mem, kAllocSize);
-
-  unsigned char sha1_before[base::kSHA1Length] = {};
-  base::SHA1HashBytes(reinterpret_cast<unsigned char*>(mem),
-                      kAllocSize,
-                      sha1_before);
-
-  BlockHeader* header = BlockGetHeaderFromBody(mem);
-
-  ASSERT_TRUE(heap.Free(mem));
-  EXPECT_EQ(QUARANTINED_BLOCK, static_cast<BlockState>(header->state));
-
-  unsigned char sha1_after[base::kSHA1Length] = {};
-  base::SHA1HashBytes(reinterpret_cast<unsigned char*>(mem),
-                      kAllocSize,
-                      sha1_after);
-
-  EXPECT_EQ(0, memcmp(sha1_before, sha1_after, base::kSHA1Length));
-}
-
-TEST_F(BlockHeapManagerTest, SetTrailerPaddingSize) {
-  const size_t kAllocSize = 13;
-  ScopedHeap heap(heap_manager_.get());
-  // Ensure that the quarantine is large enough to keep this block with the
-  // extra padding.
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = GetAllocSize(kAllocSize) * 5;
-  heap_manager_->set_parameters(parameters);
-  size_t original_alloc_size = GetAllocSize(kAllocSize);
-  common::AsanParameters original_parameter = heap_manager_->parameters();
-
-  for (size_t padding = 0; padding < 16; ++padding) {
-    common::AsanParameters new_parameter = original_parameter;
-    new_parameter.trailer_padding_size =
-        original_parameter.trailer_padding_size + padding;
-    heap_manager_->set_parameters(new_parameter);
-    size_t augmented_alloc_size = GetAllocSize(kAllocSize);
-    EXPECT_GE(augmented_alloc_size, original_alloc_size);
-
-    void* mem = heap.Allocate(kAllocSize);
-    ASSERT_TRUE(mem != NULL);
-
-    size_t offset = kAllocSize;
-    for (; offset < augmented_alloc_size - sizeof(BlockHeader);
-         ++offset) {
-      EXPECT_FALSE(Shadow::IsAccessible(
-          reinterpret_cast<const uint8*>(mem) + offset));
-    }
-    ASSERT_TRUE(heap.Free(mem));
-  }
-  heap_manager_->set_parameters(original_parameter);
-}
-
-TEST_F(BlockHeapManagerTest, BlockChecksumUpdatedWhenEnterQuarantine) {
-  const size_t kAllocSize = 100;
-  size_t real_alloc_size = GetAllocSize(kAllocSize);
-  ScopedHeap heap(heap_manager_.get());
-
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = real_alloc_size;
-  heap_manager_->set_parameters(parameters);
-
-  void* mem = heap.Allocate(kAllocSize);
-  ASSERT_NE(reinterpret_cast<void*>(NULL), mem);
-  BlockInfo block_info = {};
-  EXPECT_TRUE(Shadow::BlockInfoFromShadow(mem, &block_info));
-  EXPECT_TRUE(BlockChecksumIsValid(block_info));
-  heap.Free(mem);
-  EXPECT_TRUE(BlockChecksumIsValid(block_info));
-  ASSERT_TRUE(heap.InQuarantine(mem));
-}
-
-static const size_t kChecksumRepeatCount = 10;
-
-TEST_F(BlockHeapManagerTest, CorruptAsEntersQuarantine) {
-  const size_t kAllocSize = 100;
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = GetAllocSize(kAllocSize);
-  heap_manager_->set_parameters(parameters);
-
-  ScopedHeap heap(heap_manager_.get());
-  // This can fail because of a checksum collision. However, we run it a
-  // handful of times to keep the chances as small as possible.
-  for (size_t i = 0; i < kChecksumRepeatCount; ++i) {
-    heap.FlushQuarantine();
-    void* mem = heap.Allocate(kAllocSize);
-    ASSERT_NE(static_cast<void*>(NULL), mem);
-    reinterpret_cast<int*>(mem)[-1] = rand();
-    EXPECT_TRUE(heap.Free(mem));
-
-    // Try again for all but the last attempt if this appears to have failed.
-    if (errors_.empty() && i + 1 < kChecksumRepeatCount)
-      continue;
-
-    ASSERT_EQ(1u, errors_.size());
-    ASSERT_EQ(CORRUPT_BLOCK, errors_[0].error_type);
-    ASSERT_EQ(mem, errors_[0].location);
-
-    break;
-  }
-}
-
-TEST_F(BlockHeapManagerTest, CorruptAsExitsQuarantine) {
-  const size_t kAllocSize = 100;
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = GetAllocSize(kAllocSize);
-  heap_manager_->set_parameters(parameters);
-
-  ScopedHeap heap(heap_manager_.get());
-  // This can fail because of a checksum collision. However, we run it a
-  // handful of times to keep the chances as small as possible.
-  for (size_t i = 0; i < kChecksumRepeatCount; ++i) {
-    heap.FlushQuarantine();
-    void* mem = heap.Allocate(kAllocSize);
-    ASSERT_NE(static_cast<void*>(NULL), mem);
-    EXPECT_TRUE(heap.Free(mem));
-    EXPECT_TRUE(errors_.empty());
-
-    // Change some of the block content and then flush the quarantine. The block
-    // hash should be invalid and it should cause an error to be fired.
-    reinterpret_cast<int32*>(mem)[0] = rand();
-    heap.FlushQuarantine();
-
-    // Try again for all but the last attempt if this appears to have failed.
-    if (errors_.empty() && i + 1 < kChecksumRepeatCount)
-      continue;
-
-    EXPECT_EQ(1u, errors_.size());
-    EXPECT_EQ(CORRUPT_BLOCK, errors_[0].error_type);
-    EXPECT_EQ(
-        reinterpret_cast<BlockHeader*>(mem) - 1,
-        reinterpret_cast<BlockHeader*>(errors_[0].location));
-
-    break;
-  }
-}
-
-TEST_F(BlockHeapManagerTest, CorruptAsExitsQuarantineOnHeapDestroy) {
-  const size_t kAllocSize = 100;
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = GetAllocSize(kAllocSize);
-  heap_manager_->set_parameters(parameters);
-
-  // This can fail because of a checksum collision. However, we run it a
-  // handful of times to keep the chances as small as possible.
-  for (size_t i = 0; i < kChecksumRepeatCount; ++i) {
-    void* mem = NULL;
-    {
-      ScopedHeap heap(heap_manager_.get());
-      heap.FlushQuarantine();
-      mem = heap.Allocate(kAllocSize);
-      ASSERT_NE(static_cast<void*>(NULL), mem);
-      EXPECT_TRUE(heap.Free(mem));
-      EXPECT_TRUE(errors_.empty());
-
-      // Change some of the block content to invalidate the block's hash.
-      reinterpret_cast<int32*>(mem)[0] = rand();
-    }
-
-    // The destructor of |heap| should be called and all the quarantined blocks
-    // belonging to this heap should be freed, which should trigger an error as
-    // the block is now corrupt.
-
-    // Try again for all but the last attempt if this appears to have failed.
-    if (errors_.empty() && i + 1 < kChecksumRepeatCount)
-      continue;
-
-    EXPECT_EQ(1u, errors_.size());
-    EXPECT_EQ(CORRUPT_BLOCK, errors_[0].error_type);
-    EXPECT_EQ(reinterpret_cast<BlockHeader*>(mem) - 1,
-              reinterpret_cast<BlockHeader*>(errors_[0].location));
-
-    break;
-  }
-}
-
-TEST_F(BlockHeapManagerTest, CorruptHeapOnTrimQuarantine) {
-  const size_t kAllocSize = 100;
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = GetAllocSize(kAllocSize);
-  heap_manager_->set_parameters(parameters);
-
-  // This can fail because of a checksum collision. However, we run it a
-  // handful of times to keep the chances as small as possible.
-  for (size_t i = 0; i < kChecksumRepeatCount; ++i) {
-    void* mem = NULL;
-    {
-      ScopedHeap heap(heap_manager_.get());
-      heap.FlushQuarantine();
-      mem = heap.Allocate(kAllocSize);
-      ASSERT_NE(static_cast<void*>(NULL), mem);
-      EXPECT_TRUE(heap.Free(mem));
-      EXPECT_TRUE(errors_.empty());
-
-      // Change some of the block content to invalidate the block's hash.
-      reinterpret_cast<int32*>(mem)[0] = rand();
-    }
-
-    // The destructor of |heap| should be called and all the quarantined blocks
-    // belonging to this heap should be freed, which should trigger an error as
-    // the block is now corrupt.
-
-    // Try again for all but the last attempt if this appears to have failed.
-    if (errors_.empty() && i + 1 < kChecksumRepeatCount)
-      continue;
-
-    EXPECT_EQ(1u, errors_.size());
-    EXPECT_EQ(CORRUPT_BLOCK, errors_[0].error_type);
-    EXPECT_EQ(reinterpret_cast<BlockHeader*>(mem) - 1,
-              reinterpret_cast<BlockHeader*>(errors_[0].location));
-
-    break;
-  }
-}
-
-TEST_F(BlockHeapManagerTest, DoubleFree) {
-  const size_t kAllocSize = 100;
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.quarantine_size = GetAllocSize(kAllocSize);
-  heap_manager_->set_parameters(parameters);
-
-  ScopedHeap heap(heap_manager_.get());
-  void* mem = heap.Allocate(kAllocSize);
-  ASSERT_NE(static_cast<void*>(NULL), mem);
-  EXPECT_TRUE(heap.Free(mem));
-  EXPECT_FALSE(heap.Free(mem));
-
-  EXPECT_EQ(1u, errors_.size());
-  EXPECT_EQ(DOUBLE_FREE, errors_[0].error_type);
-  EXPECT_EQ(mem, errors_[0].location);
-}
-
-TEST_F(BlockHeapManagerTest, SubsampledAllocationGuards) {
-  common::AsanParameters parameters = heap_manager_->parameters();
-  parameters.allocation_guard_rate = 0.5;
-  heap_manager_->set_parameters(parameters);
-  ScopedHeap heap(heap_manager_.get());
-
-  size_t guarded_allocations = 0;
-  size_t unguarded_allocations = 0;
-
-  // Make a handful of allocations.
-  const size_t kAllocationCount = 10000;
-  const size_t kAllocationSizes[] = {
-      1, 2, 4, 8, 14, 30, 128, 237, 500, 1000, 2036 };
-  std::vector<void*> allocations;
-  for (size_t i = 0; i < kAllocationCount; ++i) {
-    size_t alloc_size = kAllocationSizes[i % arraysize(kAllocationSizes)];
-    void* alloc = heap.Allocate(alloc_size);
-    EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-
-    // Determine if the allocation has guards or not.
-    BlockHeader* header = BlockGetHeaderFromBody(alloc);
-    if (header == NULL) {
-      ++unguarded_allocations;
-    } else {
-      ++guarded_allocations;
-    }
-
-    // Delete half of the allocations immediately, and keep half of them
-    // around for longer. This puts more of a stress test on the quarantine
-    // itself.
-    if (base::RandDouble() < 0.5) {
-      EXPECT_TRUE(heap.Free(alloc));
-    } else {
-      allocations.push_back(alloc);
-    }
-  }
-
-  // Free the outstanding allocations.
-  for (size_t i = 0; i < allocations.size(); ++i)
-    EXPECT_TRUE(heap.Free(allocations[i]));
-
-  // Clear the quarantine. This should free up the remaining instrumented
-  // but quarantined blocks.
-  EXPECT_NO_FATAL_FAILURE(heap.FlushQuarantine());
-
-  // This could theoretically fail, but that would imply an extremely bad
-  // implementation of the underlying random number generator. There are 10000
-  // allocations. Since this is effectively a fair coin toss we expect a
-  // standard deviation of 0.5 * sqrt(10000) = 50. A 10% margin is
-  // 1000 / 50 = 20 standard deviations. For |z| > 20, the p-value is 5.5e-89,
-  // or 89 nines of confidence. That should keep any flake largely at bay.
-  // Thus, if this fails it's pretty much certain the implementation is at
-  // fault.
-  EXPECT_LT(4 * kAllocationCount / 10, guarded_allocations);
-  EXPECT_GT(6 * kAllocationCount / 10, guarded_allocations);
-}
-
-// Ensures that the ZebraBlockHeap overrides the provided heap.
-TEST_F(BlockHeapManagerTest, ZebraHeapIdInTrailerAfterAllocation) {
-  EnableTestZebraBlockHeap();
-  ScopedHeap heap(heap_manager_.get());
-  const size_t kAllocSize = 0x100;
-  void* alloc = heap.Allocate(kAllocSize);
-  EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-  ASSERT_NO_FATAL_FAILURE(VerifyAllocAccess(alloc, kAllocSize));
-
-  // Get the heap_id from the block trailer.
-  BlockInfo block_info = {};
-  BlockHeader* header = BlockGetHeaderFromBody(alloc);
-  EXPECT_TRUE(Shadow::BlockInfoFromShadow(header, &block_info));
-  // The heap_id stored in the block trailer should match the ZebraBlockHeap id.
-  EXPECT_EQ(reinterpret_cast<HeapId>(test_zebra_block_heap_),
-      block_info.trailer->heap_id);
-  EXPECT_TRUE(heap.Free(alloc));
-}
-
-// Ensures that the provided heap is used when the ZebraBlockHeap cannot handle
-// the allocation.
-TEST_F(BlockHeapManagerTest, DefaultHeapIdInTrailerWhenZebraHeapIsFull) {
-  EnableTestZebraBlockHeap();
-  ScopedHeap heap(heap_manager_.get());
-  const size_t kAllocSize = 0x100;
-  // Refuse allocations on the ZebraBlockHeap.
-  test_zebra_block_heap_->set_refuse_allocations(true);
-
-  void* alloc = heap.Allocate(kAllocSize);
-  EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-  ASSERT_NO_FATAL_FAILURE(VerifyAllocAccess(alloc, kAllocSize));
-
-  // Get the heap_id from the block trailer.
-  BlockInfo block_info = {};
-  BlockHeader* header = BlockGetHeaderFromBody(alloc);
-  EXPECT_TRUE(Shadow::BlockInfoFromShadow(header, &block_info));
-  // The heap_id stored in the block trailer match the provided heap.
-  EXPECT_EQ(heap.Id(), block_info.trailer->heap_id);
-  EXPECT_TRUE(heap.Free(alloc));
-}
-
-TEST_F(BlockHeapManagerTest, AllocStress) {
-  EnableTestZebraBlockHeap();
-  ScopedHeap heap(heap_manager_.get());
-  for (size_t i = 0; i < 1000; ++i) {
-    const size_t kAllocSize = 0x100 + i;
-    void* alloc = heap.Allocate(kAllocSize);
-    EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-    ASSERT_NO_FATAL_FAILURE(VerifyAllocAccess(alloc, kAllocSize));
-    // Free should succeed, even if the block is quarantined.
-    EXPECT_TRUE(heap.Free(alloc));
-  }
-}
-
-// The BlockHeapManager correctly quarantines the memory after free.
-TEST_F(BlockHeapManagerTest, QuarantinedAfterFree) {
-  EnableTestZebraBlockHeap();
-  ScopedHeap heap(heap_manager_.get());
-  // Always quarantine if possible.
-  test_zebra_block_heap_->set_quarantine_ratio(1.0);
-
-  const size_t kAllocSize = 0x100;
-  void* alloc = heap.Allocate(kAllocSize);
-  EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-  ASSERT_NO_FATAL_FAILURE(VerifyAllocAccess(alloc, kAllocSize));
-  // Free should succeed, even if the block is quarantined.
-  EXPECT_TRUE(heap.Free(alloc));
-  // The block should be quarantined and poisoned.
-  ASSERT_NO_FATAL_FAILURE(VerifyFreedAccess(alloc, kAllocSize));
-  BlockInfo block_info = {};
-  BlockHeader* header = BlockGetHeaderFromBody(alloc);
-  EXPECT_TRUE(Shadow::BlockInfoFromShadow(header, &block_info));
-  EXPECT_EQ(QUARANTINED_BLOCK, block_info.header->state);
-}
-
-// The BlockHeapManager correctly unpoison the memory after free if the
-// quarantine is full.
-TEST_F(BlockHeapManagerTest, NotQuarantinedAfterFree) {
-  EnableTestZebraBlockHeap();
-  ScopedHeap heap(heap_manager_.get());
-  const size_t kAllocSize = 0xFF;
-  void* alloc = heap.Allocate(kAllocSize);
-  EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-  ASSERT_NO_FATAL_FAILURE(VerifyAllocAccess(alloc, kAllocSize));
-
-  // Force the ZebraBlockHeap quarantine to refuse new blocks, so the block
-  // should be freed.
-  test_zebra_block_heap_->set_refuse_push(true);
-  BlockInfo block_info = {};
-  BlockHeader* header = BlockGetHeaderFromBody(alloc);
-  EXPECT_TRUE(Shadow::BlockInfoFromShadow(header, &block_info));
-  EXPECT_TRUE(heap.Free(alloc));
-  // Since it was refused from the quarantine it should be marked as freed.
-  EXPECT_EQ(FREED_BLOCK, block_info.header->state);
-}
-
-// set_parameters should set the zebra_block_heap_quarantine_ratio flag
-// correctly.
-TEST_F(BlockHeapManagerTest, set_parametersSetsZebraBlockHeapQuarantineRatio) {
-  EnableTestZebraBlockHeap();
-  float new_ratio = 1.0f / 8;
-  common::AsanParameters params = heap_manager_->parameters();
-  params.zebra_block_heap_quarantine_ratio = new_ratio;
-  heap_manager_->set_parameters(params);
-  EXPECT_EQ(new_ratio, test_zebra_block_heap_->quarantine_ratio());
-}
-
-// Test for double free errors on ZebraBlockHeap allocations.
-TEST_F(BlockHeapManagerTest, DoubleFreeOnZebraHeap) {
-  EnableTestZebraBlockHeap();
-  ScopedHeap heap(heap_manager_.get());
-  test_zebra_block_heap_->set_quarantine_ratio(1.0);
-
-  const size_t kAllocSize = 0xFF;
-  void* alloc = heap.Allocate(kAllocSize);
-  EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-  ASSERT_NO_FATAL_FAILURE(VerifyAllocAccess(alloc, kAllocSize));
-
-  EXPECT_TRUE(heap.Free(alloc));
-  EXPECT_FALSE(heap.Free(alloc));
-
-  EXPECT_EQ(1u, errors_.size());
-  EXPECT_EQ(DOUBLE_FREE, errors_[0].error_type);
-  EXPECT_EQ(alloc, errors_[0].location);
-}
-
-}  // namespace heap_managers
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heaps/ctmalloc_heap.cc b/syzygy/agent/asan/heaps/ctmalloc_heap.cc
deleted file mode 100644
index 84dfccf..0000000
--- a/syzygy/agent/asan/heaps/ctmalloc_heap.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heaps/ctmalloc_heap.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-namespace {
-
-// Callback that CtMalloc will invoke when memory is reserved.
-void CtMallocMemoryReservedCallback(
-    void* user_data, void* addr, size_t length) {
-  DCHECK_NE(static_cast<void*>(NULL), user_data);
-  DCHECK_NE(static_cast<void*>(NULL), addr);
-  DCHECK_LT(0u, length);
-
-  MemoryNotifierInterface* memory_notifier =
-      reinterpret_cast<MemoryNotifierInterface*>(user_data);
-  memory_notifier->NotifyFutureHeapUse(addr, length);
-}
-
-// Callback that CtMalloc will invoke when memory is released.
-void CtMallocMemoryReleasedCallback(
-    void* user_data, void* addr, size_t length) {
-  DCHECK_NE(static_cast<void*>(NULL), user_data);
-  DCHECK_NE(static_cast<void*>(NULL), addr);
-  DCHECK_LT(0u, length);
-
-  MemoryNotifierInterface* memory_notifier =
-      reinterpret_cast<MemoryNotifierInterface*>(user_data);
-  memory_notifier->NotifyReturnedToOS(addr, length);
-}
-
-}  // namespace
-
-CtMallocHeap::CtMallocHeap(MemoryNotifierInterface* memory_notifier)
-    : memory_notifier_(memory_notifier) {
-  DCHECK_NE(static_cast<MemoryNotifierInterface*>(NULL), memory_notifier);
-
-  ::memset(&allocator_, 0, sizeof(allocator_));
-
-  // Wire the memory notifier up to the underlying CtMalloc implementation via
-  // the callbacks we added.
-  allocator_.root()->callbacks.user_data = memory_notifier;
-  allocator_.root()->callbacks.reserved_callback =
-      &CtMallocMemoryReservedCallback;
-  allocator_.root()->callbacks.released_callback =
-      &CtMallocMemoryReleasedCallback;
-
-  // Initialize the CtMalloc heap.
-  allocator_.init();
-}
-
-CtMallocHeap::~CtMallocHeap() {
-  // Shutdown the CtMalloc heap.
-  allocator_.shutdown();
-}
-
-uint32 CtMallocHeap::GetHeapFeatures() const {
-  return kHeapReportsReservations | kHeapSupportsIsAllocated |
-      kHeapSupportsGetAllocationSize | kHeapGetAllocationSizeIsUpperBound;
-}
-
-void* CtMallocHeap::Allocate(size_t bytes) {
-  common::AutoRecursiveLock lock(lock_);
-  void* alloc = WTF::partitionAllocGeneric(allocator_.root(), bytes);
-  return alloc;
-}
-
-bool CtMallocHeap::Free(void* alloc) {
-  common::AutoRecursiveLock lock(lock_);
-  WTF::partitionFreeGeneric(allocator_.root(), alloc);
-  return true;
-}
-
-bool CtMallocHeap::IsAllocated(void* alloc) {
-  if (!WTF::partitionIsAllocatedGeneric(allocator_.root(), alloc, -1, NULL))
-    return false;
-  return true;
-}
-
-size_t CtMallocHeap::GetAllocationSize(void* alloc) {
-  if (alloc == NULL)
-    return kUnknownSize;
-
-  size_t allocation_size = 0;
-  if (!WTF::partitionIsAllocatedGeneric(allocator_.root(), alloc, -1,
-                                        &allocation_size)) {
-    return kUnknownSize;
-  }
-  return allocation_size;
-}
-
-void CtMallocHeap::Lock() {
-  lock_.Acquire();
-}
-
-void CtMallocHeap::Unlock() {
-  lock_.Release();
-}
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heaps/ctmalloc_heap.h b/syzygy/agent/asan/heaps/ctmalloc_heap.h
deleted file mode 100644
index 96e3c64..0000000
--- a/syzygy/agent/asan/heaps/ctmalloc_heap.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// An implementation of HeapInterface that wraps the CtMalloc heap.
-
-#ifndef SYZYGY_AGENT_ASAN_HEAPS_CTMALLOC_HEAP_H_
-#define SYZYGY_AGENT_ASAN_HEAPS_CTMALLOC_HEAP_H_
-
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-#include "syzygy/agent/asan/heap.h"
-#include "syzygy/agent/asan/memory_notifier.h"
-#include "syzygy/common/recursive_lock.h"
-#include "wtf/config.h"
-#include "wtf/PartitionAlloc.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-class CtMallocHeap : public HeapInterface {
- public:
-  // Constructor. Creates a heap that is owned uniquely by this object.
-  // @param memory_notifier The notifier that will be used to inform the
-  //     runtime of this heaps internal memory use.
-  explicit CtMallocHeap(MemoryNotifierInterface* memory_notifier);
-
-  // Destructor.
-  virtual ~CtMallocHeap();
-
-  // @name HeapInterface functions.
-  // @{
-  virtual uint32 GetHeapFeatures() const;
-  virtual void* Allocate(size_t bytes);
-  virtual bool Free(void* alloc);
-  virtual bool IsAllocated(void* alloc);
-  virtual size_t GetAllocationSize(void* alloc);
-  virtual void Lock();
-  virtual void Unlock();
-  // @}
-
- protected:
-  // The underlying heap. Under lock_.
-  PartitionAllocatorGeneric allocator_;
-
-  // The interface that will be notified of internal memory use. Has its own
-  // locking.
-  MemoryNotifierInterface* memory_notifier_;
-
-  // The lock that gates access to this heap.
-  common::RecursiveLock lock_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(CtMallocHeap);
-};
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_HEAPS_CTMALLOC_HEAP_H_
diff --git a/syzygy/agent/asan/heaps/ctmalloc_heap_unittest.cc b/syzygy/agent/asan/heaps/ctmalloc_heap_unittest.cc
deleted file mode 100644
index 955016b..0000000
--- a/syzygy/agent/asan/heaps/ctmalloc_heap_unittest.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heaps/ctmalloc_heap.h"
-
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/unittest_util.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-TEST(CtMallocHeapTest, FeaturesAreValid) {
-  testing::NullMemoryNotifier n;
-  CtMallocHeap h(&n);
-  EXPECT_EQ(CtMallocHeap::kHeapReportsReservations |
-                CtMallocHeap::kHeapSupportsIsAllocated |
-                CtMallocHeap::kHeapSupportsGetAllocationSize |
-                CtMallocHeap::kHeapGetAllocationSizeIsUpperBound,
-            h.GetHeapFeatures());
-}
-
-TEST(CtMallocHeapTest, HeapTest) {
-  testing::NullMemoryNotifier n;
-  CtMallocHeap h(&n);
-
-  // Allocate and free a zero-sized allocation. This should succeed
-  // by definition.
-  void* alloc = h.Allocate(0);
-  EXPECT_EQ(0u, reinterpret_cast<uintptr_t>(alloc) % kShadowRatio);
-  EXPECT_TRUE(h.Free(alloc));
-
-  // Make a bunch of different sized allocations.
-  std::set<void*> allocs;
-  for (size_t i = 1; i < 1024 * 1024; i <<= 1) {
-    void* alloc = h.Allocate(i);
-    EXPECT_EQ(0u, reinterpret_cast<uintptr_t>(alloc) % kShadowRatio);
-    allocs.insert(alloc);
-  }
-
-  // Now free them.
-  std::set<void*>::const_iterator it = allocs.begin();
-  for (; it != allocs.end(); ++it)
-    EXPECT_TRUE(h.Free(*it));
-}
-
-TEST(CtMallocHeapTest, ZeroSizedAllocationsHaveDistinctAddresses) {
-  testing::NullMemoryNotifier n;
-  CtMallocHeap h(&n);
-
-  void* a1 = h.Allocate(0);
-  EXPECT_TRUE(a1 != NULL);
-  void* a2 = h.Allocate(0);
-  EXPECT_TRUE(a2 != NULL);
-  EXPECT_NE(a1, a2);
-  h.Free(a1);
-  h.Free(a2);
-}
-
-// NOTE: For now IsAllocated is not supported by this heap.
-TEST(CtMallocHeapTest, IsAllocated) {
-  testing::NullMemoryNotifier n;
-  CtMallocHeap h(&n);
-
-  EXPECT_FALSE(h.IsAllocated(NULL));
-
-  void* a = h.Allocate(100);
-  EXPECT_EQ(0u, reinterpret_cast<uintptr_t>(a) % kShadowRatio);
-  EXPECT_TRUE(h.IsAllocated(a));
-  EXPECT_FALSE(h.IsAllocated(reinterpret_cast<uint8*>(a) - 1));
-  EXPECT_FALSE(h.IsAllocated(reinterpret_cast<uint8*>(a) + 1));
-
-  h.Free(a);
-  EXPECT_FALSE(h.IsAllocated(a));
-}
-
-TEST(CtMallocHeapTest, GetAllocationSize) {
-  testing::NullMemoryNotifier n;
-  CtMallocHeap h(&n);
-
-  void* alloc = h.Allocate(67);
-  ASSERT_TRUE(alloc != NULL);
-  EXPECT_LE(67u, h.GetAllocationSize(alloc));
-}
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heaps/internal_heap.cc b/syzygy/agent/asan/heaps/internal_heap.cc
deleted file mode 100644
index e8f3a6a..0000000
--- a/syzygy/agent/asan/heaps/internal_heap.cc
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heaps/internal_heap.h"
-
-#include "syzygy/common/align.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-namespace {
-
-struct InternalHeapEntry {
-  uint32 size;
-  // Actually of a size such that the whole InternalHeapAlloc is of size
-  // |size|.
-  uint8 body[1];
-};
-
-const size_t kBodyOffset = offsetof(InternalHeapEntry, body);
-
-}  // namespace
-
-InternalHeap::InternalHeap(MemoryNotifierInterface* memory_notifier,
-                           HeapInterface* heap)
-    : memory_notifier_(memory_notifier), heap_(heap) {
-  DCHECK_NE(static_cast<MemoryNotifierInterface*>(NULL), memory_notifier);
-  DCHECK_NE(static_cast<HeapInterface*>(NULL), heap);
-  notifying_heap_ =
-      heap_->GetHeapFeatures() & HeapInterface::kHeapReportsReservations;
-}
-
-uint32 InternalHeap::GetHeapFeatures() const {
-  // Endow a wrapped heap with GetAllocationSize support.
-  return heap_->GetHeapFeatures() | kHeapSupportsGetAllocationSize |
-      kHeapGetAllocationSizeIsUpperBound;
-}
-
-void* InternalHeap::Allocate(size_t bytes) {
-  size_t size = common::AlignUp(bytes + kBodyOffset, kShadowRatio);
-  void* alloc = heap_->Allocate(size);
-  if (alloc == NULL)
-    return NULL;
-
-  InternalHeapEntry* entry = reinterpret_cast<InternalHeapEntry*>(alloc);
-  entry->size = size;
-  memory_notifier_->NotifyInternalUse(entry, size);
-
-  return entry->body;
-}
-
-bool InternalHeap::Free(void* alloc) {
-  if (alloc != NULL) {
-    uint8* bytes = reinterpret_cast<uint8*>(alloc);
-    InternalHeapEntry* entry = reinterpret_cast<InternalHeapEntry*>(
-        bytes - kBodyOffset);
-    if (notifying_heap_) {
-      // A notifying heap redzones the memory from which allocations are made.
-      // We return the redzone to its initial state.
-      memory_notifier_->NotifyFutureHeapUse(entry, entry->size);
-    } else {
-      // A non-notifying heap serves memory from greenzoned pages, so indicate
-      // the memory has returned to the OS.
-      memory_notifier_->NotifyReturnedToOS(entry, entry->size);
-    }
-
-    // Adjust the allocation pointer to that of the wrapped heap.
-    alloc = entry;
-  }
-
-  return heap_->Free(alloc);
-}
-
-bool InternalHeap::IsAllocated(void* alloc) {
-  if (alloc != NULL) {
-    uint32* header = reinterpret_cast<uint32*>(alloc) - 1;
-    alloc = header;
-  }
-  return heap_->IsAllocated(alloc);
-}
-
-size_t InternalHeap::GetAllocationSize(void* alloc) {
-  if (alloc == NULL)
-    return kUnknownSize;
-
-  uint8* bytes = reinterpret_cast<uint8*>(alloc);
-  InternalHeapEntry* entry = reinterpret_cast<InternalHeapEntry*>(
-      bytes - kBodyOffset);
-  return entry->size;
-}
-
-void InternalHeap::Lock() {
-  heap_->Lock();
-}
-
-void InternalHeap::Unlock() {
-  heap_->Unlock();
-}
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heaps/internal_heap.h b/syzygy/agent/asan/heaps/internal_heap.h
deleted file mode 100644
index 8c56dc2..0000000
--- a/syzygy/agent/asan/heaps/internal_heap.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Defines InternalHeap, a simple wrapper of any other HeapInterface that
-// adds internal-use notifications via a MemoryNotifierInterface.
-
-#ifndef SYZYGY_AGENT_ASAN_HEAPS_INTERNAL_HEAP_H_
-#define SYZYGY_AGENT_ASAN_HEAPS_INTERNAL_HEAP_H_
-
-#include "base/logging.h"
-#include "syzygy/agent/asan/heap.h"
-#include "syzygy/agent/asan/memory_notifier.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-// An implementation of HeapInterface that wraps another HeapInterface and
-// a MemoryNotificationInterface. It subsequently will notify all allocations
-// as being for internal use. This incurs a small amount of memory overhead
-// per allocation to store the original size of the allocation. This heap
-// does *not* return allocations that are kShadowRatio aligned. Rather, it
-// returns allocations that sizeof(uint32) % kShadowRatio aligned, due to the
-// extra incurred header. This is not an issue as the allocations are only
-// for internal use and no shadow memory notations will be applied to them.
-class InternalHeap : public HeapInterface {
- public:
-  // Constructor.
-  // @param memory_notifier The notifier that will be used to inform the
-  //     runtime of all allocations.
-  // @param heap The underlying heap that is being wrapped.
-  InternalHeap(MemoryNotifierInterface* memory_notifier,
-               HeapInterface* heap);
-
-  // Destructor.
-  virtual ~InternalHeap() { }
-
-  // @name HeapInterface functions.
-  // @{
-  virtual uint32 GetHeapFeatures() const;
-  virtual void* Allocate(size_t bytes);
-  virtual bool Free(void* alloc);
-  virtual bool IsAllocated(void* alloc);
-  virtual size_t GetAllocationSize(void* alloc);
-  virtual void Lock();
-  virtual void Unlock();
-  // @}
-
- protected:
-  // The interface that will be notified of all memory use. Has its own
-  // locking.
-  MemoryNotifierInterface* memory_notifier_;
-
-  // The underlying heap interface. Provides locking for us.
-  HeapInterface* heap_;
-
-  // This is true if the wrapped heap is a notifying heap.
-  bool notifying_heap_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(InternalHeap);
-};
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_HEAPS_INTERNAL_HEAP_H_
diff --git a/syzygy/agent/asan/heaps/internal_heap_unittest.cc b/syzygy/agent/asan/heaps/internal_heap_unittest.cc
deleted file mode 100644
index 11487e7..0000000
--- a/syzygy/agent/asan/heaps/internal_heap_unittest.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heaps/internal_heap.h"
-
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/unittest_util.h"
-#include "syzygy/agent/asan/heaps/ctmalloc_heap.h"
-#include "syzygy/agent/asan/heaps/win_heap.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-namespace {
-
-using testing::_;
-using testing::Return;
-
-}  // namespace
-
-TEST(InternalHeapTest, EndToEnd) {
-  memory_notifiers::NullMemoryNotifier mock_notifier;
-  WinHeap win_heap;
-  InternalHeap h(&mock_notifier, &win_heap);
-
-  // Allocate and free a zero-sized allocation. This should succeed
-  // by definition.
-  void* alloc = h.Allocate(0);
-  EXPECT_TRUE(h.Free(alloc));
-
-  // Make a bunch of different sized allocations.
-  std::set<void*> allocs;
-  for (size_t i = 1; i < 1024 * 1024; i <<= 1) {
-    void* alloc = h.Allocate(i);
-    allocs.insert(alloc);
-  }
-
-  // Now free them.
-  std::set<void*>::const_iterator it = allocs.begin();
-  for (; it != allocs.end(); ++it)
-    EXPECT_TRUE(h.Free(*it));
-}
-
-TEST(InternalHeapTest, GetAllocationSize) {
-  memory_notifiers::NullMemoryNotifier mock_notifier;
-  testing::DummyHeap heap;
-  InternalHeap h(&mock_notifier, &heap);
-
-  void* alloc = h.Allocate(67);
-  ASSERT_TRUE(alloc != NULL);
-  EXPECT_EQ(common::AlignUp(67u, kShadowRatio), h.GetAllocationSize(alloc));
-}
-
-TEST(InternalHeapTest, NotificationsWorkWithNonNotifyingHeap) {
-  testing::MockMemoryNotifier mock_notifier;
-  WinHeap win_heap;
-  InternalHeap h(&mock_notifier, &win_heap);
-
-  EXPECT_CALL(mock_notifier, NotifyInternalUse(_, 16)).Times(1);
-  EXPECT_CALL(mock_notifier, NotifyReturnedToOS(_, 16)).Times(1);
-  void* alloc = h.Allocate(8);
-  h.Free(alloc);
-}
-
-TEST(InternalHeapTest, NotificationsWorkWithNotifyingHeap) {
-  memory_notifiers::NullMemoryNotifier null_notifier;
-  testing::MockMemoryNotifier mock_notifier;
-  CtMallocHeap ctmalloc_heap(&null_notifier);
-  InternalHeap h(&mock_notifier, &ctmalloc_heap);
-
-  EXPECT_CALL(mock_notifier, NotifyInternalUse(_, 16)).Times(1);
-  EXPECT_CALL(mock_notifier, NotifyFutureHeapUse(_, 16)).Times(1);
-  void* alloc = h.Allocate(8);
-  h.Free(alloc);
-}
-
-TEST(InternalHeapTest, HeaderIsAllocated) {
-  memory_notifiers::NullMemoryNotifier null_notifier;
-  testing::MockHeap mock_heap;
-  uint8 dummy_allocation[16] = {};
-
-  EXPECT_CALL(mock_heap, GetHeapFeatures()).Times(1).WillOnce(Return(0));
-  InternalHeap h(&null_notifier, &mock_heap);
-
-  void* header = dummy_allocation;
-  void* expected_alloc = dummy_allocation + sizeof(uint32);
-
-  EXPECT_CALL(mock_heap, Allocate(16)).Times(1).WillOnce(Return(header));
-  void* alloc = h.Allocate(8);
-  EXPECT_EQ(expected_alloc, alloc);
-  EXPECT_EQ(16, *reinterpret_cast<uint32*>(dummy_allocation));
-
-  EXPECT_CALL(mock_heap, Free(header)).Times(1).WillOnce(Return(true));
-  EXPECT_TRUE(h.Free(alloc));
-}
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heaps/large_block_heap.cc b/syzygy/agent/asan/heaps/large_block_heap.cc
deleted file mode 100644
index 1ae37d3..0000000
--- a/syzygy/agent/asan/heaps/large_block_heap.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heaps/large_block_heap.h"
-
-#include <windows.h>
-
-#include <algorithm>
-
-#include "base/logging.h"
-#include "syzygy/common/align.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-LargeBlockHeap::LargeBlockHeap(HeapInterface* internal_heap)
-    : allocs_(HeapAllocator<void*>(internal_heap)) {
-}
-
-uint32 LargeBlockHeap::GetHeapFeatures() const {
-  return kHeapSupportsIsAllocated;
-}
-
-void* LargeBlockHeap::Allocate(size_t bytes) {
-  // Always allocate some memory so as to guarantee that zero-sized
-  // allocations get an actual distinct address each time.
-  size_t size = std::max(bytes, 1u);
-  size = common::AlignUp(size, kPageSize);
-  void* alloc = ::VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE);
-
-  if (alloc != NULL) {
-    common::AutoRecursiveLock lock(lock_);
-    allocs_.insert(alloc);
-  }
-
-  return alloc;
-}
-
-bool LargeBlockHeap::Free(void* alloc) {
-  {
-    // First lookup the allocation to ensure it was made by us.
-    common::AutoRecursiveLock lock(lock_);
-    AllocationSet::iterator it = allocs_.find(alloc);
-    if (it == allocs_.end())
-      return false;
-    allocs_.erase(it);
-  }
-
-  ::VirtualFree(alloc, 0, MEM_RELEASE);
-  return true;
-}
-
-bool LargeBlockHeap::IsAllocated(void* alloc) {
-  common::AutoRecursiveLock lock(lock_);
-  AllocationSet::iterator it = allocs_.find(alloc);
-  if (it == allocs_.end())
-    return false;
-
-  return true;
-}
-
-size_t LargeBlockHeap::GetAllocationSize(void* alloc) {
-  return kUnknownSize;
-}
-
-void LargeBlockHeap::Lock() {
-  lock_.Acquire();
-}
-
-void LargeBlockHeap::Unlock() {
-  lock_.Release();
-}
-
-void* LargeBlockHeap::AllocateBlock(size_t size,
-                                    size_t min_left_redzone_size,
-                                    size_t min_right_redzone_size,
-                                    BlockLayout* layout) {
-  DCHECK_NE(static_cast<BlockLayout*>(NULL), layout);
-
-  // Plan the layout with full guard pages.
-  BlockPlanLayout(kPageSize, kPageSize, size, kPageSize, kPageSize, layout);
-  DCHECK_EQ(0u, layout->block_size % kPageSize);
-
-  return Allocate(layout->block_size);
-}
-
-bool LargeBlockHeap::FreeBlock(const BlockInfo& block_info) {
-  DCHECK_NE(static_cast<uint8*>(NULL), block_info.block);
-
-  return Free(block_info.block);
-}
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heaps/large_block_heap.h b/syzygy/agent/asan/heaps/large_block_heap.h
deleted file mode 100644
index f1c2507..0000000
--- a/syzygy/agent/asan/heaps/large_block_heap.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Declares LargeBlockHeap, a heap that directly grabs pages of memory from the
-// OS and redzones blocks with entire pages. This is only intended for use with
-// sufficiently large allocations (hence the name) where the redzone overhead
-// can be amortized.
-//
-// SyzyASan overhead is roughly 45% overall, with 25% coming from memory
-// allocation overhead (20 + 16 = 36 bytes of overhead for average allocation
-// sizes of 144 bytes in Chrome). If we wish to maintain a similar overhead
-// then allocations being fed into the large block heap should be at least
-// 32KB in size. Ideally the large allocation heap should not be leaned on too
-// heavily as it can cause significant memory fragmentation.
-
-#ifndef SYZYGY_AGENT_ASAN_HEAPS_LARGE_BLOCK_HEAP_H_
-#define SYZYGY_AGENT_ASAN_HEAPS_LARGE_BLOCK_HEAP_H_
-
-#include <unordered_set>
-
-#include "syzygy/agent/asan/allocators.h"
-#include "syzygy/agent/asan/heap.h"
-#include "syzygy/agent/asan/memory_notifier.h"
-#include "syzygy/common/recursive_lock.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-class LargeBlockHeap : public BlockHeapInterface {
- public:
-  // Constructor.
-  // @param internal_heap The heap to use for making internal allocations.
-  explicit LargeBlockHeap(HeapInterface* internal_heap);
-
-  // Virtual destructor.
-  virtual ~LargeBlockHeap() { }
-
-  // @name HeapInterface implementation.
-  // @{
-  virtual uint32 GetHeapFeatures() const;
-  virtual void* Allocate(size_t bytes);
-  virtual bool Free(void* alloc);
-  virtual bool IsAllocated(void* alloc);
-  virtual size_t GetAllocationSize(void* alloc);
-  virtual void Lock();
-  virtual void Unlock();
-  // @}
-
-  // @name BlockHeapInterface implementation.
-  // @{
-  virtual void* AllocateBlock(size_t size,
-                              size_t min_left_redzone_size,
-                              size_t min_right_redzone_size,
-                              BlockLayout* layout);
-  virtual bool FreeBlock(const BlockInfo& block_info);
-  // @}
-
-  // @returns the number of active allocations in this heap.
-  size_t size() const { return allocs_.size(); }
-
- protected:
-  // The collection of allocations that has been made through this allocator.
-  // It is expected that a small number of allocations will be made, so keeping
-  // track of these explicitly is fine for now.
-  typedef std::unordered_set<
-      void*,
-      std::hash<void*>,
-      std::equal_to<void*>,
-      HeapAllocator<void*>> AllocationSet;
-  AllocationSet allocs_;  // Under lock_.
-
-  // The global lock for this allocator.
-  common::RecursiveLock lock_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(LargeBlockHeap);
-};
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_HEAPS_LARGE_BLOCK_HEAP_H_
diff --git a/syzygy/agent/asan/heaps/large_block_heap_unittest.cc b/syzygy/agent/asan/heaps/large_block_heap_unittest.cc
deleted file mode 100644
index cc98619..0000000
--- a/syzygy/agent/asan/heaps/large_block_heap_unittest.cc
+++ /dev/null
@@ -1,133 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heaps/large_block_heap.h"
-
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/unittest_util.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-namespace {
-
-// Provides an ordering for BlockInfo objects.
-struct BlockInfoLessThan {
-  bool operator()(const BlockInfo& bi1, const BlockInfo& bi2) const {
-    return bi1.block < bi2.block;
-  }
-};
-
-typedef std::set<BlockInfo, BlockInfoLessThan> BlockInfoSet;
-
-testing::DummyHeap dummy_heap;
-
-// A LargeBlockHeap that uses a null memory notifier.
-class TestLargeBlockHeap : public LargeBlockHeap {
- public:
-  TestLargeBlockHeap() : LargeBlockHeap(&dummy_heap) {
-  }
-};
-
-}  // namespace
-
-TEST(LargeBlockHeapTest, FeaturesAreValid) {
-  TestLargeBlockHeap h;
-  EXPECT_EQ(HeapInterface::kHeapSupportsIsAllocated, h.GetHeapFeatures());
-}
-
-TEST(LargeBlockHeapTest, EndToEnd) {
-  TestLargeBlockHeap h;
-  EXPECT_EQ(0u, h.size());
-
-  BlockLayout layout = {};
-  BlockInfo block = {};
-
-  // Allocate and free a zero-sized allocation. This should succeed by
-  // definition.
-  void* alloc = h.AllocateBlock(0, 0, 0, &layout);
-  EXPECT_EQ(1u, h.size());
-  BlockInitialize(layout, alloc, false, &block);
-  EXPECT_TRUE(h.FreeBlock(block));
-  EXPECT_EQ(0u, h.size());
-
-  // Make a bunch of different sized allocations.
-  BlockInfoSet blocks;
-  for (size_t i = 1, j = 1; i < 1024 * 1024; i <<= 1, ++j) {
-    void* alloc = h.AllocateBlock(i, 0, 0, &layout);
-    EXPECT_EQ(j, h.size());
-    EXPECT_EQ(0u, layout.block_size % kPageSize);
-    EXPECT_EQ(0u, reinterpret_cast<uintptr_t>(alloc) % kPageSize);
-    EXPECT_LE(kPageSize, layout.header_size + layout.header_padding_size);
-    EXPECT_EQ(i, layout.body_size);
-    EXPECT_LE(kPageSize, layout.trailer_padding_size + layout.trailer_size);
-    BlockInitialize(layout, alloc, false, &block);
-    blocks.insert(block);
-  }
-
-  // Now free them.
-  BlockInfoSet::const_iterator it = blocks.begin();
-  for (; it != blocks.end(); ++it)
-    EXPECT_TRUE(h.FreeBlock(*it));
-  EXPECT_EQ(0u, h.size());
-}
-
-TEST(LargeBlockHeapTest, ZeroSizedAllocationsHaveDistinctAddresses) {
-  TestLargeBlockHeap h;
-
-  void* a1 = h.Allocate(0);
-  EXPECT_TRUE(a1 != NULL);
-  void* a2 = h.Allocate(0);
-  EXPECT_TRUE(a2 != NULL);
-  EXPECT_NE(a1, a2);
-  h.Free(a1);
-  h.Free(a2);
-
-  BlockLayout layout = {};
-
-  BlockInfo b1 = {};
-  a1 = h.AllocateBlock(0, 0, 0, &layout);
-  EXPECT_TRUE(a1 != NULL);
-  BlockInitialize(layout, a1, false, &b1);
-
-  BlockInfo b2 = {};
-  a2 = h.AllocateBlock(0, 0, 0, &layout);
-  EXPECT_TRUE(a2 != NULL);
-  BlockInitialize(layout, a2, false, &b2);
-
-  EXPECT_NE(a1, a2);
-  EXPECT_NE(b1.block, b2.block);
-
-  h.FreeBlock(b1);
-  h.FreeBlock(b2);
-}
-
-TEST(LargeBlockHeapTest, IsAllocated) {
-  TestLargeBlockHeap h;
-
-  EXPECT_FALSE(h.IsAllocated(NULL));
-
-  void* a = h.Allocate(100);
-  EXPECT_TRUE(h.IsAllocated(a));
-  EXPECT_FALSE(h.IsAllocated(reinterpret_cast<uint8*>(a) - 1));
-  EXPECT_FALSE(h.IsAllocated(reinterpret_cast<uint8*>(a) + 1));
-
-  h.Free(a);
-  EXPECT_FALSE(h.IsAllocated(a));
-}
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heaps/simple_block_heap.cc b/syzygy/agent/asan/heaps/simple_block_heap.cc
deleted file mode 100644
index adb0f1f..0000000
--- a/syzygy/agent/asan/heaps/simple_block_heap.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heaps/simple_block_heap.h"
-
-#include "base/logging.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-SimpleBlockHeap::SimpleBlockHeap(HeapInterface* heap) : heap_(heap) {
-  DCHECK_NE(static_cast<HeapInterface*>(NULL), heap);
-}
-
-SimpleBlockHeap::~SimpleBlockHeap() {
-}
-
-uint32 SimpleBlockHeap::GetHeapFeatures() const {
-  return heap_->GetHeapFeatures();
-}
-
-void* SimpleBlockHeap::Allocate(size_t bytes) {
-  return heap_->Allocate(bytes);
-}
-
-bool SimpleBlockHeap::Free(void* alloc) {
-  return heap_->Free(alloc);
-}
-
-bool SimpleBlockHeap::IsAllocated(void* alloc) {
-  return heap_->IsAllocated(alloc);
-}
-
-size_t SimpleBlockHeap::GetAllocationSize(void* alloc) {
-  return heap_->GetAllocationSize(alloc);;
-}
-
-void SimpleBlockHeap::Lock() {
-  heap_->Lock();
-}
-
-void SimpleBlockHeap::Unlock() {
-  heap_->Unlock();
-}
-
-void* SimpleBlockHeap::AllocateBlock(size_t size,
-                                     size_t min_left_redzone_size,
-                                     size_t min_right_redzone_size,
-                                     BlockLayout* layout) {
-  DCHECK_NE(static_cast<BlockLayout*>(NULL), layout);
-
-  // Plan the block layout.
-  BlockPlanLayout(kShadowRatio, kShadowRatio, size, min_left_redzone_size,
-                  min_right_redzone_size, layout);
-
-  // Allocate space for the block. If the allocation fails heap_ will
-  // return NULL and we'll simply pass it on.
-  void* alloc = heap_->Allocate(layout->block_size);
-  DCHECK_EQ(0u, reinterpret_cast<uintptr_t>(alloc) % kShadowRatio);
-  return alloc;
-}
-
-bool SimpleBlockHeap::FreeBlock(const BlockInfo& block_info) {
-  DCHECK_NE(static_cast<uint8*>(NULL), block_info.block);
-
-  if (!heap_->Free(block_info.block))
-    return false;
-
-  return true;
-}
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heaps/simple_block_heap.h b/syzygy/agent/asan/heaps/simple_block_heap.h
deleted file mode 100644
index 696fd4f..0000000
--- a/syzygy/agent/asan/heaps/simple_block_heap.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Declares SimpleBlockHeap, which is a simple block-aware wrapper of an
-// instance of a HeapInterface. This is the primary type of block heap used
-// by the ASAN instrumentation.
-
-#ifndef SYZYGY_AGENT_ASAN_HEAPS_SIMPLE_BLOCK_HEAP_H_
-#define SYZYGY_AGENT_ASAN_HEAPS_SIMPLE_BLOCK_HEAP_H_
-
-#include "syzygy/agent/asan/heap.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-// A block heap that wraps a raw heap.
-class SimpleBlockHeap : public BlockHeapInterface {
- public:
-  // Constructor.
-  // @param heap Is the underlying raw heap that will be used by this heap.
-  explicit SimpleBlockHeap(HeapInterface* heap);
-
-  // Virtual destructor.
-  virtual ~SimpleBlockHeap();
-
-  // @name HeapInterface implementation.
-  // @{
-  virtual uint32 GetHeapFeatures() const;
-  virtual void* Allocate(size_t bytes);
-  virtual bool Free(void* alloc);
-  virtual bool IsAllocated(void* alloc);
-  virtual size_t GetAllocationSize(void* alloc);
-  virtual void Lock();
-  virtual void Unlock();
-  // @}
-
-  // @name BlockHeapInterface implementation.
-  // @{
-  virtual void* AllocateBlock(size_t size,
-                              size_t min_left_redzone_size,
-                              size_t min_right_redzone_size,
-                              BlockLayout* layout);
-  virtual bool FreeBlock(const BlockInfo& block_info);
-  // @}
-
- protected:
-  // The underlying raw heap.
-  HeapInterface* heap_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(SimpleBlockHeap);
-};
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_HEAPS_SIMPLE_BLOCK_HEAP_H_
diff --git a/syzygy/agent/asan/heaps/simple_block_heap_unittest.cc b/syzygy/agent/asan/heaps/simple_block_heap_unittest.cc
deleted file mode 100644
index 2933cbc..0000000
--- a/syzygy/agent/asan/heaps/simple_block_heap_unittest.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heaps/simple_block_heap.h"
-
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/heaps/win_heap.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-namespace {
-
-// Provides an ordering for BlockInfo objects.
-struct BlockInfoLessThan {
-  bool operator()(const BlockInfo& bi1, const BlockInfo& bi2) const {
-    return bi1.block < bi2.block;
-  }
-};
-
-typedef std::set<BlockInfo, BlockInfoLessThan> BlockInfoSet;
-
-}  // namespace
-
-TEST(SimpleBlockHeapTest, FeaturesAreValid) {
-  WinHeap win_heap;
-  SimpleBlockHeap h(&win_heap);
-  EXPECT_EQ(win_heap.GetHeapFeatures(), h.GetHeapFeatures());
-}
-
-TEST(SimpleBlockHeapTest, EndToEnd) {
-  WinHeap win_heap;
-  SimpleBlockHeap h(&win_heap);
-
-  BlockLayout layout = {};
-  BlockInfo block = {};
-
-  // Allocate and free a zero-sized allocation. This should succeed
-  // by definition.
-  void* alloc = h.AllocateBlock(0, 0, 0, &layout);
-  BlockInitialize(layout, alloc, false, &block);
-  EXPECT_TRUE(h.FreeBlock(block));
-
-  // Make a bunch of different sized allocations.
-  BlockInfoSet blocks;
-  for (size_t i = 1; i < 1024 * 1024; i <<= 1) {
-    void* alloc = h.AllocateBlock(i, 0, 0, &layout);
-    BlockInitialize(layout, alloc, false, &block);
-    blocks.insert(block);
-  }
-
-  // Now free them.
-  BlockInfoSet::const_iterator it = blocks.begin();
-  for (; it != blocks.end(); ++it)
-    EXPECT_TRUE(h.FreeBlock(*it));
-}
-
-TEST(SimpleBlockHeap, IsAllocated) {
-  WinHeap win_heap;
-  SimpleBlockHeap h(&win_heap);
-
-  EXPECT_FALSE(h.IsAllocated(NULL));
-
-  // This heap doesn't support 'IsAllocated', so it should always return false.
-  void* a = h.Allocate(100);
-  EXPECT_FALSE(h.IsAllocated(a));
-
-  h.Free(a);
-  EXPECT_FALSE(h.IsAllocated(a));
-}
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heaps/win_heap.cc b/syzygy/agent/asan/heaps/win_heap.cc
deleted file mode 100644
index b432f2c..0000000
--- a/syzygy/agent/asan/heaps/win_heap.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heaps/win_heap.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-WinHeap::WinHeap() : heap_(NULL), own_heap_(true) {
-  heap_ = ::HeapCreate(0, 0, 0);
-  DCHECK_NE(static_cast<HANDLE>(NULL), heap_);
-}
-
-WinHeap::WinHeap(HANDLE heap) : heap_(heap), own_heap_(false) {
-}
-
-WinHeap::~WinHeap() {
-  if (!own_heap_)
-    return;
-  DCHECK_NE(static_cast<HANDLE>(NULL), heap_);
-  ::HeapDestroy(heap_);
-}
-
-uint32 WinHeap::GetHeapFeatures() const {
-  return kHeapSupportsGetAllocationSize;
-}
-
-void* WinHeap::Allocate(size_t bytes) {
-  DCHECK_NE(static_cast<HANDLE>(NULL), heap_);
-  void* alloc = ::HeapAlloc(heap_, 0, bytes);
-  return alloc;
-}
-
-bool WinHeap::Free(void* alloc) {
-  DCHECK_NE(static_cast<HANDLE>(NULL), heap_);
-
-  // According to the MSDN documentation about HeapFree the return value needs
-  // to be cast to BOOLEAN in order to support Windows XP:
-  //     Prior to Windows Vista, HeapFree has a bug: only the low byte of the
-  //     return value is correctly indicative of the result.  This is because
-  //     the implementation returns type BOOLEAN (BYTE) despite the prototype
-  //     declaring it as returning BOOL (int).
-  //
-  //     If you care about the return value of HeapFree, and you need to support
-  //     XP and 2003, cast the return value to BOOLEAN before checking it.
-  if (static_cast<BOOLEAN>(::HeapFree(heap_, 0, alloc)) != TRUE)
-    return false;
-  return true;
-}
-
-bool WinHeap::IsAllocated(void* alloc) {
-  return false;
-}
-
-size_t WinHeap::GetAllocationSize(void* alloc) {
-  return ::HeapSize(heap_, 0, alloc);
-}
-
-void WinHeap::Lock() {
-  DCHECK_NE(static_cast<HANDLE>(NULL), heap_);
-  // This can only fail if the heap was opened with HEAP_NO_SERIALIZATION.
-  // This is strictly unsupported.
-  // TODO(chrisha): If we want to support this we can always provide our own
-  //     serialization, and query for this condition at runtime.
-  CHECK_EQ(TRUE, ::HeapLock(heap_));
-}
-
-void WinHeap::Unlock() {
-  DCHECK_NE(static_cast<HANDLE>(NULL), heap_);
-  CHECK_EQ(TRUE, ::HeapUnlock(heap_));
-}
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heaps/win_heap.h b/syzygy/agent/asan/heaps/win_heap.h
deleted file mode 100644
index eaf62dc..0000000
--- a/syzygy/agent/asan/heaps/win_heap.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// An implementation of HeapInterface that wraps the Windows heap API.
-
-#ifndef SYZYGY_AGENT_ASAN_HEAPS_WIN_HEAP_H_
-#define SYZYGY_AGENT_ASAN_HEAPS_WIN_HEAP_H_
-
-#include <windows.h>
-
-#include "base/logging.h"
-#include "syzygy/agent/asan/heap.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-class WinHeap : public HeapInterface {
- public:
-  // Constructor. Creates a heap that is owned uniquely by this object.
-  WinHeap();
-
-  // Constructor that wraps an existing heap. Ownership of the heap remains
-  // external to this object.
-  explicit WinHeap(HANDLE heap);
-
-  // Destructor.
-  virtual ~WinHeap();
-
-  // @name HeapInterface functions.
-  // @{
-  virtual uint32 GetHeapFeatures() const;
-  virtual void* Allocate(size_t bytes);
-  virtual bool Free(void* alloc);
-  virtual bool IsAllocated(void* alloc);
-  virtual size_t GetAllocationSize(void* alloc);
-  virtual void Lock();
-  virtual void Unlock();
-  // @}
-
- protected:
-  // The heap that is wrapped by this object.
-  HANDLE heap_;
-
-  // If true then this object owns the wrapped heap.
-  bool own_heap_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(WinHeap);
-};
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_HEAPS_WIN_HEAP_H_
diff --git a/syzygy/agent/asan/heaps/win_heap_unittest.cc b/syzygy/agent/asan/heaps/win_heap_unittest.cc
deleted file mode 100644
index 7bc36e6..0000000
--- a/syzygy/agent/asan/heaps/win_heap_unittest.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heaps/win_heap.h"
-
-#include "gtest/gtest.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-TEST(WinHeapTest, FeaturesAreValid) {
-  WinHeap h;
-  EXPECT_EQ(WinHeap::kHeapSupportsGetAllocationSize,
-            h.GetHeapFeatures());
-}
-
-TEST(WinHeapTest, HeapTest) {
-  WinHeap h;
-
-  // Allocate and free a zero-sized allocation. This should succeed
-  // by definition.
-  void* alloc = h.Allocate(0);
-  EXPECT_TRUE(h.Free(alloc));
-
-  // Make a bunch of different sized allocations.
-  std::set<void*> allocs;
-  for (size_t i = 1; i < 1024 * 1024; i <<= 1) {
-    void* alloc = h.Allocate(i);
-    allocs.insert(alloc);
-  }
-
-  // Now free them.
-  std::set<void*>::const_iterator it = allocs.begin();
-  for (; it != allocs.end(); ++it)
-    EXPECT_TRUE(h.Free(*it));
-}
-
-TEST(WinHeapTest, GetAllocationSize) {
-  WinHeap h;
-
-  void* alloc = h.Allocate(67);
-  ASSERT_TRUE(alloc != NULL);
-  EXPECT_EQ(67u, h.GetAllocationSize(alloc));
-}
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heaps/zebra_block_heap.cc b/syzygy/agent/asan/heaps/zebra_block_heap.cc
deleted file mode 100644
index e99164c..0000000
--- a/syzygy/agent/asan/heaps/zebra_block_heap.cc
+++ /dev/null
@@ -1,310 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heaps/zebra_block_heap.h"
-
-#include <algorithm>
-
-#include "syzygy/common/align.h"
-#include "syzygy/common/asan_parameters.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-const size_t ZebraBlockHeap::kSlabSize = 2 * kPageSize;
-
-ZebraBlockHeap::ZebraBlockHeap(size_t heap_size,
-                               MemoryNotifierInterface* memory_notifier,
-                               HeapInterface* internal_heap)
-    : heap_address_(NULL),
-      // Makes the heap_size a multiple of kSlabSize to avoid incomplete slabs
-      // at the end of the reserved memory.
-      heap_size_(common::AlignUp(heap_size, kSlabSize)),
-      slab_count_(heap_size_ / kSlabSize),
-      slab_info_(HeapAllocator<SlabInfo>(internal_heap)),
-      quarantine_ratio_(common::kDefaultZebraBlockHeapQuarantineRatio),
-      free_slabs_(slab_count_,
-                  HeapAllocator<size_t>(internal_heap)),
-      quarantine_(slab_count_,
-                  HeapAllocator<size_t>(internal_heap)),
-      memory_notifier_(memory_notifier) {
-  DCHECK_NE(reinterpret_cast<MemoryNotifierInterface*>(NULL), memory_notifier);
-
-  // Allocate the chunk of memory directly from the OS.
-  heap_address_ = reinterpret_cast<uint8*>(
-      ::VirtualAlloc(NULL,
-                     heap_size_,
-                     MEM_RESERVE | MEM_COMMIT,
-                     PAGE_READWRITE));
-  CHECK_NE(reinterpret_cast<uint8*>(NULL), heap_address_);
-  DCHECK(common::IsAligned(heap_address_, kPageSize));
-  memory_notifier_->NotifyFutureHeapUse(heap_address_, heap_size_);
-
-  // Initialize the metadata describing the state of our heap.
-  slab_info_.resize(slab_count_);
-  for (size_t i = 0; i < slab_count_; ++i) {
-    slab_info_[i].state = kFreeSlab;
-    slab_info_[i].allocated_address = NULL;
-    slab_info_[i].allocation_size = 0;
-    free_slabs_.push(i);
-  }
-}
-
-ZebraBlockHeap::~ZebraBlockHeap() {
-  DCHECK_NE(reinterpret_cast<uint8*>(NULL), heap_address_);
-  CHECK_NE(FALSE, ::VirtualFree(heap_address_, 0, MEM_RELEASE));
-  memory_notifier_->NotifyReturnedToOS(heap_address_, heap_size_);
-  heap_address_ = NULL;
-}
-
-uint32 ZebraBlockHeap::GetHeapFeatures() const {
-  return kHeapSupportsIsAllocated | kHeapReportsReservations |
-      kHeapSupportsGetAllocationSize;
-}
-
-void* ZebraBlockHeap::Allocate(size_t bytes) {
-  SlabInfo* slab_info = AllocateImpl(bytes);
-  if (slab_info == NULL)
-    return NULL;
-  return slab_info->allocated_address;
-}
-
-bool ZebraBlockHeap::Free(void* alloc) {
-  if (alloc == NULL)
-    return true;
-  common::AutoRecursiveLock lock(lock_);
-  size_t slab_index = GetSlabIndex(alloc);
-  if (slab_index == kInvalidSlabIndex)
-    return false;
-  if (slab_info_[slab_index].allocated_address != alloc)
-    return false;
-
-  // Memory must be released from the quarantine before calling Free.
-  DCHECK_NE(kQuarantinedSlab, slab_info_[slab_index].state);
-
-  if (slab_info_[slab_index].state == kFreeSlab)
-    return false;
-
-  // Make the slab available for allocations.
-  slab_info_[slab_index].state = kFreeSlab;
-  slab_info_[slab_index].allocated_address = NULL;
-  slab_info_[slab_index].allocation_size = 0;
-  free_slabs_.push(slab_index);
-  return true;
-}
-
-bool ZebraBlockHeap::IsAllocated(void* alloc) {
-  if (alloc == NULL)
-    return false;
-  common::AutoRecursiveLock lock(lock_);
-  size_t slab_index = GetSlabIndex(alloc);
-  if (slab_index == kInvalidSlabIndex)
-    return false;
-  if (slab_info_[slab_index].state == kFreeSlab)
-    return false;
-  if (slab_info_[slab_index].allocated_address != alloc)
-    return false;
-  return true;
-}
-
-size_t ZebraBlockHeap::GetAllocationSize(void* alloc) {
-  if (alloc == NULL)
-    return kUnknownSize;
-  common::AutoRecursiveLock lock(lock_);
-  size_t slab_index = GetSlabIndex(alloc);
-  if (slab_index == kInvalidSlabIndex)
-    return kUnknownSize;
-  if (slab_info_[slab_index].state == kFreeSlab)
-    return kUnknownSize;
-  if (slab_info_[slab_index].allocated_address != alloc)
-    return kUnknownSize;
-  return slab_info_[slab_index].allocation_size;
-}
-
-void ZebraBlockHeap::Lock() {
-  lock_.Acquire();
-}
-
-void ZebraBlockHeap::Unlock() {
-  lock_.Release();
-}
-
-void* ZebraBlockHeap::AllocateBlock(size_t size,
-                                    size_t min_left_redzone_size,
-                                    size_t min_right_redzone_size,
-                                    BlockLayout* layout) {
-  DCHECK_NE(static_cast<BlockLayout*>(NULL), layout);
-  // Abort if the redzones do not fit in a page. Even if the allocation
-  // is possible it will lead to a non-standard block layout.
-  if (min_left_redzone_size + size > kPageSize)
-    return NULL;
-  if (min_right_redzone_size > kPageSize)
-    return NULL;
-
-  // Plan the block layout.
-  BlockPlanLayout(kPageSize,
-                  kShadowRatio,
-                  size,
-                  min_left_redzone_size,
-                  std::max(kPageSize, min_right_redzone_size),
-                  layout);
-
-  if (layout->block_size != kSlabSize)
-    return NULL;
-  size_t right_redzone_size = layout->trailer_size +
-      layout->trailer_padding_size;
-  // Part of the body lies inside an "odd" page.
-  if (right_redzone_size < kPageSize)
-    return NULL;
-  // There should be less than kShadowRatio bytes between the body end
-  // and the "odd" page.
-  if (right_redzone_size - kPageSize >= kShadowRatio)
-    return NULL;
-
-  // Allocate space for the block, and update the slab info to reflect the right
-  // redzone.
-  void* alloc = NULL;
-  SlabInfo* slab_info = AllocateImpl(kPageSize);
-  if (slab_info != NULL) {
-    slab_info->allocation_size = 2 * kPageSize;
-    alloc = slab_info->allocated_address;
-  }
-
-  DCHECK_EQ(0u, reinterpret_cast<uintptr_t>(alloc) % kShadowRatio);
-  return alloc;
-}
-
-bool ZebraBlockHeap::FreeBlock(const BlockInfo& block_info) {
-  DCHECK_NE(static_cast<uint8*>(NULL), block_info.block);
-  if (!Free(block_info.block))
-    return false;
-  return true;
-}
-
-bool ZebraBlockHeap::Push(BlockHeader* const &object) {
-  common::AutoRecursiveLock lock(lock_);
-  size_t slab_index = GetSlabIndex(reinterpret_cast<void*>(object));
-  if (slab_index == kInvalidSlabIndex)
-    return false;
-  if (slab_info_[slab_index].state != kAllocatedSlab)
-    return false;
-  if (slab_info_[slab_index].allocated_address !=
-      reinterpret_cast<void*>(object)) {
-    return false;
-  }
-
-  quarantine_.push(slab_index);
-  slab_info_[slab_index].state = kQuarantinedSlab;
-  return true;
-}
-
-bool ZebraBlockHeap::Pop(BlockHeader** block) {
-  common::AutoRecursiveLock lock(lock_);
-
-  if (QuarantineInvariantIsSatisfied())
-    return false;
-
-  size_t slab_index = quarantine_.front();
-  DCHECK_NE(kInvalidSlabIndex, slab_index);
-  quarantine_.pop();
-
-  void* alloc = slab_info_[slab_index].allocated_address;
-  DCHECK_NE(static_cast<void*>(NULL), alloc);
-  *block = reinterpret_cast<BlockHeader*>(alloc);
-
-  DCHECK_EQ(kQuarantinedSlab, slab_info_[slab_index].state);
-  slab_info_[slab_index].state = kAllocatedSlab;
-  return true;
-}
-
-void ZebraBlockHeap::Empty(ObjectVector* objects) {
-  common::AutoRecursiveLock lock(lock_);
-  BlockHeader* object = NULL;
-  while (!quarantine_.empty()) {
-    size_t slab_index = quarantine_.front();
-    DCHECK_NE(kInvalidSlabIndex, slab_index);
-    quarantine_.pop();
-
-    object = reinterpret_cast<BlockHeader*>(
-        slab_info_[slab_index].allocated_address);
-
-    DCHECK_NE(reinterpret_cast<BlockHeader*>(NULL), object);
-
-    // Do not free the slab, only release it from the quarantine.
-    slab_info_[slab_index].state = kAllocatedSlab;
-    objects->push_back(object);
-  }
-}
-
-size_t ZebraBlockHeap::GetCount() {
-  common::AutoRecursiveLock lock(lock_);
-  return quarantine_.size();
-}
-
-void ZebraBlockHeap::set_quarantine_ratio(float quarantine_ratio) {
-  DCHECK_LE(0, quarantine_ratio);
-  DCHECK_GE(1, quarantine_ratio);
-  common::AutoRecursiveLock lock(lock_);
-  quarantine_ratio_ = quarantine_ratio;
-}
-
-ZebraBlockHeap::SlabInfo* ZebraBlockHeap::AllocateImpl(size_t bytes) {
-  if (bytes == 0 || bytes > kPageSize)
-    return NULL;
-  common::AutoRecursiveLock lock(lock_);
-
-  if (free_slabs_.empty())
-    return NULL;
-
-  size_t slab_index = free_slabs_.front();
-  DCHECK_NE(kInvalidSlabIndex, slab_index);
-  free_slabs_.pop();
-  uint8* slab_address = GetSlabAddress(slab_index);
-  DCHECK_NE(reinterpret_cast<uint8*>(NULL), slab_address);
-
-  // Push the allocation to the end of the even page.
-  uint8* alloc = slab_address + kPageSize - bytes;
-  alloc = common::AlignDown(alloc, kShadowRatio);
-
-  // Update the slab info.
-  SlabInfo* slab_info = &slab_info_[slab_index];
-  slab_info->state = kAllocatedSlab;
-  slab_info->allocated_address = alloc;
-  slab_info->allocation_size = bytes;
-
-  return slab_info;
-}
-
-bool ZebraBlockHeap::QuarantineInvariantIsSatisfied() {
-  return quarantine_.empty() ||
-         (quarantine_.size() / static_cast<float>(slab_count_) <=
-             quarantine_ratio_);
-}
-
-uint8* ZebraBlockHeap::GetSlabAddress(size_t index) {
-  if (index >= slab_count_)
-    return NULL;
-  return heap_address_ + index * kSlabSize;
-}
-
-size_t ZebraBlockHeap::GetSlabIndex(void* address) {
-  if (address < heap_address_ || address >= heap_address_ + heap_size_)
-    return kInvalidSlabIndex;
-  return (reinterpret_cast<uint8*>(address) - heap_address_) / kSlabSize;
-}
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
diff --git a/syzygy/agent/asan/heaps/zebra_block_heap.h b/syzygy/agent/asan/heaps/zebra_block_heap.h
deleted file mode 100644
index 24a0f89..0000000
--- a/syzygy/agent/asan/heaps/zebra_block_heap.h
+++ /dev/null
@@ -1,205 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// An implementation of HeapInterface which ensures that the end of memory
-// allocations is aligned to the system page size and followed by an empty
-// page.
-
-#ifndef SYZYGY_AGENT_ASAN_HEAPS_ZEBRA_BLOCK_HEAP_H_
-#define SYZYGY_AGENT_ASAN_HEAPS_ZEBRA_BLOCK_HEAP_H_
-
-#include <windows.h>
-
-#include <list>
-#include <queue>
-#include <vector>
-
-#include "base/logging.h"
-#include "syzygy/agent/asan/allocators.h"
-#include "syzygy/agent/asan/circular_queue.h"
-#include "syzygy/agent/asan/constants.h"
-#include "syzygy/agent/asan/heap.h"
-#include "syzygy/agent/asan/memory_notifier.h"
-#include "syzygy/agent/asan/quarantine.h"
-#include "syzygy/common/recursive_lock.h"
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-// A zebra-stripe heap allocates a (maximum) predefined amount of memory
-// and serves allocation requests with size less than or equal to the system
-// page size.
-// It divides the memory into 'slabs'; each slab consist of an 'even' page
-// followed by an 'odd' page (like zebra-stripes).
-//
-//                             |-----------slab 1----------|
-// +-------------+-------------+-------------+-------------+------------- - -+
-// |even 4k page | odd 4k page |even 4k page | odd 4k page |             ... |
-// +-------------+-------------+-------------+-------------+------------- - -+
-// |-----------slab 0----------|                           |---slab 2---- - -|
-//
-// All the allocations are done in the even pages, just before the odd pages.
-// The odd pages can be protected againt read/write which gives a basic
-// mechanism for detecting buffer overflows.
-//
-// A block allocation starts with the block header and ends with the block
-// trailer. The body is completely contained in the even page and pushed to the
-// right, but since the body must be kShadowRatio-aligned there could be a
-// small gap between the body and the odd page which is covered by the trailer
-// padding. Both paddings fill the rest of the pages.
-//
-//          |-header-padding-|      |-------trailer-padding------|
-// +--------+----------------+------+--+-------------------------+---------+
-// |         even 4k page              |          odd 4k page              |
-// +--------+----------------+------+--+-------------------------+---------+
-// |-header-|                |-body-|                            |-trailer-|
-//
-// Calling Free on a quarantined address is an invalid operation.
-class ZebraBlockHeap : public BlockHeapInterface,
-                       public BlockQuarantineInterface {
- public:
-  // The size of a 2-page slab (2 * kPageSize).
-  static const size_t kSlabSize;
-
-  // Constructor.
-  // @param heap_size The amount of memory reserved by the heap in bytes.
-  // @param memory_notifier The MemoryNotifierInterface used to report
-  //     allocation information.
-  // @param internal_heap The heap to use for making internal allocations.
-  ZebraBlockHeap(size_t heap_size,
-                 MemoryNotifierInterface* memory_notifier,
-                 HeapInterface* internal_heap);
-
-  // Virtual destructor. Frees all the allocated memory.
-  virtual ~ZebraBlockHeap();
-
-  // @name HeapInterface functions.
-  // @{
-  virtual uint32 GetHeapFeatures() const;
-  virtual void* Allocate(size_t bytes);
-  virtual bool Free(void* alloc);
-  virtual bool IsAllocated(void* alloc);
-  virtual size_t GetAllocationSize(void* alloc);
-  virtual void Lock();
-  virtual void Unlock();
-  // @}
-
-  // @name BlockHeapInterface functions.
-  // @{
-  virtual void* AllocateBlock(size_t size,
-                              size_t min_left_redzone_size,
-                              size_t min_right_redzone_size,
-                              BlockLayout* layout);
-  virtual bool FreeBlock(const BlockInfo& block_info);
-  // @}
-
-  // @name BlockQuarantineInterface functions.
-  // @{
-  virtual bool Push(BlockHeader* const &object);
-  virtual bool Pop(BlockHeader** object);
-  virtual void Empty(std::vector<BlockHeader*>* objects);
-  virtual size_t GetCount();
-  // @}
-
-  // Get the ratio of the memory used by the quarantine.
-  float quarantine_ratio() const { return quarantine_ratio_; }
-
-  // Set the ratio of the memory used by the quarantine.
-  void set_quarantine_ratio(float quarantine_ratio);
-
- protected:
-  // The set of possible states of the slabs.
-  enum SlabState {
-    kFreeSlab,
-    kAllocatedSlab,
-    kQuarantinedSlab
-  };
-
-  // TODO(chrisha): Make this a bitfield; all three fields fit in 4 bytes
-  //     rather than 12.
-  // - Need 14 bits for size (0 - 8192).
-  // - Need 13 bits for allocation offset in a slab (0 - 4096).
-  // - Need 2 bits for state.
-  // Describes the slab state.
-  struct SlabInfo {
-    SlabState state;
-    uint8* allocated_address;
-    size_t allocation_size;
-  };
-
-  // Performs an allocation, and returns a pointer to the SlabInfo where the
-  // allocation was made.
-  SlabInfo* AllocateImpl(size_t bytes);
-
-  // Checks if the quarantine invariant is satisfied.
-  // @returns true if the quarantine invariant is satisfied, false otherwise.
-  bool QuarantineInvariantIsSatisfied();
-
-  // Gives the 0-based index of the slab containing 'address'.
-  // @param address address.
-  // @returns The 0-based index of the slab containing 'address', or
-  //     kInvalidSlab index if the address is not valid.
-  size_t GetSlabIndex(void* address);
-
-  // Gives the addres of the given slab.
-  // @param index 0-based index of the slab.
-  // @returns The address of the slab, or NULL if the index is invalid.
-  uint8* GetSlabAddress(size_t index);
-
-  // Defines an invalid slab index.
-  static const size_t kInvalidSlabIndex = -1;
-
-  // Heap memory address.
-  uint8* heap_address_;
-
-  // The heap size in bytes.
-  size_t heap_size_;
-
-  // The total number of slabs.
-  size_t slab_count_;
-
-  // The ratio [0 .. 1] of the memory used by the quarantine. Under lock_.
-  float quarantine_ratio_;
-
-  typedef CircularQueue<size_t, HeapAllocator<size_t>> SlabIndexQueue;
-
-  // Holds the indices of free slabs. Under lock_.
-  SlabIndexQueue free_slabs_;
-
-  // Holds the indices of the quarantined slabs. Under lock_.
-  SlabIndexQueue quarantine_;
-
-  typedef std::vector<SlabInfo,
-                      HeapAllocator<SlabInfo>> SlabInfoVector;
-
-  // Holds the information related to slabs. Under lock_.
-  SlabInfoVector slab_info_;
-
-  // The interface that will be notified of internal memory use. Has its own
-  // locking.
-  MemoryNotifierInterface* memory_notifier_;
-
-  // The global lock for this allocator.
-  common::RecursiveLock lock_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(ZebraBlockHeap);
-};
-
-}  // namespace heaps
-}  // namespace asan
-}  // namespace agent
-
-#endif  // SYZYGY_AGENT_ASAN_HEAPS_ZEBRA_BLOCK_HEAP_H_
diff --git a/syzygy/agent/asan/heaps/zebra_block_heap_unittest.cc b/syzygy/agent/asan/heaps/zebra_block_heap_unittest.cc
deleted file mode 100644
index 4794890..0000000
--- a/syzygy/agent/asan/heaps/zebra_block_heap_unittest.cc
+++ /dev/null
@@ -1,458 +0,0 @@
-// Copyright 2014 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "syzygy/agent/asan/heaps/zebra_block_heap.h"
-
-#include <algorithm>
-#include <set>
-#include <utility>
-#include <vector>
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "syzygy/agent/asan/unittest_util.h"
-#include "syzygy/common/align.h"
-
-
-namespace agent {
-namespace asan {
-namespace heaps {
-
-namespace {
-
-using common::IsAligned;
-using common::AlignDown;
-using common::AlignUp;
-
-using ::testing::_;
-using ::testing::Gt;
-using ::testing::NotNull;
-using ::testing::AtLeast;
-
-testing::NullMemoryNotifier null_notifier;
-testing::DummyHeap dummy_heap;
-
-class TestZebraBlockHeap : public ZebraBlockHeap {
- public:
-  using ZebraBlockHeap::QuarantineInvariantIsSatisfied;
-  using ZebraBlockHeap::heap_address_;
-  using ZebraBlockHeap::slab_count_;
-
-  static const size_t kInitialHeapSize = 8 * (1 << 20);
-
-  // Creates a test heap with 8 MB initial (and maximum) memory using the
-  // default memory notifier.
-  TestZebraBlockHeap() : ZebraBlockHeap(kInitialHeapSize,
-                                        &null_notifier,
-                                        &dummy_heap) { }
-
-  // Creates a test heap with 8 MB initial (and maximum) memory using a custom
-  // memory notifier.
-  explicit TestZebraBlockHeap(MemoryNotifierInterface* memory_notifier)
-      : ZebraBlockHeap(kInitialHeapSize, memory_notifier, &dummy_heap) { }
-
-  // Allows to know if the heap can handle more allocations.
-  // @returns true if the heap is full (no more allocations allowed),
-  // false otherwise.
-  bool IsHeapFull() {
-    // No free slabs.
-    return free_slabs_.empty();
-  }
-};
-
-}  // namespace
-
-TEST(ZebraBlockHeapTest, FeaturesAreValid) {
-  TestZebraBlockHeap h;
-  EXPECT_EQ(HeapInterface::kHeapSupportsIsAllocated |
-                HeapInterface::kHeapReportsReservations |
-                HeapInterface::kHeapSupportsGetAllocationSize,
-            h.GetHeapFeatures());
-}
-
-TEST(ZebraBlockHeapTest, AllocateEmptyBlock) {
-  TestZebraBlockHeap h;
-  BlockLayout layout = {};
-  BlockInfo block = {};
-
-  // Allocate and free a zero-sized allocation. This should succeed
-  // by definition.
-  void* alloc = h.AllocateBlock(0, 0, 0, &layout);
-  EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-  EXPECT_TRUE(IsAligned(alloc, kShadowRatio));
-  BlockInitialize(layout, alloc, false, &block);
-  EXPECT_TRUE(h.FreeBlock(block));
-}
-
-TEST(ZebraBlockHeapTest, EndToEnd) {
-  TestZebraBlockHeap h;
-  BlockLayout layout = {};
-  BlockInfo block = {};
-
-  // Make a bunch of different sized allocations.
-  std::vector<BlockInfo> blocks;
-  for (size_t i = 1; i < 100; i++) {
-    void* alloc = h.AllocateBlock(i, 0, 0, &layout);
-    EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-    EXPECT_TRUE(IsAligned(alloc, kShadowRatio));
-    BlockInitialize(layout, alloc, false, &block);
-    blocks.push_back(block);
-  }
-
-  // Now free them.
-  for (size_t i = 0; i < blocks.size(); ++i)
-    EXPECT_TRUE(h.FreeBlock(blocks[i]));
-}
-
-TEST(ZebraBlockHeapTest, BlocksHaveCorrectAlignment) {
-  TestZebraBlockHeap h;
-  BlockLayout layout = {};
-  BlockInfo block = {};
-
-  // Allocate blocks with different header, body and trailer sizes .
-  for (size_t header_size = 0; header_size < 100; header_size += 3) {
-    for (size_t trailer_size = 0; trailer_size < 100; trailer_size += 3) {
-      for (size_t body_size = 0; body_size < 100; body_size += 3) {
-        void* alloc = h.AllocateBlock(body_size, header_size,
-                                      trailer_size, &layout);
-
-        EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-        EXPECT_TRUE(IsAligned(alloc, kShadowRatio));
-
-        BlockInitialize(layout, alloc, false, &block);
-
-        // The header (== block), body and the end of the trailer must be
-        // kShadowRatio aligned.
-        EXPECT_TRUE(IsAligned(block.body, kShadowRatio));
-        EXPECT_TRUE(IsAligned(block.header, kShadowRatio));
-        EXPECT_TRUE(IsAligned(block.block, kPageSize));
-        EXPECT_TRUE(IsAligned(block.block + block.block_size, kPageSize));
-
-        size_t right_redzone_size = (block.block + block.block_size) -
-            reinterpret_cast<uint8*>(block.trailer_padding);
-
-        EXPECT_EQ(2 * kPageSize, block.block_size);
-        EXPECT_LE(kPageSize, right_redzone_size);
-
-        size_t body_offset = AlignUp(block.trailer_padding, kPageSize) -
-            block.trailer_padding;
-
-        // The body must be as close as possible to the page.
-        EXPECT_GT(kShadowRatio, body_offset);
-
-        EXPECT_TRUE(h.FreeBlock(block));
-      }
-    }
-  }
-}
-
-TEST(ZebraBlockHeapTest, AllocateSizeLimits) {
-  TestZebraBlockHeap h;
-
-  // Test all possible allocation sizes.
-  for (size_t i = 1; i <= kPageSize; ++i) {
-    uint8* alloc = reinterpret_cast<uint8*>(h.Allocate(i));
-    EXPECT_NE(reinterpret_cast<uint8*>(NULL), alloc);
-    EXPECT_TRUE(IsAligned(alloc, kShadowRatio));
-    EXPECT_TRUE(h.Free(alloc));
-  }
-
-  // Impossible allocation sizes.
-  for (size_t delta = 1; delta < 10000; delta += 7)
-    EXPECT_EQ(reinterpret_cast<void*>(NULL), h.Allocate(kPageSize + delta));
-}
-
-
-TEST(ZebraBlockHeapTest, AllocateBlockSizeLimits) {
-  TestZebraBlockHeap h;
-  BlockLayout layout = {};
-  BlockInfo block = {};
-
-  const size_t kMaxAllowedBlockSize = kPageSize - sizeof(BlockHeader);
-
-  // Allocate all possible block sizes.
-  for (size_t i = 0; i <= kMaxAllowedBlockSize; ++i) {
-    uint8* alloc = reinterpret_cast<uint8*>(
-        h.AllocateBlock(i, sizeof(BlockHeader), sizeof(BlockTrailer), &layout));
-
-    EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-    BlockInitialize(layout, alloc, false, &block);
-    EXPECT_TRUE(h.FreeBlock(block));
-  }
-
-  // Impossible block sizes.
-  for (size_t delta = 1; delta < 10000; delta += 7)
-    EXPECT_EQ(reinterpret_cast<uint8*>(NULL),
-              h.AllocateBlock(kMaxAllowedBlockSize + delta,
-                              sizeof(BlockHeader), sizeof(BlockTrailer),
-                              &layout));
-}
-
-TEST(ZebraBlockHeapTest, AllocateTwoEmptyBlocks) {
-  TestZebraBlockHeap h;
-  BlockLayout layout1 = {};
-  BlockLayout layout2 = {};
-  BlockInfo block1 = {};
-  BlockInfo block2 = {};
-
-  void* mem1 = h.AllocateBlock(0, sizeof(BlockHeader), sizeof(BlockTrailer),
-      &layout1);
-  EXPECT_NE(reinterpret_cast<void*>(NULL), mem1);
-  EXPECT_TRUE(IsAligned(mem1, kShadowRatio));
-
-  void* mem2 = h.AllocateBlock(0, sizeof(BlockHeader), sizeof(BlockTrailer),
-      &layout2);
-  EXPECT_NE(reinterpret_cast<void*>(NULL), mem2);
-  EXPECT_TRUE(IsAligned(mem2, kShadowRatio));
-
-  // Empty blocks cannot have the same address.
-  EXPECT_NE(mem1, mem2);
-
-  BlockInitialize(layout1, mem1, false, &block1);
-  BlockInitialize(layout2, mem2, false, &block2);
-
-  EXPECT_TRUE(h.FreeBlock(block1));
-  EXPECT_TRUE(h.FreeBlock(block2));
-}
-
-
-TEST(ZebraBlockHeapTest, AllocateUntilFull) {
-  TestZebraBlockHeap h;
-  // Test maximum number of allocations.
-  std::vector<uint8*> buffers;
-  for (size_t i = 0; i < h.slab_count_; ++i) {
-    uint8* alloc = reinterpret_cast<uint8*>(h.Allocate(0xFF));
-    EXPECT_NE(reinterpret_cast<uint8*>(NULL), alloc);
-    EXPECT_TRUE(IsAligned(alloc, kShadowRatio));
-    buffers.push_back(alloc);
-  }
-
-  // The number of allocations should match the number of even pages.
-  EXPECT_EQ(h.slab_count_, buffers.size());
-
-  // Impossible to allocate memory on a full heap.
-  EXPECT_EQ(reinterpret_cast<void*>(NULL), h.Allocate(0xFF));
-
-  // Check that all buffers are at least page_size bytes apart.
-  std::sort(buffers.begin(), buffers.end());
-  for (size_t i = 1; i < buffers.size(); ++i)
-    EXPECT_LE(kPageSize, static_cast<size_t>(buffers[i] - buffers[i - 1]));
-
-  // Cleanup.
-  for (size_t i = 0; i < buffers.size(); ++i)
-    EXPECT_TRUE(h.Free(buffers[i]));
-}
-
-TEST(ZebraBlockHeapTest, StressAllocateFree) {
-  TestZebraBlockHeap h;
-
-  // Test maximum number of allocations.
-  std::vector<uint8*> buffers;
-
-  // Fill the heap.
-  for (size_t i = 0; i < h.slab_count_; ++i) {
-    uint8* alloc = reinterpret_cast<uint8*>(h.Allocate(0xFF));
-    EXPECT_NE(reinterpret_cast<uint8*>(NULL), alloc);
-    EXPECT_TRUE(IsAligned(alloc, kShadowRatio));
-    buffers.push_back(alloc);
-  }
-
-  // The number of allocations must match the number of even pages.
-  EXPECT_EQ(h.slab_count_, buffers.size());
-  // Impossible to allocate memory on a full heap.
-  EXPECT_EQ(reinterpret_cast<void*>(NULL), h.Allocate(0xFF));
-
-  // Shuffle the allocation order deterministically.
-  for (size_t i = 0; i < buffers.size(); ++i)
-    std::swap(buffers[i], buffers[(3 * i) % buffers.size()]);
-
-  // Stress Allocate/Free (the heap starts full).
-  for (size_t i = 1; i < buffers.size() / 2; ++i) {
-    // Free i blocks.
-    for (size_t j = 0; j < i; ++j) {
-      EXPECT_TRUE(h.Free(buffers.back()));
-      buffers.pop_back();
-    }
-
-    // Allocates i blocks, so the heap is full again.
-    for (size_t j = 0; j < i; ++j) {
-      uint8* alloc = reinterpret_cast<uint8*>(h.Allocate(0xFF));
-      EXPECT_NE(reinterpret_cast<uint8*>(NULL), alloc);
-      buffers.push_back(alloc);
-    }
-
-    // The number of allocations must match the number of even pages.
-    EXPECT_EQ(h.slab_count_, buffers.size());
-    // Impossible to allocate memory on a full heap.
-    EXPECT_EQ(reinterpret_cast<void*>(NULL), h.Allocate(0xFF));
-  }
-
-  // Cleanup.
-  for (size_t i = 0; i < buffers.size(); ++i)
-    EXPECT_TRUE(h.Free(buffers[i]));
-}
-
-TEST(ZebraBlockHeapTest, AllocateBlockCornerCases) {
-  TestZebraBlockHeap h;
-  BlockLayout layout = {};
-  BlockInfo block = {};
-
-  size_t block_header_size = sizeof(BlockHeader);
-  size_t block_trailer_size = sizeof(BlockTrailer);
-
-  // Edge-case sizes for testing corner cases.
-  const size_t kSizes[] = { 0, 1, 2, 3, 4, 5, 7, 8, 9, 15, 17, 1023, 1024, 1025,
-      1235, 1365, 2014, 2047, 2048, 2049, 3000, 7000, 12345,
-      kPageSize - 1,
-      kPageSize,
-      kPageSize + 1,
-      kShadowRatio - 1,
-      kShadowRatio,
-      kShadowRatio + 1,
-      block_header_size - 1,
-      block_header_size,
-      block_header_size + 1,
-      block_trailer_size - 1,
-      block_trailer_size,
-      block_trailer_size + 1,
-      kPageSize - block_header_size - 1,
-      kPageSize - block_header_size,
-      kPageSize - block_header_size + 1,
-      kPageSize - block_trailer_size - 1,
-      kPageSize - block_trailer_size,
-      kPageSize - block_trailer_size + 1 };
-
-  for (size_t i = 0; i < arraysize(kSizes); ++i) {
-    for (size_t j = 0; j < arraysize(kSizes); ++j) {
-      for (size_t k = 0; k < arraysize(kSizes); ++k) {
-        size_t header_size = kSizes[i];
-        size_t body_size = kSizes[j];
-        size_t trailer_size = kSizes[k];
-
-        // Check if there is capacity to do the allocation.
-        EXPECT_FALSE(h.IsHeapFull());
-
-        void* alloc = h.AllocateBlock(body_size,
-                                      header_size,
-                                      trailer_size,
-                                      &layout);
-
-        if (alloc != NULL) {
-          // Check that the block is well formed.
-          EXPECT_TRUE(header_size + body_size <= kPageSize);
-          EXPECT_TRUE(trailer_size <= kPageSize);
-
-          size_t body_end_offset = layout.header_size +
-              layout.header_padding_size + layout.body_size;
-
-          EXPECT_EQ(kPageSize, common::AlignUp(body_end_offset, kShadowRatio));
-          BlockInitialize(layout, alloc, false, &block);
-          EXPECT_TRUE(h.FreeBlock(block));
-        } else {
-          size_t body_end_offset = layout.header_size +
-              layout.header_padding_size + layout.body_size;
-
-          // Check the cause of the unsuccessful allocation.
-          EXPECT_TRUE(
-              // Even page overflow.
-              (header_size + body_size > kPageSize) ||
-              // Odd page overflow.
-              (trailer_size > kPageSize) ||
-              // Incorrect body alignment.
-              (kPageSize != common::AlignUp(body_end_offset, kShadowRatio)));
-        }
-      }
-    }
-  }
-}
-
-TEST(ZebraBlockHeapTest, IsAllocated) {
-  TestZebraBlockHeap h;
-
-  EXPECT_FALSE(h.IsAllocated(NULL));
-
-  void* a = h.Allocate(100);
-  EXPECT_TRUE(h.IsAllocated(a));
-  EXPECT_FALSE(h.IsAllocated(reinterpret_cast<uint8*>(a) - 1));
-  EXPECT_FALSE(h.IsAllocated(reinterpret_cast<uint8*>(a) + 1));
-
-  h.Free(a);
-  EXPECT_FALSE(h.IsAllocated(a));
-}
-
-TEST(ZebraBlockHeapTest, GetAllocationSize) {
-  TestZebraBlockHeap h;
-
-  void* alloc = h.Allocate(67);
-  ASSERT_TRUE(alloc != NULL);
-  EXPECT_EQ(67u, h.GetAllocationSize(alloc));
-}
-
-TEST(ZebraBlockHeapTest, PushPopInvariant) {
-  TestZebraBlockHeap h;
-  BlockLayout layout = {};
-  BlockInfo block = {};
-
-  // Fill the heap.
-  std::vector<BlockInfo> blocks;
-  for (size_t i = 0; i < h.slab_count_; i++) {
-    void* alloc = h.AllocateBlock(0xFF, 0, 0, &layout);
-    EXPECT_NE(reinterpret_cast<void*>(NULL), alloc);
-    EXPECT_TRUE(IsAligned(alloc, kShadowRatio));
-    BlockInitialize(layout, alloc, false, &block);
-    blocks.push_back(block);
-    EXPECT_TRUE(h.Push(block.header));
-  }
-
-  for (size_t i = 0; i < h.slab_count_; i++) {
-    BlockHeader* dummy;
-    bool old_invariant = h.QuarantineInvariantIsSatisfied();
-    if (h.Pop(&dummy)) {
-      EXPECT_FALSE(old_invariant);
-    } else {
-      EXPECT_TRUE(old_invariant);
-      EXPECT_TRUE(h.QuarantineInvariantIsSatisfied());
-      break;
-    }
-  }
-
-  // Clear the quarantine.
-  std::vector<BlockHeader*> objects;
-  h.Empty(&objects);
-
-  // Blocks can be freed now.
-  for (size_t i = 0; i < blocks.size(); i++)
-    EXPECT_TRUE(h.FreeBlock(blocks[i]));
-}
-
-TEST(ZebraBlockHeapTest, MemoryNotifierIsCalled) {
-  testing::MockMemoryNotifier mock_notifier;
-
-  // Should be called exactly once when reserving the initial memory.
-  EXPECT_CALL(mock_notifier,
-      NotifyFutureHeapUse(NotNull(), Gt(0u)))
-      .Times(1);
-
-  // Should be called in the ZebraBlockHeap destructor.
-  EXPECT_CALL(mock_notifier,
-      NotifyReturnedToOS(NotNull(), Gt(0u)))
-      .Times(1);
-
-  TestZebraBlockHeap h(&mock_notifier);
-  h.Allocate(10);
-}
-
-}  // namespace heaps