Import Cobalt 20.master.0.215766
diff --git a/src/base/allocator/allocator_shim_unittest.cc b/src/base/allocator/allocator_shim_unittest.cc
index 6c1efe2..f9ec2b0 100644
--- a/src/base/allocator/allocator_shim_unittest.cc
+++ b/src/base/allocator/allocator_shim_unittest.cc
@@ -13,7 +13,7 @@
 
 #include "starboard/types.h"
 
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 
 #include "starboard/memory.h"
 
diff --git a/src/base/android/jni_android.cc b/src/base/android/jni_android.cc
index 4369595..f202461 100644
--- a/src/base/android/jni_android.cc
+++ b/src/base/android/jni_android.cc
@@ -14,8 +14,8 @@
 #include "base/lazy_instance.h"
 #include "base/logging.h"
 #include "base/threading/thread_local.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "starboard/types.h"
 
 namespace {
diff --git a/src/base/android/jni_array_unittest.cc b/src/base/android/jni_array_unittest.cc
index ce46a48..a715f9f 100644
--- a/src/base/android/jni_array_unittest.cc
+++ b/src/base/android/jni_array_unittest.cc
@@ -9,7 +9,7 @@
 #include "base/android/jni_android.h"
 #include "base/android/scoped_java_ref.h"
 #include "base/macros.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/src/base/base.gyp b/src/base/base.gyp
index 78c1153..9cbd82f 100644
--- a/src/base/base.gyp
+++ b/src/base/base.gyp
@@ -300,11 +300,11 @@
         'rand_util_starboard.cc',
         'run_loop.cc',
         'run_loop.h',
+        'sampling_heap_profiler/lock_free_address_hash_set.cc',
+        'sampling_heap_profiler/lock_free_address_hash_set.h',
         'sampling_heap_profiler/module_cache.cc',
         'sampling_heap_profiler/module_cache.h',
         'sampling_heap_profiler/module_cache_starboard.cc',
-        'sampling_heap_profiler/lock_free_address_hash_set.cc',
-        'sampling_heap_profiler/lock_free_address_hash_set.h',
         'scoped_clear_errno.h',
         'scoped_generic.h',
         'scoped_observer.h',
@@ -329,7 +329,9 @@
         'strings/pattern.h',
         'strings/safe_sprintf.cc',
         'strings/safe_sprintf.h',
-        "strings/string16.cc",
+        'strings/strcat.cc',
+        'strings/strcat.h',
+        'strings/string16.cc',
         'strings/string16.h',
         'strings/string_number_conversions.cc',
         'strings/string_number_conversions.h',
@@ -995,8 +997,6 @@
         'task/sequence_manager/test/test_task_time_observer.h',
         'metrics/user_metrics.cc',
         'metrics/user_metrics.h',
-        'strings/strcat.cc',
-        'strings/strcat.h',
         'task/task_scheduler/test_task_factory.cc',
         'task/task_scheduler/test_task_factory.h',
         'task/task_scheduler/test_utils.cc',
diff --git a/src/base/build_time_unittest.cc b/src/base/build_time_unittest.cc
index deac060..c3ebe88 100644
--- a/src/base/build_time_unittest.cc
+++ b/src/base/build_time_unittest.cc
@@ -6,7 +6,7 @@
 #include "base/generated_build_date.h"
 #include "base/time/time.h"
 
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 TEST(BuildTime, DateLooksValid) {
diff --git a/src/base/cpu.cc b/src/base/cpu.cc
index c786573..42ccf16 100644
--- a/src/base/cpu.cc
+++ b/src/base/cpu.cc
@@ -12,7 +12,7 @@
 
 #include "starboard/types.h"
 
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 
 #include "starboard/memory.h"
 
diff --git a/src/base/debug/activity_analyzer_unittest.cc b/src/base/debug/activity_analyzer_unittest.cc
index 38ad0f1..3dac24f 100644
--- a/src/base/debug/activity_analyzer_unittest.cc
+++ b/src/base/debug/activity_analyzer_unittest.cc
@@ -24,8 +24,8 @@
 #include "base/threading/platform_thread.h"
 #include "base/threading/simple_thread.h"
 #include "base/time/time.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace base {
diff --git a/src/base/debug/activity_tracker.cc b/src/base/debug/activity_tracker.cc
index 825a4f2..91236a7 100644
--- a/src/base/debug/activity_tracker.cc
+++ b/src/base/debug/activity_tracker.cc
@@ -26,8 +26,8 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/threading/platform_thread.h"
 #include "build/build_config.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 
 namespace base {
 namespace debug {
diff --git a/src/base/debug/stack_trace_fuchsia.cc b/src/base/debug/stack_trace_fuchsia.cc
index cf58ed5..0cc657a 100644
--- a/src/base/debug/stack_trace_fuchsia.cc
+++ b/src/base/debug/stack_trace_fuchsia.cc
@@ -19,7 +19,7 @@
 #include <iostream>
 
 #include "base/logging.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 namespace base {
diff --git a/src/base/debug/stack_trace_posix.cc b/src/base/debug/stack_trace_posix.cc
index 4d3633a..cac9539 100644
--- a/src/base/debug/stack_trace_posix.cc
+++ b/src/base/debug/stack_trace_posix.cc
@@ -52,8 +52,8 @@
 
 #if defined(USE_SYMBOLIZE)
 #include "base/third_party/symbolize/symbolize.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "starboard/types.h"
 #endif
 
diff --git a/src/base/debug/stack_trace_starboard.cc b/src/base/debug/stack_trace_starboard.cc
index e4987e7..d3169e3 100644
--- a/src/base/debug/stack_trace_starboard.cc
+++ b/src/base/debug/stack_trace_starboard.cc
@@ -17,7 +17,7 @@
 #include <algorithm>
 #include <ostream>
 
-#include "starboard/log.h"
+#include "starboard/common/log.h"
 #include "starboard/system.h"
 
 namespace base {
diff --git a/src/base/files/file.cc b/src/base/files/file.cc
index 42c31bd..21a9926 100644
--- a/src/base/files/file.cc
+++ b/src/base/files/file.cc
@@ -14,7 +14,7 @@
 #endif
 
 #if defined(OS_STARBOARD)
-#include "starboard/log.h"
+#include "starboard/common/log.h"
 #include "starboard/types.h"
 #endif
 
diff --git a/src/base/files/file_enumerator_starboard.cc b/src/base/files/file_enumerator_starboard.cc
index fd371df..1c2b3f0 100644
--- a/src/base/files/file_enumerator_starboard.cc
+++ b/src/base/files/file_enumerator_starboard.cc
@@ -16,10 +16,10 @@
 
 #include "base/files/file_util.h"
 #include "base/threading/thread_restrictions.h"
+#include "starboard/common/string.h"
 #include "starboard/directory.h"
 #include "starboard/file.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 
 namespace base {
 
diff --git a/src/base/files/file_path.cc b/src/base/files/file_path.cc
index 292a407..92b31f6 100644
--- a/src/base/files/file_path.cc
+++ b/src/base/files/file_path.cc
@@ -9,7 +9,7 @@
 
 #include "starboard/types.h"
 
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 
 #include "base/logging.h"
 #include "base/macros.h"
diff --git a/src/base/files/file_starboard.cc b/src/base/files/file_starboard.cc
index 2ac0ae7..39b11a8 100644
--- a/src/base/files/file_starboard.cc
+++ b/src/base/files/file_starboard.cc
@@ -19,8 +19,8 @@
 #include "base/files/file_path.h"
 #include "base/logging.h"
 #include "base/threading/thread_restrictions.h"
+#include "starboard/common/log.h"
 #include "starboard/file.h"
-#include "starboard/log.h"
 
 namespace base {
 
@@ -270,7 +270,7 @@
     case kSbFileErrorNotAFile:
     case kSbFileErrorNotEmpty:
     case kSbFileErrorInvalidUrl:
-#if SB_API_VERSION >= SB_FILE_ERROR_IO_API_VERSION
+#if SB_API_VERSION >= 11
     case kSbFileErrorIO:
 #endif
       // Starboard error codes are designed to match Chromium's exactly.
diff --git a/src/base/files/file_util_unittest.cc b/src/base/files/file_util_unittest.cc
index cb46e43..e9d9de1 100644
--- a/src/base/files/file_util_unittest.cc
+++ b/src/base/files/file_util_unittest.cc
@@ -66,8 +66,8 @@
 
 #if defined(OS_ANDROID)
 #include "base/android/content_uri_utils.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "starboard/types.h"
 #endif
 
diff --git a/src/base/hash_unittest.cc b/src/base/hash_unittest.cc
index 3e2990d..cc8a2ca 100644
--- a/src/base/hash_unittest.cc
+++ b/src/base/hash_unittest.cc
@@ -7,7 +7,7 @@
 #include <string>
 #include <vector>
 
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace base {
diff --git a/src/base/i18n/streaming_utf8_validator_unittest.cc b/src/base/i18n/streaming_utf8_validator_unittest.cc
index 51c243e..2c8023d 100644
--- a/src/base/i18n/streaming_utf8_validator_unittest.cc
+++ b/src/base/i18n/streaming_utf8_validator_unittest.cc
@@ -32,8 +32,8 @@
 #include "base/synchronization/lock.h"
 #include "base/task/post_task.h"
 #include "base/task/task_scheduler/task_scheduler.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "starboard/types.h"
 #include "third_party/icu/source/common/unicode/utf8.h"
 
diff --git a/src/base/json/json_parser_unittest.cc b/src/base/json/json_parser_unittest.cc
index 456d8cc..f0e8573 100644
--- a/src/base/json/json_parser_unittest.cc
+++ b/src/base/json/json_parser_unittest.cc
@@ -11,8 +11,8 @@
 #include "base/optional.h"
 #include "base/strings/stringprintf.h"
 #include "base/values.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "starboard/types.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/src/base/json/json_value_serializer_unittest.cc b/src/base/json/json_value_serializer_unittest.cc
index c7b5b84..399bbd4 100644
--- a/src/base/json/json_value_serializer_unittest.cc
+++ b/src/base/json/json_value_serializer_unittest.cc
@@ -17,7 +17,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/values.h"
 #include "build/build_config.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace base {
diff --git a/src/base/linux_util.cc b/src/base/linux_util.cc
index 27f1546..3b2701e 100644
--- a/src/base/linux_util.cc
+++ b/src/base/linux_util.cc
@@ -26,7 +26,7 @@
 #include "base/strings/string_util.h"
 #include "base/synchronization/lock.h"
 #include "build/build_config.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 namespace {
diff --git a/src/base/logging.cc b/src/base/logging.cc
index 7b2e8a1..466868e 100644
--- a/src/base/logging.cc
+++ b/src/base/logging.cc
@@ -11,9 +11,10 @@
 
 #if defined(STARBOARD)
 #include "starboard/client_porting/eztime/eztime.h"
+#include "starboard/common/log.h"
+#include "starboard/common/mutex.h"
+#include "starboard/configuration.h"
 #include "starboard/file.h"
-#include "starboard/log.h"
-#include "starboard/mutex.h"
 #include "starboard/system.h"
 #include "starboard/time.h"
 typedef SbFile FileHandle;
@@ -115,7 +116,7 @@
 
 #if defined(OS_POSIX) || defined(OS_FUCHSIA)
 #include "base/posix/safe_strerror.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 #endif
 
@@ -550,9 +551,11 @@
   g_min_log_level = std::min(LOG_FATAL, level);
 
 #if defined(STARBOARD)
+#if SB_API_VERSION < 11
   starboard::logging::SetMinLogLevel(
       LogLevelToStarboardLogPriority(std::min(LOG_FATAL, level)));
 #endif
+#endif
 }
 
 int GetMinLogLevel() {
@@ -996,8 +999,11 @@
   stream_ <<  '[';
   if (g_log_prefix)
     stream_ << g_log_prefix << ':';
+#ifndef STARBOARD
+  // Cobalt and cobalt unittests are both single thread applciation.
   if (g_log_process_id)
     stream_ << CurrentProcessId() << ':';
+#endif
   if (g_log_thread_id)
     stream_ << base::PlatformThread::CurrentId() << ':';
   if (g_log_timestamp) {
@@ -1042,8 +1048,11 @@
 #endif
 #endif
   }
+#ifndef STARBOARD
+  // Cobalt does not want tickcounts.
   if (g_log_tickcount)
     stream_ << TickCount() << ':';
+#endif
   if (severity_ >= 0)
     stream_ << log_severity_name(severity_);
   else
diff --git a/src/base/logging.h b/src/base/logging.h
index bfe1050..1c0d669 100644
--- a/src/base/logging.h
+++ b/src/base/logging.h
@@ -22,7 +22,7 @@
 #include "build/build_config.h"
 
 #if defined(STARBOARD)
-#include "starboard/log.h"
+#include "starboard/common/log.h"
 #include "starboard/system.h"
 #include "starboard/types.h"
 #endif
diff --git a/src/base/logging_win.cc b/src/base/logging_win.cc
index 15b88a7..152713a 100644
--- a/src/base/logging_win.cc
+++ b/src/base/logging_win.cc
@@ -6,7 +6,7 @@
 #include "base/memory/singleton.h"
 #include <initguid.h>  // NOLINT
 
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 namespace logging {
diff --git a/src/base/md5_unittest.cc b/src/base/md5_unittest.cc
index b63bc1d..841d7d6 100644
--- a/src/base/md5_unittest.cc
+++ b/src/base/md5_unittest.cc
@@ -9,8 +9,8 @@
 #include <memory>
 #include <string>
 
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "starboard/types.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/src/base/memory/shared_memory_helper.cc b/src/base/memory/shared_memory_helper.cc
index 9803ca3..ea1326b 100644
--- a/src/base/memory/shared_memory_helper.cc
+++ b/src/base/memory/shared_memory_helper.cc
@@ -12,8 +12,8 @@
 #endif  // defined(OS_CHROMEOS)
 
 #include "base/threading/thread_restrictions.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "starboard/types.h"
 
 namespace base {
diff --git a/src/base/message_loop/message_pump_io_starboard.cc b/src/base/message_loop/message_pump_io_starboard.cc
index f898512..cfe3955 100644
--- a/src/base/message_loop/message_pump_io_starboard.cc
+++ b/src/base/message_loop/message_pump_io_starboard.cc
@@ -21,7 +21,7 @@
 #include "base/posix/eintr_wrapper.h"
 #include "base/time/time.h"
 #include "nb/memory_scope.h"
-#include "starboard/socket.h"
+#include "starboard/common/socket.h"
 #include "starboard/socket_waiter.h"
 
 namespace base {
@@ -113,7 +113,7 @@
   DCHECK(mode == WATCH_READ || mode == WATCH_WRITE || mode == WATCH_READ_WRITE);
   // Watch should be called on the pump thread. It is not threadsafe, and your
   // watcher may never be registered.
-  DCHECK(watch_socket_caller_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(watch_socket_caller_checker_);
 
   int interests = kSbSocketWaiterInterestNone;
   if (mode & WATCH_READ) {
diff --git a/src/base/message_loop/message_pump_io_starboard.h b/src/base/message_loop/message_pump_io_starboard.h
index dff14fe..56853cc 100644
--- a/src/base/message_loop/message_pump_io_starboard.h
+++ b/src/base/message_loop/message_pump_io_starboard.h
@@ -21,7 +21,7 @@
 #include "base/observer_list.h"
 #include "base/threading/thread_checker.h"
 #include "base/time/time.h"
-#include "starboard/socket.h"
+#include "starboard/common/socket.h"
 #include "starboard/socket_waiter.h"
 
 namespace base {
@@ -168,7 +168,7 @@
   SbSocketWaiter waiter_;
 
   ObserverList<IOObserver> io_observers_;
-  ThreadChecker watch_socket_caller_checker_;
+  THREAD_CHECKER(watch_socket_caller_checker_);
   DISALLOW_COPY_AND_ASSIGN(MessagePumpIOStarboard);
 };
 
diff --git a/src/base/os_compat_android.cc b/src/base/os_compat_android.cc
index ba22766..6c533a5 100644
--- a/src/base/os_compat_android.cc
+++ b/src/base/os_compat_android.cc
@@ -19,7 +19,7 @@
 #include "base/rand_util.h"
 #include "base/strings/string_piece.h"
 #include "base/strings/stringprintf.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 extern "C" {
diff --git a/src/base/path_service_unittest.cc b/src/base/path_service_unittest.cc
index 09c09e9..2295441 100644
--- a/src/base/path_service_unittest.cc
+++ b/src/base/path_service_unittest.cc
@@ -104,6 +104,12 @@
 #endif  // defined(STARBOARD)
     EXPECT_PRED1(ReturnsValidPath, key);
   }
+#if defined(STARBOARD)
+  // In the three Starboard custom directories, DIR_CACHE should always be
+  // valid while DIR_SYSTEM_FONTS and DIR_SYSTEM_FONTS_CONFIGURATION
+  // can be invalid on some platforms.
+  EXPECT_PRED1(ReturnsValidPath, DIR_CACHE);
+#else  // STARBOARD
 #if defined(OS_WIN)
   for (int key = PATH_WIN_START + 1; key < PATH_WIN_END; ++key) {
     bool valid = true;
@@ -130,6 +136,7 @@
     EXPECT_PRED1(ReturnsValidPath, key);
   }
 #endif
+#endif  // STARBOARD
 }
 
 // Test that all versions of the Override function of PathService do what they
diff --git a/src/base/process/process_metrics_linux.cc b/src/base/process/process_metrics_linux.cc
index 3df08cc..66b45d9 100644
--- a/src/base/process/process_metrics_linux.cc
+++ b/src/base/process/process_metrics_linux.cc
@@ -26,7 +26,7 @@
 #include "base/threading/thread_restrictions.h"
 #include "build/build_config.h"
 #include "starboard/character.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 namespace base {
diff --git a/src/base/sequence_checker_impl.cc b/src/base/sequence_checker_impl.cc
index daa774b..64c5f20 100644
--- a/src/base/sequence_checker_impl.cc
+++ b/src/base/sequence_checker_impl.cc
@@ -37,14 +37,22 @@
 SequenceCheckerImpl::~SequenceCheckerImpl() = default;
 
 bool SequenceCheckerImpl::CalledOnValidSequence() const {
+#if defined(STARBOARD)
+  starboard::ScopedSpinLock lock(&members_lock_);
+#else   // defined(STARBOARD)
   AutoLock auto_lock(lock_);
+#endif  // defined(STARBOARD)
   if (!core_)
     core_ = std::make_unique<Core>();
   return core_->CalledOnValidSequence();
 }
 
 void SequenceCheckerImpl::DetachFromSequence() {
+#if defined(STARBOARD)
+  starboard::ScopedSpinLock lock(&members_lock_);
+#else   // defined(STARBOARD)
   AutoLock auto_lock(lock_);
+#endif  // defined(STARBOARD)
   core_.reset();
 }
 
diff --git a/src/base/sequence_checker_impl.h b/src/base/sequence_checker_impl.h
index a54c388..254f593 100644
--- a/src/base/sequence_checker_impl.h
+++ b/src/base/sequence_checker_impl.h
@@ -11,6 +11,7 @@
 #include "base/compiler_specific.h"
 #include "base/macros.h"
 #include "base/synchronization/lock.h"
+#include "starboard/common/spin_lock.h"
 
 namespace base {
 
@@ -36,8 +37,13 @@
  private:
   class Core;
 
+#if defined(STARBOARD)
+  // Don't use a mutex since the number of mutexes is limited on some platforms.
+  mutable SbAtomic32 members_lock_ = starboard::kSpinLockStateReleased;
+#else  // defined(STARBOARD)
   // Guards all variables below.
   mutable Lock lock_;
+#endif  // defined(STARBOARD)
   mutable std::unique_ptr<Core> core_;
 
   DISALLOW_COPY_AND_ASSIGN(SequenceCheckerImpl);
diff --git a/src/base/strings/safe_sprintf.h b/src/base/strings/safe_sprintf.h
index 24f5ae8..8d3d40a 100644
--- a/src/base/strings/safe_sprintf.h
+++ b/src/base/strings/safe_sprintf.h
@@ -15,7 +15,7 @@
 #endif
 
 #include "base/base_export.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 namespace base {
diff --git a/src/base/strings/safe_sprintf_unittest.cc b/src/base/strings/safe_sprintf_unittest.cc
index c2e4dc9..b9ebeae 100644
--- a/src/base/strings/safe_sprintf_unittest.cc
+++ b/src/base/strings/safe_sprintf_unittest.cc
@@ -13,8 +13,8 @@
 #include "base/logging.h"
 #include "base/macros.h"
 #include "build/build_config.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "starboard/types.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/src/base/strings/string_number_conversions.cc b/src/base/strings/string_number_conversions.cc
index 9193df8..05d2b98 100644
--- a/src/base/strings/string_number_conversions.cc
+++ b/src/base/strings/string_number_conversions.cc
@@ -18,7 +18,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/third_party/dmg_fp/dmg_fp.h"
 #include "starboard/character.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 namespace base {
diff --git a/src/base/strings/string_util_starboard.h b/src/base/strings/string_util_starboard.h
index 6ec7d98..65cbc77 100644
--- a/src/base/strings/string_util_starboard.h
+++ b/src/base/strings/string_util_starboard.h
@@ -19,8 +19,8 @@
 
 #include "base/logging.h"
 #include "base/strings/string_util.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "starboard/types.h"
 
 namespace base {
diff --git a/src/base/strings/string_util_unittest.cc b/src/base/strings/string_util_unittest.cc
index 60cc3a3..e9105ea 100644
--- a/src/base/strings/string_util_unittest.cc
+++ b/src/base/strings/string_util_unittest.cc
@@ -13,8 +13,8 @@
 #include "base/strings/string16.h"
 #include "base/strings/utf_string_conversions.h"
 #include "starboard/client_porting/poem/string_poem.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "starboard/types.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/src/base/strings/stringprintf_unittest.cc b/src/base/strings/stringprintf_unittest.cc
index c9f066a..ad617ed 100644
--- a/src/base/strings/stringprintf_unittest.cc
+++ b/src/base/strings/stringprintf_unittest.cc
@@ -11,7 +11,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 
 #if defined(STARBOARD)
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 #endif
 
diff --git a/src/base/strings/utf_string_conversions_unittest.cc b/src/base/strings/utf_string_conversions_unittest.cc
index f02281a..0dfd72f 100644
--- a/src/base/strings/utf_string_conversions_unittest.cc
+++ b/src/base/strings/utf_string_conversions_unittest.cc
@@ -8,8 +8,8 @@
 #include "base/strings/string_piece.h"
 #include "base/strings/string_util.h"
 #include "build/build_config.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "starboard/types.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/src/base/synchronization/condition_variable_starboard.cc b/src/base/synchronization/condition_variable_starboard.cc
index 69d4513..5443cb6 100644
--- a/src/base/synchronization/condition_variable_starboard.cc
+++ b/src/base/synchronization/condition_variable_starboard.cc
@@ -18,8 +18,8 @@
 #include "base/synchronization/lock.h"
 #include "base/threading/scoped_blocking_call.h"
 #include "base/time/time.h"
-#include "starboard/condition_variable.h"
-#include "starboard/mutex.h"
+#include "starboard/common/condition_variable.h"
+#include "starboard/common/mutex.h"
 
 namespace base {
 
diff --git a/src/base/synchronization/lock_impl.h b/src/base/synchronization/lock_impl.h
index 8b0079b..ce55c90 100644
--- a/src/base/synchronization/lock_impl.h
+++ b/src/base/synchronization/lock_impl.h
@@ -11,7 +11,7 @@
 #include "build/build_config.h"
 
 #if defined(STARBOARD)
-#include "starboard/mutex.h"
+#include "starboard/common/mutex.h"
 #else
 #if defined(OS_WIN)
 #include "base/win/windows_types.h"
diff --git a/src/base/synchronization/lock_impl_starboard.cc b/src/base/synchronization/lock_impl_starboard.cc
index f6eefd1..ac59b21 100644
--- a/src/base/synchronization/lock_impl_starboard.cc
+++ b/src/base/synchronization/lock_impl_starboard.cc
@@ -15,7 +15,7 @@
 #include "base/synchronization/lock_impl.h"
 
 #include "base/logging.h"
-#include "starboard/mutex.h"
+#include "starboard/common/mutex.h"
 
 namespace base {
 namespace internal {
diff --git a/src/base/sys_info_linux.cc b/src/base/sys_info_linux.cc
index 6b03e45..55cffc3 100644
--- a/src/base/sys_info_linux.cc
+++ b/src/base/sys_info_linux.cc
@@ -15,7 +15,7 @@
 #include "base/strings/string_util.h"
 #include "base/sys_info_internal.h"
 #include "build/build_config.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 namespace {
diff --git a/src/base/task/task_scheduler/scheduler_worker_pool_impl.cc b/src/base/task/task_scheduler/scheduler_worker_pool_impl.cc
index 901a989..02454ed 100644
--- a/src/base/task/task_scheduler/scheduler_worker_pool_impl.cc
+++ b/src/base/task/task_scheduler/scheduler_worker_pool_impl.cc
@@ -49,10 +49,8 @@
 constexpr char kNumTasksBetweenWaitsHistogramPrefix[] =
     "TaskScheduler.NumTasksBetweenWaits.";
 constexpr char kNumThreadsHistogramPrefix[] = "TaskScheduler.NumWorkers.";
-#ifdef STARBOARDD
-// Devices like Raspberry Pi are unalbe to create 256 threads at once.
-// SbThreadCreate will fail after too many threads are created.
-constexpr size_t kMaxNumberOfWorkers = 128;
+#ifdef STARBOARD
+constexpr size_t kMaxNumberOfWorkers = SB_MAX_THREADS;
 #else
 constexpr size_t kMaxNumberOfWorkers = 256;
 #endif
diff --git a/src/base/task/task_scheduler/scheduler_worker_pool_impl_unittest.cc b/src/base/task/task_scheduler/scheduler_worker_pool_impl_unittest.cc
index d983934..0fad634 100644
--- a/src/base/task/task_scheduler/scheduler_worker_pool_impl_unittest.cc
+++ b/src/base/task/task_scheduler/scheduler_worker_pool_impl_unittest.cc
@@ -1414,9 +1414,8 @@
 // Verify that the maximum number of workers is 256 and that hitting the max
 // leaves the pool in a valid state with regards to max tasks.
 TEST_F(TaskSchedulerWorkerPoolBlockingTest, MaximumWorkersTest) {
-#ifdef STARBOARDD
-  // Devices like Raspberry Pi is unalbe to create 256 threads at once.
-  constexpr size_t kMaxNumberOfWorkers = 128;
+#ifdef STARBOARD
+  constexpr size_t kMaxNumberOfWorkers = SB_MAX_THREADS;
 #else
   constexpr size_t kMaxNumberOfWorkers = 256;
 #endif
@@ -1665,9 +1664,8 @@
 // Verify that worker detachement doesn't race with worker cleanup, regression
 // test for https://crbug.com/810464.
 TEST_F(TaskSchedulerWorkerPoolImplStartInBodyTest, RacyCleanup) {
-#ifdef STARBOARDD
-  // Devices like Raspberry Pi is unalbe to create 256 threads at once.
-  constexpr size_t kLocalMaxTasks = 128;
+#ifdef STARBOARD
+  constexpr size_t kLocalMaxTasks = SB_MAX_THREADS;
 #else
 #if defined(OS_FUCHSIA)
   // Fuchsia + QEMU doesn't deal well with *many* threads being
diff --git a/src/base/task/task_scheduler/scheduler_worker_unittest.cc b/src/base/task/task_scheduler/scheduler_worker_unittest.cc
index a3ce382..2bd951a 100644
--- a/src/base/task/task_scheduler/scheduler_worker_unittest.cc
+++ b/src/base/task/task_scheduler/scheduler_worker_unittest.cc
@@ -791,7 +791,7 @@
   }
 
   void OnMainExit(SchedulerWorker* worker) override {
-    EXPECT_CALL(*observer_, OnSchedulerWorkerMainExit());
+    observer_->AllowCallsOnMainExit(1);
   }
 
  private:
diff --git a/src/base/task/task_scheduler/task_scheduler_impl_unittest.cc b/src/base/task/task_scheduler/task_scheduler_impl_unittest.cc
index 14a2dfd..a516894 100644
--- a/src/base/task/task_scheduler/task_scheduler_impl_unittest.cc
+++ b/src/base/task/task_scheduler/task_scheduler_impl_unittest.cc
@@ -238,19 +238,17 @@
     scheduler_worker_observer_ = scheduler_worker_observer;
   }
 
-  void StartTaskScheduler() {
-    constexpr TimeDelta kSuggestedReclaimTime = TimeDelta::FromSeconds(30);
+  void StartTaskScheduler(TimeDelta reclaim_time = TimeDelta::FromSeconds(30)) {
     constexpr int kMaxNumBackgroundThreads = 1;
     constexpr int kMaxNumBackgroundBlockingThreads = 3;
     constexpr int kMaxNumForegroundThreads = 4;
     constexpr int kMaxNumForegroundBlockingThreads = 12;
 
-    scheduler_.Start(
-        {{kMaxNumBackgroundThreads, kSuggestedReclaimTime},
-         {kMaxNumBackgroundBlockingThreads, kSuggestedReclaimTime},
-         {kMaxNumForegroundThreads, kSuggestedReclaimTime},
-         {kMaxNumForegroundBlockingThreads, kSuggestedReclaimTime}},
-        scheduler_worker_observer_);
+    scheduler_.Start({{kMaxNumBackgroundThreads, reclaim_time},
+                      {kMaxNumBackgroundBlockingThreads, reclaim_time},
+                      {kMaxNumForegroundThreads, reclaim_time},
+                      {kMaxNumForegroundBlockingThreads, reclaim_time}},
+                     scheduler_worker_observer_);
   }
 
   void TearDown() override {
@@ -778,33 +776,29 @@
 }
 #endif  // STARBOARD
 
-// This is a flaky test. The scheduler workers with SHARED thread mode will
-// be joined on exit but those with DEDICATED thread mode will only have its
-// exit conditional event signaled and therefore will exit
-// asynchronously and this test does not have any logic to ensure that
-// all the scheduler workers running on dedicated threads exit before
-// the test finishes.
-#if !defined(STARBOARD)
 TEST_F(TaskSchedulerImplTest, SchedulerWorkerObserver) {
   testing::StrictMock<test::MockSchedulerWorkerObserver> observer;
   set_scheduler_worker_observer(&observer);
 
-  // A worker should be created for each pool. After that, 8 threads should be
-  // created for single-threaded work (16 on Windows).
+  // A worker should be created for each pool. After that, 4 threads should be
+  // created for each SingleThreadTaskRunnerThreadMode (8 on Windows).
   const int kExpectedNumPoolWorkers =
       CanUseBackgroundPriorityForSchedulerWorker() ? 4 : 2;
 #if defined(OS_WIN)
-  const int kExpectedNumSingleThreadedWorkers = 16;
+  const int kExpectedNumSingleThreadedWorkersPerMode = 8;
 #else
-  const int kExpectedNumSingleThreadedWorkers = 8;
+  const int kExpectedNumSingleThreadedWorkersPerMode = 4;
 #endif
-  const int kExpectedNumWorkers =
-      kExpectedNumPoolWorkers + kExpectedNumSingleThreadedWorkers;
+  constexpr int kNumSingleThreadTaskRunnerThreadModes = 2;
 
   EXPECT_CALL(observer, OnSchedulerWorkerMainEntry())
-      .Times(kExpectedNumWorkers);
+      .Times(kExpectedNumPoolWorkers +
+             kNumSingleThreadTaskRunnerThreadModes *
+                 kExpectedNumSingleThreadedWorkersPerMode);
 
-  StartTaskScheduler();
+  // Infinite detach time to prevent workers from invoking
+  // OnSchedulerWorkerMainExit() earlier than expected.
+  StartTaskScheduler(TimeDelta::Max());
 
   std::vector<scoped_refptr<SingleThreadTaskRunner>> task_runners;
 
@@ -861,14 +855,19 @@
   for (auto& task_runner : task_runners)
     task_runner->PostTask(FROM_HERE, DoNothing());
 
-  EXPECT_CALL(observer, OnSchedulerWorkerMainExit()).Times(kExpectedNumWorkers);
-
-  // Allow single-threaded workers to be released.
+  // Release single-threaded workers. This should cause dedicated workers to
+  // invoke OnSchedulerWorkerMainExit().
+  observer.AllowCallsOnMainExit(kExpectedNumSingleThreadedWorkersPerMode);
   task_runners.clear();
+  observer.WaitCallsOnMainExit();
 
+  // Join all remaining workers. This should cause shared single-threaded
+  // workers and pool workers to invoke OnSchedulerWorkerMainExit().
+  observer.AllowCallsOnMainExit(kExpectedNumPoolWorkers +
+                                kExpectedNumSingleThreadedWorkersPerMode);
   TearDown();
+  observer.WaitCallsOnMainExit();
 }
-#endif
 
 }  // namespace internal
 }  // namespace base
diff --git a/src/base/task/task_scheduler/test_utils.cc b/src/base/task/task_scheduler/test_utils.cc
index e1c82b6..ea1fe7d 100644
--- a/src/base/task/task_scheduler/test_utils.cc
+++ b/src/base/task/task_scheduler/test_utils.cc
@@ -6,15 +6,43 @@
 
 #include <utility>
 
+#include "base/bind.h"
+#include "base/synchronization/condition_variable.h"
 #include "base/task/task_scheduler/scheduler_worker_pool.h"
+#include "base/threading/scoped_blocking_call.h"
+#include "base/threading/thread_restrictions.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace base {
 namespace internal {
 namespace test {
 
-MockSchedulerWorkerObserver::MockSchedulerWorkerObserver() = default;
-MockSchedulerWorkerObserver::~MockSchedulerWorkerObserver() = default;
+MockSchedulerWorkerObserver::MockSchedulerWorkerObserver()
+    : on_main_exit_cv_(lock_.CreateConditionVariable()) {}
+
+MockSchedulerWorkerObserver::~MockSchedulerWorkerObserver() {
+  WaitCallsOnMainExit();
+}
+
+void MockSchedulerWorkerObserver::AllowCallsOnMainExit(int num_calls) {
+  AutoSchedulerLock auto_lock(lock_);
+  EXPECT_EQ(0, allowed_calls_on_main_exit_);
+  allowed_calls_on_main_exit_ = num_calls;
+}
+
+void MockSchedulerWorkerObserver::WaitCallsOnMainExit() {
+  AutoSchedulerLock auto_lock(lock_);
+  while (allowed_calls_on_main_exit_ != 0)
+    on_main_exit_cv_->Wait();
+}
+
+void MockSchedulerWorkerObserver::OnSchedulerWorkerMainExit() {
+  AutoSchedulerLock auto_lock(lock_);
+  EXPECT_GE(allowed_calls_on_main_exit_, 0);
+  --allowed_calls_on_main_exit_;
+  if (allowed_calls_on_main_exit_ == 0)
+    on_main_exit_cv_->Signal();
+}
 
 scoped_refptr<Sequence> CreateSequenceWithTask(Task task,
                                                const TaskTraits& traits) {
diff --git a/src/base/task/task_scheduler/test_utils.h b/src/base/task/task_scheduler/test_utils.h
index 30ef299..629e83c 100644
--- a/src/base/task/task_scheduler/test_utils.h
+++ b/src/base/task/task_scheduler/test_utils.h
@@ -5,7 +5,8 @@
 #ifndef BASE_TASK_TASK_SCHEDULER_TEST_UTILS_H_
 #define BASE_TASK_TASK_SCHEDULER_TEST_UTILS_H_
 
-#include "base/memory/ref_counted.h"
+#include "base/task/task_scheduler/delayed_task_manager.h"
+#include "base/task/task_scheduler/scheduler_lock.h"
 #include "base/task/task_scheduler/scheduler_worker_observer.h"
 #include "base/task/task_scheduler/sequence.h"
 #include "base/task/task_traits.h"
@@ -25,10 +26,20 @@
   MockSchedulerWorkerObserver();
   ~MockSchedulerWorkerObserver();
 
+  void AllowCallsOnMainExit(int num_calls);
+  void WaitCallsOnMainExit();
+
+  // SchedulerWorkerObserver:
   MOCK_METHOD0(OnSchedulerWorkerMainEntry, void());
-  MOCK_METHOD0(OnSchedulerWorkerMainExit, void());
+  // This doesn't use MOCK_METHOD0 because some tests need to wait for all calls
+  // to happen, which isn't possible with gmock.
+  void OnSchedulerWorkerMainExit() override;
 
  private:
+  SchedulerLock lock_;
+  std::unique_ptr<ConditionVariable> on_main_exit_cv_;
+  int allowed_calls_on_main_exit_ = 0;
+
   DISALLOW_COPY_AND_ASSIGN(MockSchedulerWorkerObserver);
 };
 
diff --git a/src/base/test/generate_fontconfig_caches.cc b/src/base/test/generate_fontconfig_caches.cc
index 6248d6d..2a4a2ec 100644
--- a/src/base/test/generate_fontconfig_caches.cc
+++ b/src/base/test/generate_fontconfig_caches.cc
@@ -14,7 +14,7 @@
 #include "base/path_service.h"
 #include "base/strings/strcat.h"
 #include "base/test/fontconfig_util_linux.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 // GIANT WARNING: The point of this file is to front-load construction of the
diff --git a/src/base/test/test_child_process.cc b/src/base/test/test_child_process.cc
index 0f7c8b4..3beac5b 100644
--- a/src/base/test/test_child_process.cc
+++ b/src/base/test/test_child_process.cc
@@ -6,7 +6,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 // Simple testing command, used to exercise child process launcher calls.
diff --git a/src/base/test/trace_to_file.cc b/src/base/test/trace_to_file.cc
index 255e3b6..7f66784 100644
--- a/src/base/test/trace_to_file.cc
+++ b/src/base/test/trace_to_file.cc
@@ -12,7 +12,7 @@
 #include "base/run_loop.h"
 #include "base/trace_event/trace_buffer.h"
 #include "base/trace_event/trace_log.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 
 namespace base {
 namespace test {
diff --git a/src/base/third_party/dmg_fp/dtoa.cc b/src/base/third_party/dmg_fp/dtoa.cc
index a020b3a..e7d697c 100644
--- a/src/base/third_party/dmg_fp/dtoa.cc
+++ b/src/base/third_party/dmg_fp/dtoa.cc
@@ -300,8 +300,8 @@
 
 #ifndef __MATH_H__
 #include "math.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "starboard/types.h"
 #endif
 
diff --git a/src/base/threading/thread_checker_impl.cc b/src/base/threading/thread_checker_impl.cc
index d5ccbdb..e3bc8be 100644
--- a/src/base/threading/thread_checker_impl.cc
+++ b/src/base/threading/thread_checker_impl.cc
@@ -7,16 +7,23 @@
 #include "base/threading/thread_task_runner_handle.h"
 
 namespace base {
-
 ThreadCheckerImpl::ThreadCheckerImpl() {
+#if defined(STARBOARD)
+  starboard::ScopedSpinLock lock(&members_lock_);
+#else   // defined(STARBOARD)
   AutoLock auto_lock(lock_);
+#endif  // defined(STARBOARD)
   EnsureAssigned();
 }
 
 ThreadCheckerImpl::~ThreadCheckerImpl() = default;
 
 bool ThreadCheckerImpl::CalledOnValidThread() const {
+#if defined(STARBOARD)
+  starboard::ScopedSpinLock lock(&members_lock_);
+#else   // defined(STARBOARD)
   AutoLock auto_lock(lock_);
+#endif  // defined(STARBOARD)
   EnsureAssigned();
 
   // Always return true when called from the task from which this
@@ -38,14 +45,22 @@
 }
 
 void ThreadCheckerImpl::DetachFromThread() {
+#if defined(STARBOARD)
+  starboard::ScopedSpinLock lock(&members_lock_);
+#else   // defined(STARBOARD)
   AutoLock auto_lock(lock_);
+#endif  // defined(STARBOARD)
   thread_id_ = PlatformThreadRef();
   task_token_ = TaskToken();
   sequence_token_ = SequenceToken();
 }
 
 void ThreadCheckerImpl::EnsureAssigned() const {
+#if defined(STARBOARD)
+  SB_DCHECK(members_lock_ == starboard::kSpinLockStateAcquired);
+#else   // defined(STARBOARD)
   lock_.AssertAcquired();
+#endif  // defined(STARBOARD)
   if (!thread_id_.is_null())
     return;
 
diff --git a/src/base/threading/thread_checker_impl.h b/src/base/threading/thread_checker_impl.h
index 103dfe7..b871ad8 100644
--- a/src/base/threading/thread_checker_impl.h
+++ b/src/base/threading/thread_checker_impl.h
@@ -10,6 +10,7 @@
 #include "base/sequence_token.h"
 #include "base/synchronization/lock.h"
 #include "base/threading/platform_thread.h"
+#include "starboard/common/spin_lock.h"
 
 namespace base {
 
@@ -36,8 +37,13 @@
 
   // Members are mutable so that CalledOnValidThread() can set them.
 
+#if defined(STARBOARD)
+  // Don't use a mutex since the number of mutexes is limited on some platforms.
+  mutable SbAtomic32 members_lock_ = starboard::kSpinLockStateReleased;
+#else   // defined(STARBOARD)
   // Synchronizes access to all members.
   mutable base::Lock lock_;
+#endif  // defined(STARBOARD)
 
   // Thread on which CalledOnValidThread() may return true.
   mutable PlatformThreadRef thread_id_;
diff --git a/src/base/time/time_now_starboard.cc b/src/base/time/time_now_starboard.cc
index 4f19045..f876e9c 100644
--- a/src/base/time/time_now_starboard.cc
+++ b/src/base/time/time_now_starboard.cc
@@ -20,7 +20,7 @@
 #include "build/build_config.h"
 
 #include "starboard/client_porting/poem/eztime_poem.h"
-#include "starboard/log.h"
+#include "starboard/common/log.h"
 #include "starboard/time.h"
 #include "starboard/types.h"
 
diff --git a/src/base/trace_event/blame_context.cc b/src/base/trace_event/blame_context.cc
index c5f9acd..fdde1ac 100644
--- a/src/base/trace_event/blame_context.cc
+++ b/src/base/trace_event/blame_context.cc
@@ -8,7 +8,7 @@
 #include "base/trace_event/trace_event.h"
 #include "base/trace_event/trace_event_argument.h"
 
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 
 namespace base {
 namespace trace_event {
diff --git a/src/base/trace_event/category_registry.cc b/src/base/trace_event/category_registry.cc
index 6a2bf27..6b5abd9 100644
--- a/src/base/trace_event/category_registry.cc
+++ b/src/base/trace_event/category_registry.cc
@@ -13,8 +13,8 @@
 #include "base/logging.h"
 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
 #include "base/trace_event/trace_category.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
-#include "starboard/string.h"
 
 namespace base {
 namespace trace_event {
diff --git a/src/base/trace_event/heap_profiler_allocation_context_tracker.cc b/src/base/trace_event/heap_profiler_allocation_context_tracker.cc
index 8903cea..45ee149 100644
--- a/src/base/trace_event/heap_profiler_allocation_context_tracker.cc
+++ b/src/base/trace_event/heap_profiler_allocation_context_tracker.cc
@@ -7,7 +7,7 @@
 #include <algorithm>
 #include <iterator>
 
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 #include "base/atomicops.h"
diff --git a/src/base/trace_event/memory_dump_manager.cc b/src/base/trace_event/memory_dump_manager.cc
index fe9f87c..6e317a3 100644
--- a/src/base/trace_event/memory_dump_manager.cc
+++ b/src/base/trace_event/memory_dump_manager.cc
@@ -40,7 +40,7 @@
 
 #if BUILDFLAG(CAN_UNWIND_WITH_CFI_TABLE)
 #include "base/trace_event/cfi_backtrace_android.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 #endif
 
diff --git a/src/base/trace_event/memory_infra_background_whitelist.cc b/src/base/trace_event/memory_infra_background_whitelist.cc
index e96c430..19bfe83 100644
--- a/src/base/trace_event/memory_infra_background_whitelist.cc
+++ b/src/base/trace_event/memory_infra_background_whitelist.cc
@@ -10,7 +10,7 @@
 #include <string>
 
 #include "base/strings/string_util.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 namespace base {
diff --git a/src/base/trace_event/trace_config_category_filter.cc b/src/base/trace_event/trace_config_category_filter.cc
index a9d96bf..16c3da5 100644
--- a/src/base/trace_event/trace_config_category_filter.cc
+++ b/src/base/trace_event/trace_config_category_filter.cc
@@ -11,7 +11,7 @@
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/trace_event/trace_event.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 
 namespace base {
 namespace trace_event {
diff --git a/src/base/trace_event/trace_event_impl.cc b/src/base/trace_event/trace_event_impl.cc
index 712dd5f..3fb61b8 100644
--- a/src/base/trace_event/trace_event_impl.cc
+++ b/src/base/trace_event/trace_event_impl.cc
@@ -16,8 +16,8 @@
 #include "base/trace_event/trace_event.h"
 #include "base/trace_event/trace_event_argument.h"
 #include "base/trace_event/trace_log.h"
+#include "starboard/common/string.h"
 #include "starboard/memory.h"
-#include "starboard/string.h"
 #include "starboard/types.h"
 
 namespace base {
diff --git a/src/cobalt/CHANGELOG.md b/src/cobalt/CHANGELOG.md
index 0c37b7a..6f368aa 100644
--- a/src/cobalt/CHANGELOG.md
+++ b/src/cobalt/CHANGELOG.md
@@ -29,6 +29,22 @@
    `UNREFERENCED_PARAMETER` has been removed, but `SB_UNREFERENCED_PARAMETER`
    will continue to be supported.
 
+ - **MediaSession actions and action details have changed to match the spec**
+
+   MediaSession now uses the newly specified `seekto` action instead of the
+   Cobalt 19 `seek` action, which has been removed. Also added `skipad` and
+   `stop` to the recognized actions, but the web app may not handle them yet.
+   The `MediaSessionClient` now uses a generated POD class for the IDL
+   `MediaSessionActionDetails` dictionary rather than an inner `Data` class when
+   invoking actions. (see: https://wicg.github.io/mediasession)
+
+- **MediaSession supports setPositionState() function**
+
+  MediaSession now supports the newly specified `setPositionState()` function.
+  `MediaSessionClient` now provides an immutable `MediaSessionState` object
+  that may be copied and queried on any thread to get a coherent view of
+  attributes set by the the web app on the `MediaSession`.
+
 ## Version 19
  - **Add support for V8 JavaScript Engine**
 
diff --git a/src/cobalt/audio/audio_buffer_source_node.cc b/src/cobalt/audio/audio_buffer_source_node.cc
index 7848974..8481b6b 100644
--- a/src/cobalt/audio/audio_buffer_source_node.cc
+++ b/src/cobalt/audio/audio_buffer_source_node.cc
@@ -36,7 +36,8 @@
       task_runner_(base::MessageLoop::current()->task_runner()),
       state_(kNone),
       read_index_(0),
-      buffer_source_added_(false) {
+      buffer_source_added_(false),
+      sample_rate_(context->sample_rate()) {
   AudioLock::AutoLock lock(audio_lock());
 
   AddOutput(new AudioNodeOutput(this));
@@ -55,10 +56,10 @@
 
   buffer_ = buffer;
 
-  if (buffer_->sample_rate() != context()->sample_rate()) {
+  if (buffer_->sample_rate() != sample_rate_) {
     interleaved_resampler_ =
         std::unique_ptr<InterleavedSincResampler>(new InterleavedSincResampler(
-            buffer_->sample_rate() / context()->sample_rate(),
+            buffer_->sample_rate() / sample_rate_,
             static_cast<int32>(buffer_->audio_bus()->channels())));
   }
 
@@ -175,8 +176,8 @@
 
   // Queue frames.
   while (!interleaved_resampler_->HasEnoughData(number_of_frames)) {
-    int32 frames_to_queue = static_cast<int32>(ceil(
-        number_of_frames * buffer_->sample_rate() / context()->sample_rate()));
+    int32 frames_to_queue = static_cast<int32>(
+        ceil(number_of_frames * buffer_->sample_rate() / sample_rate_));
 
     frames_to_queue = std::min(frames_to_queue, frames_to_end);
 
diff --git a/src/cobalt/audio/audio_buffer_source_node.h b/src/cobalt/audio/audio_buffer_source_node.h
index 008d56c..a3623e0 100644
--- a/src/cobalt/audio/audio_buffer_source_node.h
+++ b/src/cobalt/audio/audio_buffer_source_node.h
@@ -109,6 +109,8 @@
   // has been added to AudioContext's |buffer_sources_|
   bool buffer_source_added_;
 
+  const float sample_rate_;
+
   DISALLOW_COPY_AND_ASSIGN(AudioBufferSourceNode);
 };
 
diff --git a/src/cobalt/audio/audio_context.h b/src/cobalt/audio/audio_context.h
index edf1a35..26f8994 100644
--- a/src/cobalt/audio/audio_context.h
+++ b/src/cobalt/audio/audio_context.h
@@ -200,7 +200,7 @@
   // associate the WeakPtr with the constructing thread.
   base::WeakPtr<AudioContext> weak_this_;
 
-  float sample_rate_;
+  const float sample_rate_;
   double current_time_;
 
   scoped_refptr<AudioLock> audio_lock_;
diff --git a/src/cobalt/audio/audio_device.cc b/src/cobalt/audio/audio_device.cc
index 6a70fd7..73f91bc 100644
--- a/src/cobalt/audio/audio_device.cc
+++ b/src/cobalt/audio/audio_device.cc
@@ -202,7 +202,8 @@
   }
 
   *offset_in_frames = frames_consumed_ % kFramesPerChannel;
-  *is_playing = (frames_rendered_ != frames_consumed_);
+  *is_playing =
+      !(silence_written_ != 0 && *frames_in_buffer <= silence_written_);
 }
 
 void AudioDevice::Impl::ConsumeFrames(int frames_consumed) {
diff --git a/src/cobalt/audio/audio_node.cc b/src/cobalt/audio/audio_node.cc
index 0fd809c..756f0ec 100644
--- a/src/cobalt/audio/audio_node.cc
+++ b/src/cobalt/audio/audio_node.cc
@@ -28,6 +28,7 @@
       channel_interpretation_(kAudioNodeChannelInterpretationSpeakers) {}
 
 AudioNode::~AudioNode() {
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   AudioLock::AutoLock lock(audio_lock());
 
   RemoveAllInputs();
@@ -35,6 +36,7 @@
 }
 
 scoped_refptr<AudioContext> AudioNode::context() const {
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   return audio_context_;
 }
 
diff --git a/src/cobalt/audio/audio_node.h b/src/cobalt/audio/audio_node.h
index a2774ec..4374112 100644
--- a/src/cobalt/audio/audio_node.h
+++ b/src/cobalt/audio/audio_node.h
@@ -19,6 +19,7 @@
 #include <string>
 #include <vector>
 
+#include "base/threading/thread_checker.h"
 #include "cobalt/audio/audio_helpers.h"
 #include "cobalt/audio/audio_node_channel_count_mode.h"
 #include "cobalt/audio/audio_node_channel_interpretation.h"
@@ -54,7 +55,8 @@
 
   // Web API: AudioNode
   //
-  // The AudioContext which owns this AudioNode.
+  // The AudioContext which owns this AudioNode. This function may only be
+  // called on the MainWebModule thread.
   scoped_refptr<AudioContext> context() const;
 
   // The number of inputs feeding into the AudioNode. For source nodes, this
@@ -145,6 +147,7 @@
   AudioNodeChannelCountMode channel_count_mode_;
   AudioNodeChannelInterpretation channel_interpretation_;
 
+  THREAD_CHECKER(thread_checker_);
   DISALLOW_COPY_AND_ASSIGN(AudioNode);
 };
 
diff --git a/src/cobalt/base/base.gyp b/src/cobalt/base/base.gyp
index 3823214..a34c59f 100644
--- a/src/cobalt/base/base.gyp
+++ b/src/cobalt/base/base.gyp
@@ -80,8 +80,6 @@
         'unicode/character.h',
         'unicode/character_values.h',
         'unused.h',
-        'user_log.cc',
-        'user_log.h',
         'version_compatibility.cc',
         'version_compatibility.h',
       ],
diff --git a/src/cobalt/base/localized_strings.cc b/src/cobalt/base/localized_strings.cc
index 8c8beb6..1d44ba7 100644
--- a/src/cobalt/base/localized_strings.cc
+++ b/src/cobalt/base/localized_strings.cc
@@ -17,8 +17,8 @@
 #include <algorithm>
 
 #include "base/logging.h"
+#include "starboard/common/log.h"
 #include "starboard/file.h"
-#include "starboard/log.h"
 #include "starboard/system.h"
 #include "starboard/types.h"
 
diff --git a/src/cobalt/base/token.h b/src/cobalt/base/token.h
index a93ab68..e2621a1 100644
--- a/src/cobalt/base/token.h
+++ b/src/cobalt/base/token.h
@@ -21,7 +21,7 @@
 #include "base/basictypes.h"
 #include "base/containers/hash_tables.h"
 #include "base/logging.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 
 namespace base {
 
diff --git a/src/cobalt/base/token_test.cc b/src/cobalt/base/token_test.cc
index a319543..ec1035c 100644
--- a/src/cobalt/base/token_test.cc
+++ b/src/cobalt/base/token_test.cc
@@ -20,7 +20,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 
 #include "base/logging.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 
 namespace base {
 namespace {
diff --git a/src/cobalt/base/user_log.cc b/src/cobalt/base/user_log.cc
deleted file mode 100644
index 01bc441..0000000
--- a/src/cobalt/base/user_log.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2016 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "cobalt/base/user_log.h"
-
-#include "base/logging.h"
-
-namespace base {
-namespace {
-
-// The max size of the label is 15 ASCII characters, plus a NULL character.
-const int kMaxLabelSize = 16;
-
-}  // namespace
-
-// static
-bool UserLog::IsRegistrationSupported() {
-  // TODO: Reimplement with starboard core dump
-  NOTIMPLEMENTED();
-  return false;
-}
-
-// static
-bool UserLog::Register(Index index, const char* label, const void* address,
-                       size_t size) {
-  DCHECK_LT(strlen(label), kMaxLabelSize);
-  NOTIMPLEMENTED();
-  return true;
-}
-
-bool UserLog::Deregister(Index index) {
-  NOTIMPLEMENTED();
-  return true;
-}
-
-}  // namespace base
diff --git a/src/cobalt/base/user_log.h b/src/cobalt/base/user_log.h
deleted file mode 100644
index 9b4fd18..0000000
--- a/src/cobalt/base/user_log.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2016 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef COBALT_BASE_USER_LOG_H_
-#define COBALT_BASE_USER_LOG_H_
-
-#include "base/basictypes.h"
-
-namespace base {
-
-class UserLog {
- public:
-  static const int kEventStackMaxDepth = 10;
-  enum Index {
-    kUserAgentStringIndex = 0,
-    kSystemLanguageStringIndex,
-    kAvailableMemoryIndex,
-    kAppLifetimeIndex,
-    kAppStatusIndex,
-    kAppSuspendCountIndex,
-    kAppResumeCountIndex,
-    kAppPauseCountIndex,
-    kAppUnpauseCountIndex,
-    kNetworkStatusIndex,
-    kNetworkConnectCountIndex,
-    kNetworkDisconnectCountIndex,
-    kWebMediaPlayerState,
-    kNodeCountIndex,
-    kElementCountIndex,
-    kHtmlElementCountIndex,
-    kHTMLMediaElementCountIndex,
-    kEventStackLevelCountIndex,
-    kEventStackMinLevelIndex,
-    kEventStackMaxLevelIndex =
-        kEventStackMinLevelIndex + kEventStackMaxDepth - 1,
-    // Valid indices are from [0, 127].
-    kMaxIndex = 128,
-  };
-
-  static bool IsRegistrationSupported();
-
-  // Thread-safe registration of a user log index, associating it with the
-  // specified label and memory address. This is used by some platforms to
-  // provide additional context with crashes.
-  //
-  // Returns true if the registration is successful.
-  //
-  // NOTE: The max size of the label is 15 ASCII characters, plus a NULL
-  // character.
-  static bool Register(Index index, const char* label, const void* address,
-                       size_t size);
-
-  // Deregister the given Index so that it is not included in the crash report.
-  static bool Deregister(Index index);
-};
-
-}  // namespace base
-
-#endif  // COBALT_BASE_USER_LOG_H_
diff --git a/src/cobalt/base/wrap_main_starboard.h b/src/cobalt/base/wrap_main_starboard.h
index ddfd4ce..4dfa576 100644
--- a/src/cobalt/base/wrap_main_starboard.h
+++ b/src/cobalt/base/wrap_main_starboard.h
@@ -36,7 +36,6 @@
   static base::MessageLoopForUI* g_loop = NULL;
   static bool g_started = false;
   switch (event->type) {
-#if SB_API_VERSION >= 6
     case kSbEventTypePreload: {
       SbEventStartData* data = static_cast<SbEventStartData*>(event->data);
 
@@ -54,7 +53,6 @@
       g_started = true;
       break;
     }
-#endif  // SB_API_VERSION >= 6
     case kSbEventTypeStart: {
       SbEventStartData* data = static_cast<SbEventStartData*>(event->data);
 
@@ -99,15 +97,13 @@
     case kSbEventTypeUser:
     case kSbEventTypeLink:
     case kSbEventTypeVerticalSync:
-#if SB_API_VERSION < SB_DEPRECATE_DISCONNECT_VERSION
+#if SB_API_VERSION < 11
     case kSbEventTypeNetworkDisconnect:
     case kSbEventTypeNetworkConnect:
-#endif  // SB_API_VERSION < SB_DEPRECATE_DISCONNECT_VERSION
+#endif  // SB_API_VERSION < 11
     case kSbEventTypeScheduled:
     case kSbEventTypeAccessiblitySettingsChanged:
-#if SB_API_VERSION >= 6
     case kSbEventTypeLowMemory:
-#endif  // SB_API_VERSION >= 6
 #if SB_API_VERSION >= 8
     case kSbEventTypeWindowSizeChanged:
 #endif  // SB_API_VERSION >= 8
@@ -116,9 +112,9 @@
     case kSbEventTypeOnScreenKeyboardHidden:
     case kSbEventTypeOnScreenKeyboardFocused:
     case kSbEventTypeOnScreenKeyboardBlurred:
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
     case kSbEventTypeOnScreenKeyboardSuggestionsUpdated:
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
 #if SB_HAS(CAPTIONS)
     case kSbEventTypeAccessibilityCaptionSettingsChanged:
diff --git a/src/cobalt/bindings/code_generator_cobalt.py b/src/cobalt/bindings/code_generator_cobalt.py
index 49e4faa..9305930 100644
--- a/src/cobalt/bindings/code_generator_cobalt.py
+++ b/src/cobalt/bindings/code_generator_cobalt.py
@@ -134,6 +134,8 @@
       idl_type = idl_type.resolve_typedefs(info_provider.typedefs)
       if isinstance(idl_type, IdlTypedef):
         idl_type = idl_type.idl_type
+      if idl_type.is_nullable:
+        idl_type = idl_type.inner_type
 
       if idl_type.is_interface_type:
         yield get_interface_name(idl_type)
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/derived_dictionary.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/derived_dictionary.h
index 9ae3c46..6f84d42 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/derived_dictionary.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/derived_dictionary.h
@@ -39,8 +39,8 @@
 
 class DerivedDictionary : public cobalt::bindings::testing::TestDictionary {
  public:
-  DerivedDictionary() {
-    additional_member_ = false;
+  DerivedDictionary()
+    : additional_member_(false) {
   }
 
   DerivedDictionary(const DerivedDictionary& other)
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/dictionary_with_dictionary_member.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/dictionary_with_dictionary_member.h
index fab03b2..d5b8eea 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/dictionary_with_dictionary_member.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/dictionary_with_dictionary_member.h
@@ -39,9 +39,9 @@
 
 class DictionaryWithDictionaryMember {
  public:
-  DictionaryWithDictionaryMember() {
-    has_nested_dictionary_ = false;
-    nested_dictionary_ = TestDictionary();
+  DictionaryWithDictionaryMember()
+    : has_nested_dictionary_(false),
+      nested_dictionary_(TestDictionary()) {
   }
 
   DictionaryWithDictionaryMember(const DictionaryWithDictionaryMember& other) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_indexed_getter_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_indexed_getter_interface.cc
index 027aa03..f0bd582 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_indexed_getter_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_indexed_getter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_anonymous_indexed_getter_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -228,7 +230,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsAnonymousIndexedGetterInterfaceHandler>
+static base::LazyInstance<MozjsAnonymousIndexedGetterInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_indexed_getter_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_indexed_getter_interface.h
index 0997a05..0af7c2a 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_indexed_getter_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_indexed_getter_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsAnonymousIndexedGetterInterface_h
 #define MozjsAnonymousIndexedGetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_getter_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_getter_interface.cc
index edf57c9..2e770b3 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_getter_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_getter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_anonymous_named_getter_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -230,7 +232,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsAnonymousNamedGetterInterfaceHandler>
+static base::LazyInstance<MozjsAnonymousNamedGetterInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_getter_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_getter_interface.h
index 13f86b4..b9a3da8 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_getter_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_getter_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsAnonymousNamedGetterInterface_h
 #define MozjsAnonymousNamedGetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_indexed_getter_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_indexed_getter_interface.cc
index bb82bf5..1b596da 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_indexed_getter_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_indexed_getter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_anonymous_named_indexed_getter_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -327,7 +329,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsAnonymousNamedIndexedGetterInterfaceHandler>
+static base::LazyInstance<MozjsAnonymousNamedIndexedGetterInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_indexed_getter_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_indexed_getter_interface.h
index 9737e1f..6773289 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_indexed_getter_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_anonymous_named_indexed_getter_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsAnonymousNamedIndexedGetterInterface_h
 #define MozjsAnonymousNamedIndexedGetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_arbitrary_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_arbitrary_interface.cc
index f8e08a7..429154a 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_arbitrary_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_arbitrary_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_arbitrary_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsArbitraryInterfaceHandler>
+static base::LazyInstance<MozjsArbitraryInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_arbitrary_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_arbitrary_interface.h
index f24d8cd..2d258ac 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_arbitrary_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_arbitrary_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsArbitraryInterface_h
 #define MozjsArbitraryInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_base_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_base_interface.cc
index 6216308..c4e13c1 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_base_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_base_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_base_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsBaseInterfaceHandler>
+static base::LazyInstance<MozjsBaseInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_base_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_base_interface.h
index 04940bf..41a1dbf 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_base_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_base_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsBaseInterface_h
 #define MozjsBaseInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_boolean_type_test_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_boolean_type_test_interface.cc
index 95386ee..b35bd91 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_boolean_type_test_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_boolean_type_test_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_boolean_type_test_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsBooleanTypeTestInterfaceHandler>
+static base::LazyInstance<MozjsBooleanTypeTestInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_boolean_type_test_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_boolean_type_test_interface.h
index b74a013..d98b13e 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_boolean_type_test_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_boolean_type_test_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsBooleanTypeTestInterface_h
 #define MozjsBooleanTypeTestInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_function_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_function_interface.cc
index a6e816e..dd4017b 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_function_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_function_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_callback_function_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -135,7 +137,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsCallbackFunctionInterfaceHandler>
+static base::LazyInstance<MozjsCallbackFunctionInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_function_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_function_interface.h
index b10961d..0c7465d 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_function_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_function_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsCallbackFunctionInterface_h
 #define MozjsCallbackFunctionInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_interface_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_interface_interface.cc
index f140b23..57ad85b 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_interface_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_interface_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_callback_interface_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -135,7 +137,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsCallbackInterfaceInterfaceHandler>
+static base::LazyInstance<MozjsCallbackInterfaceInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_interface_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_interface_interface.h
index 662c0bf..41f7607 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_interface_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_callback_interface_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsCallbackInterfaceInterface_h
 #define MozjsCallbackInterfaceInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_conditional_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_conditional_interface.cc
index 1a21c59..dfb4d96 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_conditional_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_conditional_interface.cc
@@ -19,11 +19,9 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
-
-// This must be included above the check for ENABLE_CONDITIONAL_INTERFACE, since
-// ENABLE_CONDITIONAL_INTERFACE may be defined within.
 #include "cobalt/bindings/shared/idl_conditional_macros.h"
 
+
 #if defined(ENABLE_CONDITIONAL_INTERFACE)
 
 #include "cobalt/bindings/testing/mozjs_conditional_interface.h"
@@ -138,7 +136,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsConditionalInterfaceHandler>
+static base::LazyInstance<MozjsConditionalInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_conditional_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_conditional_interface.h
index 80eec1c..866c739 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_conditional_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_conditional_interface.h
@@ -20,11 +20,9 @@
 #ifndef MozjsConditionalInterface_h
 #define MozjsConditionalInterface_h
 
-
-// This must be included above the check for ENABLE_CONDITIONAL_INTERFACE, since
-// ENABLE_CONDITIONAL_INTERFACE may be defined within.
 #include "cobalt/bindings/shared/idl_conditional_macros.h"
 
+
 #if defined(ENABLE_CONDITIONAL_INTERFACE)
 
 #include "base/containers/hash_tables.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constants_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constants_interface.cc
index 6538f44..43785e0 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constants_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constants_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_constants_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsConstantsInterfaceHandler>
+static base::LazyInstance<MozjsConstantsInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constants_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constants_interface.h
index e936f0d..33a1554 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constants_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constants_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsConstantsInterface_h
 #define MozjsConstantsInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_interface.cc
index 41f1d91..086f001 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_constructor_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsConstructorInterfaceHandler>
+static base::LazyInstance<MozjsConstructorInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_interface.h
index 763ef8c..fcea7fb 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsConstructorInterface_h
 #define MozjsConstructorInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_with_arguments_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_with_arguments_interface.cc
index cfb095a..ee0d5a5 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_with_arguments_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_with_arguments_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_constructor_with_arguments_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsConstructorWithArgumentsInterfaceHandler>
+static base::LazyInstance<MozjsConstructorWithArgumentsInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_with_arguments_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_with_arguments_interface.h
index 170c23e..64cf348 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_with_arguments_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_constructor_with_arguments_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsConstructorWithArgumentsInterface_h
 #define MozjsConstructorWithArgumentsInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_convert_simple_object_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_convert_simple_object_interface.cc
index 286a44a..969ff32 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_convert_simple_object_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_convert_simple_object_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_convert_simple_object_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsConvertSimpleObjectInterfaceHandler>
+static base::LazyInstance<MozjsConvertSimpleObjectInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_convert_simple_object_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_convert_simple_object_interface.h
index c049762..e11a822 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_convert_simple_object_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_convert_simple_object_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsConvertSimpleObjectInterface_h
 #define MozjsConvertSimpleObjectInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_getter_setter_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_getter_setter_interface.cc
index 0e3c382..56b32c5 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_getter_setter_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_getter_setter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_derived_getter_setter_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -331,7 +333,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsDerivedGetterSetterInterfaceHandler>
+static base::LazyInstance<MozjsDerivedGetterSetterInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_getter_setter_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_getter_setter_interface.h
index 54cd8cc..e118585 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_getter_setter_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_getter_setter_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsDerivedGetterSetterInterface_h
 #define MozjsDerivedGetterSetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_interface.cc
index 4c2fd10..e2076d7 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_derived_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -135,7 +137,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsDerivedInterfaceHandler>
+static base::LazyInstance<MozjsDerivedInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_interface.h
index cbf9d8c..bf31935 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_derived_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsDerivedInterface_h
 #define MozjsDerivedInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dictionary_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dictionary_interface.cc
index d8424d1..9476c72 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dictionary_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dictionary_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_dictionary_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -137,7 +139,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsDictionaryInterfaceHandler>
+static base::LazyInstance<MozjsDictionaryInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dictionary_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dictionary_interface.h
index f5b7d4f..6025163 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dictionary_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dictionary_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsDictionaryInterface_h
 #define MozjsDictionaryInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_disabled_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_disabled_interface.cc
index d451af9..737c6e5 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_disabled_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_disabled_interface.cc
@@ -19,11 +19,9 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
-
-// This must be included above the check for NO_ENABLE_CONDITIONAL_INTERFACE, since
-// NO_ENABLE_CONDITIONAL_INTERFACE may be defined within.
 #include "cobalt/bindings/shared/idl_conditional_macros.h"
 
+
 #if defined(NO_ENABLE_CONDITIONAL_INTERFACE)
 
 #include "cobalt/bindings/testing/mozjs_disabled_interface.h"
@@ -138,7 +136,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsDisabledInterfaceHandler>
+static base::LazyInstance<MozjsDisabledInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_disabled_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_disabled_interface.h
index 11e6995..9e23691 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_disabled_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_disabled_interface.h
@@ -20,11 +20,9 @@
 #ifndef MozjsDisabledInterface_h
 #define MozjsDisabledInterface_h
 
-
-// This must be included above the check for NO_ENABLE_CONDITIONAL_INTERFACE, since
-// NO_ENABLE_CONDITIONAL_INTERFACE may be defined within.
 #include "cobalt/bindings/shared/idl_conditional_macros.h"
 
+
 #if defined(NO_ENABLE_CONDITIONAL_INTERFACE)
 
 #include "base/containers/hash_tables.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dom_string_test_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dom_string_test_interface.cc
index 3a6759e..8743ada 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dom_string_test_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dom_string_test_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_dom_string_test_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsDOMStringTestInterfaceHandler>
+static base::LazyInstance<MozjsDOMStringTestInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dom_string_test_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dom_string_test_interface.h
index 2f09266..a15314b 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dom_string_test_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_dom_string_test_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsDOMStringTestInterface_h
 #define MozjsDOMStringTestInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_enumeration_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_enumeration_interface.cc
index 46085a7..f750d28 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_enumeration_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_enumeration_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_enumeration_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -133,7 +135,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsEnumerationInterfaceHandler>
+static base::LazyInstance<MozjsEnumerationInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_enumeration_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_enumeration_interface.h
index e7e00dc..38553f3 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_enumeration_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_enumeration_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsEnumerationInterface_h
 #define MozjsEnumerationInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exception_object_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exception_object_interface.cc
index 1fd08ee..28d588b 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exception_object_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exception_object_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_exception_object_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -132,7 +134,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsExceptionObjectInterfaceHandler>
+static base::LazyInstance<MozjsExceptionObjectInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exception_object_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exception_object_interface.h
index 04d7cf2..d593e50 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exception_object_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exception_object_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsExceptionObjectInterface_h
 #define MozjsExceptionObjectInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exceptions_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exceptions_interface.cc
index 1315782..79f7962 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exceptions_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exceptions_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_exceptions_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsExceptionsInterfaceHandler>
+static base::LazyInstance<MozjsExceptionsInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exceptions_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exceptions_interface.h
index cd7aded..f6f6a94 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exceptions_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_exceptions_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsExceptionsInterface_h
 #define MozjsExceptionsInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_extended_idl_attributes_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_extended_idl_attributes_interface.cc
index c5593e4..beb697c 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_extended_idl_attributes_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_extended_idl_attributes_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_extended_idl_attributes_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsExtendedIDLAttributesInterfaceHandler>
+static base::LazyInstance<MozjsExtendedIDLAttributesInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_extended_idl_attributes_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_extended_idl_attributes_interface.h
index cc402cb..7472f2a 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_extended_idl_attributes_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_extended_idl_attributes_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsExtendedIDLAttributesInterface_h
 #define MozjsExtendedIDLAttributesInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_garbage_collection_test_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_garbage_collection_test_interface.cc
index 9a26c81..d922064 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_garbage_collection_test_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_garbage_collection_test_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_garbage_collection_test_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -135,7 +137,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsGarbageCollectionTestInterfaceHandler>
+static base::LazyInstance<MozjsGarbageCollectionTestInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_garbage_collection_test_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_garbage_collection_test_interface.h
index 036cad5..050854e 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_garbage_collection_test_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_garbage_collection_test_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsGarbageCollectionTestInterface_h
 #define MozjsGarbageCollectionTestInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_global_interface_parent.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_global_interface_parent.cc
index 1cbe9d6..3ae7d9d 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_global_interface_parent.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_global_interface_parent.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_global_interface_parent.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsGlobalInterfaceParentHandler>
+static base::LazyInstance<MozjsGlobalInterfaceParentHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_global_interface_parent.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_global_interface_parent.h
index 8a9c26f..792168f 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_global_interface_parent.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_global_interface_parent.h
@@ -20,6 +20,8 @@
 #ifndef MozjsGlobalInterfaceParent_h
 #define MozjsGlobalInterfaceParent_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_indexed_getter_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_indexed_getter_interface.cc
index 2886710..77c559c 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_indexed_getter_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_indexed_getter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_indexed_getter_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -244,7 +246,7 @@
   DeleteIndexedProperty,
 };
 
-static base::LazyInstance<MozjsIndexedGetterInterfaceHandler>
+static base::LazyInstance<MozjsIndexedGetterInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_indexed_getter_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_indexed_getter_interface.h
index defbad7..e3ae08a 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_indexed_getter_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_indexed_getter_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsIndexedGetterInterface_h
 #define MozjsIndexedGetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any.cc
index 64584cf..8503fb6 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_interface_with_any.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsInterfaceWithAnyHandler>
+static base::LazyInstance<MozjsInterfaceWithAnyHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any.h
index f30fe70..fb5348b 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any.h
@@ -20,6 +20,8 @@
 #ifndef MozjsInterfaceWithAny_h
 #define MozjsInterfaceWithAny_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any_dictionary.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any_dictionary.cc
index 2d781cf..2d4626f 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any_dictionary.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any_dictionary.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_interface_with_any_dictionary.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsInterfaceWithAnyDictionaryHandler>
+static base::LazyInstance<MozjsInterfaceWithAnyDictionaryHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any_dictionary.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any_dictionary.h
index 8c144d7..9b248c3 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any_dictionary.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_any_dictionary.h
@@ -20,6 +20,8 @@
 #ifndef MozjsInterfaceWithAnyDictionary_h
 #define MozjsInterfaceWithAnyDictionary_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_date.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_date.cc
index 6f0753e..60f9c6b 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_date.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_date.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_interface_with_date.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsInterfaceWithDateHandler>
+static base::LazyInstance<MozjsInterfaceWithDateHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_date.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_date.h
index 2b19bbf..a515f52 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_date.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_date.h
@@ -20,6 +20,8 @@
 #ifndef MozjsInterfaceWithDate_h
 #define MozjsInterfaceWithDate_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_unsupported_properties.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_unsupported_properties.cc
index ee9a995..5d45693 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_unsupported_properties.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_unsupported_properties.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_interface_with_unsupported_properties.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsInterfaceWithUnsupportedPropertiesHandler>
+static base::LazyInstance<MozjsInterfaceWithUnsupportedPropertiesHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_unsupported_properties.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_unsupported_properties.h
index 4c51bb2..78d68c7 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_unsupported_properties.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_interface_with_unsupported_properties.h
@@ -20,6 +20,8 @@
 #ifndef MozjsInterfaceWithUnsupportedProperties_h
 #define MozjsInterfaceWithUnsupportedProperties_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_constructor_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_constructor_interface.cc
index f011ddc..f0d0dcb 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_constructor_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_constructor_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_named_constructor_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsNamedConstructorInterfaceHandler>
+static base::LazyInstance<MozjsNamedConstructorInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_constructor_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_constructor_interface.h
index c0ba42b..58e1ddf 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_constructor_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_constructor_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsNamedConstructorInterface_h
 #define MozjsNamedConstructorInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_getter_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_getter_interface.cc
index cb262cd..324ea48 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_getter_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_getter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_named_getter_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -246,7 +248,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsNamedGetterInterfaceHandler>
+static base::LazyInstance<MozjsNamedGetterInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_getter_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_getter_interface.h
index a055039..1cc0770 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_getter_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_getter_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsNamedGetterInterface_h
 #define MozjsNamedGetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_indexed_getter_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_indexed_getter_interface.cc
index 43f3d0d..5f8a2c5 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_indexed_getter_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_indexed_getter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_named_indexed_getter_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -327,7 +329,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsNamedIndexedGetterInterfaceHandler>
+static base::LazyInstance<MozjsNamedIndexedGetterInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_indexed_getter_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_indexed_getter_interface.h
index b046da9..508ab5f 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_indexed_getter_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_named_indexed_getter_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsNamedIndexedGetterInterface_h
 #define MozjsNamedIndexedGetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nested_put_forwards_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nested_put_forwards_interface.cc
index 3e78e0e..158b7da 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nested_put_forwards_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nested_put_forwards_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_nested_put_forwards_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -135,7 +137,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsNestedPutForwardsInterfaceHandler>
+static base::LazyInstance<MozjsNestedPutForwardsInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nested_put_forwards_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nested_put_forwards_interface.h
index 87d3c62..13eddac 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nested_put_forwards_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nested_put_forwards_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsNestedPutForwardsInterface_h
 #define MozjsNestedPutForwardsInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_constructor_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_constructor_interface.cc
index 42a9d01..f3e738c 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_constructor_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_constructor_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_no_constructor_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsNoConstructorInterfaceHandler>
+static base::LazyInstance<MozjsNoConstructorInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_constructor_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_constructor_interface.h
index 00272fc..95920b6 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_constructor_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_constructor_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsNoConstructorInterface_h
 #define MozjsNoConstructorInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_interface_object_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_interface_object_interface.cc
index 0f0505d..272309c 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_interface_object_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_interface_object_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_no_interface_object_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsNoInterfaceObjectInterfaceHandler>
+static base::LazyInstance<MozjsNoInterfaceObjectInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_interface_object_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_interface_object_interface.h
index 6140826..688376c 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_interface_object_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_no_interface_object_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsNoInterfaceObjectInterface_h
 #define MozjsNoInterfaceObjectInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nullable_types_test_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nullable_types_test_interface.cc
index c87603d..2969ca0 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nullable_types_test_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nullable_types_test_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_nullable_types_test_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -28,6 +30,7 @@
 #include "cobalt/script/value_handle.h"
 #include "cobalt/bindings/testing/arbitrary_interface.h"
 #include "cobalt/bindings/testing/mozjs_arbitrary_interface.h"
+#include "cobalt/bindings/testing/test_dictionary.h"
 
 #include "mozjs_gen_type_conversion.h"
 
@@ -61,6 +64,7 @@
 using cobalt::bindings::testing::MozjsNullableTypesTestInterface;
 using cobalt::bindings::testing::ArbitraryInterface;
 using cobalt::bindings::testing::MozjsArbitraryInterface;
+using cobalt::bindings::testing::TestDictionary;
 using cobalt::script::CallbackInterfaceTraits;
 using cobalt::script::GlobalEnvironment;
 using cobalt::script::ScriptValue;
@@ -135,7 +139,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsNullableTypesTestInterfaceHandler>
+static base::LazyInstance<MozjsNullableTypesTestInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
@@ -504,6 +508,106 @@
   return !exception_state.is_exception_set();
 }
 
+bool get_nullableDictionaryProperty(
+    JSContext* context, unsigned argc, JS::Value* vp) {
+  JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
+  if (!args.thisv().isObject()) {
+    MozjsExceptionState exception(context);
+    exception.SetSimpleException(script::kTypeError, "Invalid this.");
+    return false;
+  }
+  JS::RootedObject object(context, &args.thisv().toObject());
+  const JSClass* proto_class =
+      MozjsNullableTypesTestInterface::PrototypeClass(context);
+  if (proto_class == JS_GetClass(object)) {
+    // Simply returns true if the object is this class's prototype object.
+    // There is no need to return any value due to the object is not a platform
+    // object. The execution reaches here when Object.getOwnPropertyDescriptor
+    // gets called on native object prototypes.
+    return true;
+  }
+
+  MozjsGlobalEnvironment* global_environment =
+      static_cast<MozjsGlobalEnvironment*>(JS_GetContextPrivate(context));
+  WrapperFactory* wrapper_factory = global_environment->wrapper_factory();
+  if (!wrapper_factory->DoesObjectImplementInterface(
+        object, base::GetTypeId<NullableTypesTestInterface>())) {
+    MozjsExceptionState exception(context);
+    exception.SetSimpleException(script::kDoesNotImplementInterface);
+    return false;
+  }
+  MozjsExceptionState exception_state(context);
+  JS::RootedValue result_value(context);
+
+  WrapperPrivate* wrapper_private =
+      WrapperPrivate::GetFromObject(context, object);
+  NullableTypesTestInterface* impl =
+      wrapper_private->wrappable<NullableTypesTestInterface>().get();
+
+  if (!exception_state.is_exception_set()) {
+    ToJSValue(context,
+              impl->nullable_dictionary_property(),
+              &result_value);
+  }
+  if (!exception_state.is_exception_set()) {
+    args.rval().set(result_value);
+  }
+  return !exception_state.is_exception_set();
+}
+
+bool set_nullableDictionaryProperty(
+    JSContext* context, unsigned argc, JS::Value* vp) {
+
+  JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
+  if (!args.thisv().isObject()) {
+    MozjsExceptionState exception(context);
+    exception.SetSimpleException(script::kTypeError, "Invalid this.");
+    return false;
+  }
+  JS::RootedObject object(context, &args.thisv().toObject());
+
+  const JSClass* proto_class =
+      MozjsNullableTypesTestInterface::PrototypeClass(context);
+  if (proto_class == JS_GetClass(object)) {
+    // Simply returns true if the object is this class's prototype object.
+    // There is no need to return any value due to the object is not a platform
+    // object. The execution reaches here when Object.getOwnPropertyDescriptor
+    // gets called on native object prototypes.
+    return true;
+  }
+
+  MozjsGlobalEnvironment* global_environment =
+      static_cast<MozjsGlobalEnvironment*>(JS_GetContextPrivate(context));
+  WrapperFactory* wrapper_factory = global_environment->wrapper_factory();
+  if (!wrapper_factory->DoesObjectImplementInterface(
+        object, base::GetTypeId<NullableTypesTestInterface>())) {
+    MozjsExceptionState exception(context);
+    exception.SetSimpleException(script::kDoesNotImplementInterface);
+    return false;
+  }
+  MozjsExceptionState exception_state(context);
+  JS::RootedValue result_value(context);
+
+  WrapperPrivate* wrapper_private =
+      WrapperPrivate::GetFromObject(context, object);
+  NullableTypesTestInterface* impl =
+      wrapper_private->wrappable<NullableTypesTestInterface>().get();
+  TypeTraits<base::Optional<TestDictionary > >::ConversionType value;
+  if (args.length() != 1) {
+    NOTREACHED();
+    return false;
+  }
+  FromJSValue(context, args[0], (kConversionFlagNullable), &exception_state,
+              &value);
+  if (exception_state.is_exception_set()) {
+    return false;
+  }
+
+  impl->set_nullable_dictionary_property(value);
+  result_value.set(JS::UndefinedHandleValue);
+  return !exception_state.is_exception_set();
+}
+
 bool get_nullableObjectProperty(
     JSContext* context, unsigned argc, JS::Value* vp) {
   JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@@ -723,6 +827,124 @@
 }
 
 
+bool fcn_nullableDictionaryArgument(
+    JSContext* context, uint32_t argc, JS::Value *vp) {
+  JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
+  // Compute the 'this' value.
+  JS::RootedValue this_value(context, JS_ComputeThis(context, vp));
+  // 'this' should be an object.
+  JS::RootedObject object(context);
+  if (JS_TypeOfValue(context, this_value) != JSTYPE_OBJECT) {
+    return false;
+  }
+  if (!JS_ValueToObject(context, this_value, &object)) {
+    NOTREACHED();
+    return false;
+  }
+  const JSClass* proto_class =
+      MozjsNullableTypesTestInterface::PrototypeClass(context);
+  if (proto_class == JS_GetClass(object)) {
+    // Simply returns true if the object is this class's prototype object.
+    // There is no need to return any value due to the object is not a platform
+    // object. The execution reaches here when Object.getOwnPropertyDescriptor
+    // gets called on native object prototypes.
+    return true;
+  }
+
+  MozjsGlobalEnvironment* global_environment =
+      static_cast<MozjsGlobalEnvironment*>(JS_GetContextPrivate(context));
+  WrapperFactory* wrapper_factory = global_environment->wrapper_factory();
+  if (!wrapper_factory->DoesObjectImplementInterface(
+        object, base::GetTypeId<NullableTypesTestInterface>())) {
+    MozjsExceptionState exception(context);
+    exception.SetSimpleException(script::kDoesNotImplementInterface);
+    return false;
+  }
+  MozjsExceptionState exception_state(context);
+  JS::RootedValue result_value(context);
+
+  WrapperPrivate* wrapper_private =
+      WrapperPrivate::GetFromObject(context, object);
+  NullableTypesTestInterface* impl =
+      wrapper_private->wrappable<NullableTypesTestInterface>().get();
+  const size_t kMinArguments = 1;
+  if (args.length() < kMinArguments) {
+    exception_state.SetSimpleException(script::kInvalidNumberOfArguments);
+    return false;
+  }
+  // Non-optional arguments
+  TypeTraits<base::Optional<TestDictionary > >::ConversionType arg;
+
+  DCHECK_LT(0, args.length());
+  JS::RootedValue non_optional_value0(
+      context, args[0]);
+  FromJSValue(context,
+              non_optional_value0,
+              (kConversionFlagNullable),
+              &exception_state, &arg);
+  if (exception_state.is_exception_set()) {
+    return false;
+  }
+
+  impl->NullableDictionaryArgument(arg);
+  result_value.set(JS::UndefinedHandleValue);
+  return !exception_state.is_exception_set();
+}
+
+
+bool fcn_nullableDictionaryOperation(
+    JSContext* context, uint32_t argc, JS::Value *vp) {
+  JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
+  // Compute the 'this' value.
+  JS::RootedValue this_value(context, JS_ComputeThis(context, vp));
+  // 'this' should be an object.
+  JS::RootedObject object(context);
+  if (JS_TypeOfValue(context, this_value) != JSTYPE_OBJECT) {
+    return false;
+  }
+  if (!JS_ValueToObject(context, this_value, &object)) {
+    NOTREACHED();
+    return false;
+  }
+  const JSClass* proto_class =
+      MozjsNullableTypesTestInterface::PrototypeClass(context);
+  if (proto_class == JS_GetClass(object)) {
+    // Simply returns true if the object is this class's prototype object.
+    // There is no need to return any value due to the object is not a platform
+    // object. The execution reaches here when Object.getOwnPropertyDescriptor
+    // gets called on native object prototypes.
+    return true;
+  }
+
+  MozjsGlobalEnvironment* global_environment =
+      static_cast<MozjsGlobalEnvironment*>(JS_GetContextPrivate(context));
+  WrapperFactory* wrapper_factory = global_environment->wrapper_factory();
+  if (!wrapper_factory->DoesObjectImplementInterface(
+        object, base::GetTypeId<NullableTypesTestInterface>())) {
+    MozjsExceptionState exception(context);
+    exception.SetSimpleException(script::kDoesNotImplementInterface);
+    return false;
+  }
+  MozjsExceptionState exception_state(context);
+  JS::RootedValue result_value(context);
+
+  WrapperPrivate* wrapper_private =
+      WrapperPrivate::GetFromObject(context, object);
+  NullableTypesTestInterface* impl =
+      wrapper_private->wrappable<NullableTypesTestInterface>().get();
+
+  if (!exception_state.is_exception_set()) {
+    ToJSValue(context,
+              impl->NullableDictionaryOperation(),
+              &result_value);
+  }
+  if (!exception_state.is_exception_set()) {
+    args.rval().set(result_value);
+  }
+  return !exception_state.is_exception_set();
+}
+
+
 bool fcn_nullableNumericArgument(
     JSContext* context, uint32_t argc, JS::Value *vp) {
   JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@@ -1099,6 +1321,12 @@
     { { &set_nullableStringProperty, NULL } },
   },
   {  // Read/Write property
+    "nullableDictionaryProperty",
+    JSPROP_SHARED | JSPROP_ENUMERATE,
+    { { &get_nullableDictionaryProperty, NULL } },
+    { { &set_nullableDictionaryProperty, NULL } },
+  },
+  {  // Read/Write property
     "nullableObjectProperty",
     JSPROP_SHARED | JSPROP_ENUMERATE,
     { { &get_nullableObjectProperty, NULL } },
@@ -1115,6 +1343,12 @@
       "nullableBooleanOperation", fcn_nullableBooleanOperation, NULL,
       0, JSPROP_ENUMERATE, NULL),
   JS_FNSPEC(
+      "nullableDictionaryArgument", fcn_nullableDictionaryArgument, NULL,
+      1, JSPROP_ENUMERATE, NULL),
+  JS_FNSPEC(
+      "nullableDictionaryOperation", fcn_nullableDictionaryOperation, NULL,
+      0, JSPROP_ENUMERATE, NULL),
+  JS_FNSPEC(
       "nullableNumericArgument", fcn_nullableNumericArgument, NULL,
       1, JSPROP_ENUMERATE, NULL),
   JS_FNSPEC(
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nullable_types_test_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nullable_types_test_interface.h
index e405fb6..6b91b81 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nullable_types_test_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_nullable_types_test_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsNullableTypesTestInterface_h
 #define MozjsNullableTypesTestInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_numeric_types_test_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_numeric_types_test_interface.cc
index be09435..627b79d 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_numeric_types_test_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_numeric_types_test_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_numeric_types_test_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsNumericTypesTestInterfaceHandler>
+static base::LazyInstance<MozjsNumericTypesTestInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_numeric_types_test_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_numeric_types_test_interface.h
index 2606673..63412fd 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_numeric_types_test_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_numeric_types_test_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsNumericTypesTestInterface_h
 #define MozjsNumericTypesTestInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_object_type_bindings_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_object_type_bindings_interface.cc
index a003a44..23efb2f 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_object_type_bindings_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_object_type_bindings_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_object_type_bindings_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -143,7 +145,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsObjectTypeBindingsInterfaceHandler>
+static base::LazyInstance<MozjsObjectTypeBindingsInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_object_type_bindings_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_object_type_bindings_interface.h
index 7ba0880..5298255 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_object_type_bindings_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_object_type_bindings_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsObjectTypeBindingsInterface_h
 #define MozjsObjectTypeBindingsInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_operations_test_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_operations_test_interface.cc
index b937adc..f6340c9 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_operations_test_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_operations_test_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_operations_test_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -135,7 +137,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsOperationsTestInterfaceHandler>
+static base::LazyInstance<MozjsOperationsTestInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_operations_test_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_operations_test_interface.h
index 34d2357..81f4e8d 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_operations_test_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_operations_test_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsOperationsTestInterface_h
 #define MozjsOperationsTestInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_promise_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_promise_interface.cc
index d121154..f82e2fd 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_promise_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_promise_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_promise_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsPromiseInterfaceHandler>
+static base::LazyInstance<MozjsPromiseInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_promise_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_promise_interface.h
index b996814..17eff76 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_promise_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_promise_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsPromiseInterface_h
 #define MozjsPromiseInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_put_forwards_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_put_forwards_interface.cc
index 4f57d54..dff63a2 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_put_forwards_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_put_forwards_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_put_forwards_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -135,7 +137,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsPutForwardsInterfaceHandler>
+static base::LazyInstance<MozjsPutForwardsInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_put_forwards_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_put_forwards_interface.h
index 821855c..25e56af 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_put_forwards_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_put_forwards_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsPutForwardsInterface_h
 #define MozjsPutForwardsInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_sequence_user.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_sequence_user.cc
index 52e8e0b..3a35cfd 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_sequence_user.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_sequence_user.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_sequence_user.h"
 
 #include "base/trace_event/trace_event.h"
@@ -135,7 +137,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsSequenceUserHandler>
+static base::LazyInstance<MozjsSequenceUserHandler>::DestructorAtExit
     proxy_handler;
 
 bool Constructor(JSContext* context, unsigned int argc, JS::Value* vp);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_sequence_user.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_sequence_user.h
index e0be02e..db53c92 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_sequence_user.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_sequence_user.h
@@ -20,6 +20,8 @@
 #ifndef MozjsSequenceUser_h
 #define MozjsSequenceUser_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_static_properties_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_static_properties_interface.cc
index 6e413a5..5e684bf 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_static_properties_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_static_properties_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_static_properties_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -135,7 +137,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsStaticPropertiesInterfaceHandler>
+static base::LazyInstance<MozjsStaticPropertiesInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_static_properties_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_static_properties_interface.h
index 9ed4ef9..2141588 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_static_properties_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_static_properties_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsStaticPropertiesInterface_h
 #define MozjsStaticPropertiesInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_anonymous_operation_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_anonymous_operation_interface.cc
index 76ddb86..173a856 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_anonymous_operation_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_anonymous_operation_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_stringifier_anonymous_operation_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsStringifierAnonymousOperationInterfaceHandler>
+static base::LazyInstance<MozjsStringifierAnonymousOperationInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_anonymous_operation_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_anonymous_operation_interface.h
index b87f238..9b22a1d 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_anonymous_operation_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_anonymous_operation_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsStringifierAnonymousOperationInterface_h
 #define MozjsStringifierAnonymousOperationInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_attribute_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_attribute_interface.cc
index 86cc8d0..5aa0204 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_attribute_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_attribute_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_stringifier_attribute_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsStringifierAttributeInterfaceHandler>
+static base::LazyInstance<MozjsStringifierAttributeInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_attribute_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_attribute_interface.h
index a984cc3..36d15bc 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_attribute_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_attribute_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsStringifierAttributeInterface_h
 #define MozjsStringifierAttributeInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_operation_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_operation_interface.cc
index e80c6b6..a023c7c 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_operation_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_operation_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_stringifier_operation_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsStringifierOperationInterfaceHandler>
+static base::LazyInstance<MozjsStringifierOperationInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_operation_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_operation_interface.h
index 48a541a..bb26df8 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_operation_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_stringifier_operation_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsStringifierOperationInterface_h
 #define MozjsStringifierOperationInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_target_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_target_interface.cc
index a520247..3aaea2c 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_target_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_target_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_target_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -131,7 +133,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsTargetInterfaceHandler>
+static base::LazyInstance<MozjsTargetInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_target_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_target_interface.h
index 74e1907..621b180 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_target_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_target_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsTargetInterface_h
 #define MozjsTargetInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_union_types_interface.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_union_types_interface.cc
index f9fd89c..dc8e9dc 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_union_types_interface.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_union_types_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_union_types_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -139,7 +141,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsUnionTypesInterfaceHandler>
+static base::LazyInstance<MozjsUnionTypesInterfaceHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_union_types_interface.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_union_types_interface.h
index 2fab539..2f1dc93 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_union_types_interface.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_union_types_interface.h
@@ -20,6 +20,8 @@
 #ifndef MozjsUnionTypesInterface_h
 #define MozjsUnionTypesInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_window.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_window.cc
index 9a87d2e..2a97c33 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_window.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_window.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/mozjs45/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/mozjs_window.h"
 
 #include "base/trace_event/trace_event.h"
@@ -348,7 +350,7 @@
   NULL,
 };
 
-static base::LazyInstance<MozjsWindowHandler>
+static base::LazyInstance<MozjsWindowHandler>::DestructorAtExit
     proxy_handler;
 
 bool DummyConstructor(JSContext* context, unsigned int argc, JS::Value* vp) {
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_window.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_window.h
index 4adb0e7..19e8c58 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_window.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_window.h
@@ -20,6 +20,8 @@
 #ifndef MozjsWindow_h
 #define MozjsWindow_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/test_dictionary.h b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/test_dictionary.h
index 99e89de..b563a43 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/test_dictionary.h
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/test_dictionary.h
@@ -39,23 +39,23 @@
 
 class TestDictionary {
  public:
-  TestDictionary() {
-    has_boolean_member_ = false;
-    boolean_member_ = bool();
-    has_short_clamp_member_ = false;
-    short_clamp_member_ = int16_t();
-    has_long_member_ = false;
-    long_member_ = int32_t();
-    has_double_member_ = false;
-    double_member_ = double();
-    has_string_member_ = false;
-    string_member_ = std::string();
-    has_interface_member_ = false;
-    interface_member_ = scoped_refptr<ArbitraryInterface>();
-    member_with_default_ = 5;
-    has_non_default_member_ = false;
-    non_default_member_ = int32_t();
-    has_any_member_ = false;
+  TestDictionary()
+    : has_boolean_member_(false),
+      boolean_member_(bool()),
+      has_short_clamp_member_(false),
+      short_clamp_member_(int16_t()),
+      has_long_member_(false),
+      long_member_(int32_t()),
+      has_double_member_(false),
+      double_member_(double()),
+      has_string_member_(false),
+      string_member_(std::string()),
+      has_interface_member_(false),
+      interface_member_(scoped_refptr<ArbitraryInterface>()),
+      member_with_default_(5),
+      has_non_default_member_(false),
+      non_default_member_(int32_t()),
+      has_any_member_(false) {
   }
 
   TestDictionary(const TestDictionary& other) {
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/derived_dictionary.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/derived_dictionary.h
index 9ae3c46..6f84d42 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/derived_dictionary.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/derived_dictionary.h
@@ -39,8 +39,8 @@
 
 class DerivedDictionary : public cobalt::bindings::testing::TestDictionary {
  public:
-  DerivedDictionary() {
-    additional_member_ = false;
+  DerivedDictionary()
+    : additional_member_(false) {
   }
 
   DerivedDictionary(const DerivedDictionary& other)
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/dictionary_with_dictionary_member.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/dictionary_with_dictionary_member.h
index fab03b2..d5b8eea 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/dictionary_with_dictionary_member.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/dictionary_with_dictionary_member.h
@@ -39,9 +39,9 @@
 
 class DictionaryWithDictionaryMember {
  public:
-  DictionaryWithDictionaryMember() {
-    has_nested_dictionary_ = false;
-    nested_dictionary_ = TestDictionary();
+  DictionaryWithDictionaryMember()
+    : has_nested_dictionary_(false),
+      nested_dictionary_(TestDictionary()) {
   }
 
   DictionaryWithDictionaryMember(const DictionaryWithDictionaryMember& other) {
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/test_dictionary.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/test_dictionary.h
index 99e89de..b563a43 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/test_dictionary.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/test_dictionary.h
@@ -39,23 +39,23 @@
 
 class TestDictionary {
  public:
-  TestDictionary() {
-    has_boolean_member_ = false;
-    boolean_member_ = bool();
-    has_short_clamp_member_ = false;
-    short_clamp_member_ = int16_t();
-    has_long_member_ = false;
-    long_member_ = int32_t();
-    has_double_member_ = false;
-    double_member_ = double();
-    has_string_member_ = false;
-    string_member_ = std::string();
-    has_interface_member_ = false;
-    interface_member_ = scoped_refptr<ArbitraryInterface>();
-    member_with_default_ = 5;
-    has_non_default_member_ = false;
-    non_default_member_ = int32_t();
-    has_any_member_ = false;
+  TestDictionary()
+    : has_boolean_member_(false),
+      boolean_member_(bool()),
+      has_short_clamp_member_(false),
+      short_clamp_member_(int16_t()),
+      has_long_member_(false),
+      long_member_(int32_t()),
+      has_double_member_(false),
+      double_member_(double()),
+      has_string_member_(false),
+      string_member_(std::string()),
+      has_interface_member_(false),
+      interface_member_(scoped_refptr<ArbitraryInterface>()),
+      member_with_default_(5),
+      has_non_default_member_(false),
+      non_default_member_(int32_t()),
+      has_any_member_(false) {
   }
 
   TestDictionary(const TestDictionary& other) {
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_indexed_getter_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_indexed_getter_interface.cc
index da5fe73..ea635f3 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_indexed_getter_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_indexed_getter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_anonymous_indexed_getter_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_indexed_getter_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_indexed_getter_interface.h
index c45db7a..2a066a6 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_indexed_getter_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_indexed_getter_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cAnonymousIndexedGetterInterface_h
 #define V8cAnonymousIndexedGetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_getter_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_getter_interface.cc
index 503670d..19f942c 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_getter_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_getter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_anonymous_named_getter_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_getter_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_getter_interface.h
index 3a52f7e..f3d6a8d 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_getter_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_getter_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cAnonymousNamedGetterInterface_h
 #define V8cAnonymousNamedGetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_indexed_getter_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_indexed_getter_interface.cc
index 9606c33..afaafa4 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_indexed_getter_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_indexed_getter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_anonymous_named_indexed_getter_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_indexed_getter_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_indexed_getter_interface.h
index fffd3e2..8ad53be 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_indexed_getter_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_anonymous_named_indexed_getter_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cAnonymousNamedIndexedGetterInterface_h
 #define V8cAnonymousNamedIndexedGetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_arbitrary_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_arbitrary_interface.cc
index b8f987e..47f8230 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_arbitrary_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_arbitrary_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_arbitrary_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_arbitrary_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_arbitrary_interface.h
index cdac8d7..4993918 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_arbitrary_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_arbitrary_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cArbitraryInterface_h
 #define V8cArbitraryInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_base_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_base_interface.cc
index 90dd493..74adfb7 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_base_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_base_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_base_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_base_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_base_interface.h
index cfe0f73..301cd31 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_base_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_base_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cBaseInterface_h
 #define V8cBaseInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_boolean_type_test_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_boolean_type_test_interface.cc
index faeb008..827670c 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_boolean_type_test_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_boolean_type_test_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_boolean_type_test_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_boolean_type_test_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_boolean_type_test_interface.h
index a019284..4638c13 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_boolean_type_test_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_boolean_type_test_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cBooleanTypeTestInterface_h
 #define V8cBooleanTypeTestInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_function_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_function_interface.cc
index 1dda013..d3c8f0d 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_function_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_function_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_callback_function_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_function_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_function_interface.h
index 883237c..61b6e12 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_function_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_function_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cCallbackFunctionInterface_h
 #define V8cCallbackFunctionInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_interface_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_interface_interface.cc
index d1b5b30..1cd9aeb 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_interface_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_interface_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_callback_interface_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_interface_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_interface_interface.h
index 84e6978..670c58d 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_interface_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_callback_interface_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cCallbackInterfaceInterface_h
 #define V8cCallbackInterfaceInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_conditional_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_conditional_interface.cc
index e73e77b..2ebfed4 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_conditional_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_conditional_interface.cc
@@ -19,11 +19,9 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
-
-// This must be included above the check for ENABLE_CONDITIONAL_INTERFACE, since
-// ENABLE_CONDITIONAL_INTERFACE may be defined within.
 #include "cobalt/bindings/shared/idl_conditional_macros.h"
 
+
 #if defined(ENABLE_CONDITIONAL_INTERFACE)
 
 #include "cobalt/bindings/testing/v8c_conditional_interface.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_conditional_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_conditional_interface.h
index 4331a9f..9539cf1 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_conditional_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_conditional_interface.h
@@ -21,11 +21,9 @@
 #ifndef V8cConditionalInterface_h
 #define V8cConditionalInterface_h
 
-
-// This must be included above the check for ENABLE_CONDITIONAL_INTERFACE, since
-// ENABLE_CONDITIONAL_INTERFACE may be defined within.
 #include "cobalt/bindings/shared/idl_conditional_macros.h"
 
+
 #if defined(ENABLE_CONDITIONAL_INTERFACE)
 
 #include "base/containers/hash_tables.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constants_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constants_interface.cc
index 0d2d1f1..2287821 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constants_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constants_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_constants_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constants_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constants_interface.h
index b70e9d7..ae904ee 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constants_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constants_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cConstantsInterface_h
 #define V8cConstantsInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_interface.cc
index 225541d..463ab84 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_constructor_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_interface.h
index 4e5a711..6e553c5 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cConstructorInterface_h
 #define V8cConstructorInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_with_arguments_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_with_arguments_interface.cc
index 217939d..330ec14 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_with_arguments_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_with_arguments_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_constructor_with_arguments_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_with_arguments_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_with_arguments_interface.h
index 5e23067..4031824 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_with_arguments_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_constructor_with_arguments_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cConstructorWithArgumentsInterface_h
 #define V8cConstructorWithArgumentsInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_convert_simple_object_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_convert_simple_object_interface.cc
index 5664fb0..f62c57c 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_convert_simple_object_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_convert_simple_object_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_convert_simple_object_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_convert_simple_object_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_convert_simple_object_interface.h
index c69316d..7ebebd7 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_convert_simple_object_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_convert_simple_object_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cConvertSimpleObjectInterface_h
 #define V8cConvertSimpleObjectInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_getter_setter_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_getter_setter_interface.cc
index f0644a0..865b1a7 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_getter_setter_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_getter_setter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_derived_getter_setter_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_getter_setter_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_getter_setter_interface.h
index 01d2d3a..1fb8649 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_getter_setter_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_getter_setter_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cDerivedGetterSetterInterface_h
 #define V8cDerivedGetterSetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_interface.cc
index 8b10965..1e1f37b 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_derived_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_interface.h
index b4bbd7d..5e1ace8 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_derived_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cDerivedInterface_h
 #define V8cDerivedInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_interface.cc
index 5f00dd7..6e389bd 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_dictionary_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_interface.h
index 51f7953..92958c5 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dictionary_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cDictionaryInterface_h
 #define V8cDictionaryInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_disabled_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_disabled_interface.cc
index 7fc8aa6..cb69572 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_disabled_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_disabled_interface.cc
@@ -19,11 +19,9 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
-
-// This must be included above the check for NO_ENABLE_CONDITIONAL_INTERFACE, since
-// NO_ENABLE_CONDITIONAL_INTERFACE may be defined within.
 #include "cobalt/bindings/shared/idl_conditional_macros.h"
 
+
 #if defined(NO_ENABLE_CONDITIONAL_INTERFACE)
 
 #include "cobalt/bindings/testing/v8c_disabled_interface.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_disabled_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_disabled_interface.h
index 7b3ad3d..0c31d5c 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_disabled_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_disabled_interface.h
@@ -21,11 +21,9 @@
 #ifndef V8cDisabledInterface_h
 #define V8cDisabledInterface_h
 
-
-// This must be included above the check for NO_ENABLE_CONDITIONAL_INTERFACE, since
-// NO_ENABLE_CONDITIONAL_INTERFACE may be defined within.
 #include "cobalt/bindings/shared/idl_conditional_macros.h"
 
+
 #if defined(NO_ENABLE_CONDITIONAL_INTERFACE)
 
 #include "base/containers/hash_tables.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dom_string_test_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dom_string_test_interface.cc
index a2667c0..624ea31 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dom_string_test_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dom_string_test_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_dom_string_test_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dom_string_test_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dom_string_test_interface.h
index 6384586..c5aad0b 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dom_string_test_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_dom_string_test_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cDOMStringTestInterface_h
 #define V8cDOMStringTestInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_enumeration_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_enumeration_interface.cc
index 135dd75..85ddfc5 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_enumeration_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_enumeration_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_enumeration_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_enumeration_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_enumeration_interface.h
index cf24d90..d73065e 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_enumeration_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_enumeration_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cEnumerationInterface_h
 #define V8cEnumerationInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exception_object_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exception_object_interface.cc
index 2788405..2a19a04 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exception_object_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exception_object_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_exception_object_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exception_object_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exception_object_interface.h
index 984a52a..1339aa9 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exception_object_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exception_object_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cExceptionObjectInterface_h
 #define V8cExceptionObjectInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exceptions_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exceptions_interface.cc
index 377577c..9da312f 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exceptions_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exceptions_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_exceptions_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exceptions_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exceptions_interface.h
index d789d3a..6bc6d67 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exceptions_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_exceptions_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cExceptionsInterface_h
 #define V8cExceptionsInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_extended_idl_attributes_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_extended_idl_attributes_interface.cc
index fd87e3c..ef85bf5 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_extended_idl_attributes_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_extended_idl_attributes_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_extended_idl_attributes_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_extended_idl_attributes_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_extended_idl_attributes_interface.h
index 6271f2e..6602dbf 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_extended_idl_attributes_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_extended_idl_attributes_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cExtendedIDLAttributesInterface_h
 #define V8cExtendedIDLAttributesInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_garbage_collection_test_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_garbage_collection_test_interface.cc
index bc16d72..50cbe7c 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_garbage_collection_test_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_garbage_collection_test_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_garbage_collection_test_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_garbage_collection_test_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_garbage_collection_test_interface.h
index fe684e4..1ff4c8e 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_garbage_collection_test_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_garbage_collection_test_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cGarbageCollectionTestInterface_h
 #define V8cGarbageCollectionTestInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_global_interface_parent.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_global_interface_parent.cc
index b4662a5..b07760f 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_global_interface_parent.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_global_interface_parent.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_global_interface_parent.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_global_interface_parent.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_global_interface_parent.h
index 1a7d6f7..5ac5a63 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_global_interface_parent.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_global_interface_parent.h
@@ -21,6 +21,8 @@
 #ifndef V8cGlobalInterfaceParent_h
 #define V8cGlobalInterfaceParent_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_indexed_getter_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_indexed_getter_interface.cc
index eba4334..5588dc1 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_indexed_getter_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_indexed_getter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_indexed_getter_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_indexed_getter_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_indexed_getter_interface.h
index 0187f96..19c69bd 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_indexed_getter_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_indexed_getter_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cIndexedGetterInterface_h
 #define V8cIndexedGetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any.cc
index 768bfa1..19e7249 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_interface_with_any.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any.h
index 190490a..7a0d778 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any.h
@@ -21,6 +21,8 @@
 #ifndef V8cInterfaceWithAny_h
 #define V8cInterfaceWithAny_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any_dictionary.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any_dictionary.cc
index 00d3d09..89200e8 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any_dictionary.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any_dictionary.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_interface_with_any_dictionary.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any_dictionary.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any_dictionary.h
index 333f4b4..b733499 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any_dictionary.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_any_dictionary.h
@@ -21,6 +21,8 @@
 #ifndef V8cInterfaceWithAnyDictionary_h
 #define V8cInterfaceWithAnyDictionary_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_date.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_date.cc
index fc82f47..69c9991 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_date.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_date.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_interface_with_date.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_date.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_date.h
index 340a4c2..b349e28 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_date.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_date.h
@@ -21,6 +21,8 @@
 #ifndef V8cInterfaceWithDate_h
 #define V8cInterfaceWithDate_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_unsupported_properties.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_unsupported_properties.cc
index 6501035..76f8964 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_unsupported_properties.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_unsupported_properties.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_interface_with_unsupported_properties.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_unsupported_properties.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_unsupported_properties.h
index 9ddc4d8..05c4040 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_unsupported_properties.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_interface_with_unsupported_properties.h
@@ -21,6 +21,8 @@
 #ifndef V8cInterfaceWithUnsupportedProperties_h
 #define V8cInterfaceWithUnsupportedProperties_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_constructor_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_constructor_interface.cc
index c6f3bca..60b60c8 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_constructor_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_constructor_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_named_constructor_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_constructor_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_constructor_interface.h
index cd202ed..a654d92 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_constructor_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_constructor_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cNamedConstructorInterface_h
 #define V8cNamedConstructorInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_getter_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_getter_interface.cc
index a43ad8a..d663fc2 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_getter_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_getter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_named_getter_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_getter_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_getter_interface.h
index 6eefa60..6a01065 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_getter_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_getter_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cNamedGetterInterface_h
 #define V8cNamedGetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_indexed_getter_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_indexed_getter_interface.cc
index 64ee1a1..e38e088 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_indexed_getter_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_indexed_getter_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_named_indexed_getter_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_indexed_getter_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_indexed_getter_interface.h
index 58ce28e..83e9df6 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_indexed_getter_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_named_indexed_getter_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cNamedIndexedGetterInterface_h
 #define V8cNamedIndexedGetterInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nested_put_forwards_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nested_put_forwards_interface.cc
index 1f18cd9..d01a524 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nested_put_forwards_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nested_put_forwards_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_nested_put_forwards_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nested_put_forwards_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nested_put_forwards_interface.h
index 2a4dba8..82f8616 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nested_put_forwards_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nested_put_forwards_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cNestedPutForwardsInterface_h
 #define V8cNestedPutForwardsInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_constructor_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_constructor_interface.cc
index 647820e..a451d14 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_constructor_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_constructor_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_no_constructor_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_constructor_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_constructor_interface.h
index 4046716..b734dad 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_constructor_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_constructor_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cNoConstructorInterface_h
 #define V8cNoConstructorInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_interface_object_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_interface_object_interface.cc
index 96fb26e..8107531 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_interface_object_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_interface_object_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_no_interface_object_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_interface_object_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_interface_object_interface.h
index a33e946..162681a 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_interface_object_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_no_interface_object_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cNoInterfaceObjectInterface_h
 #define V8cNoInterfaceObjectInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nullable_types_test_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nullable_types_test_interface.cc
index f00f2c3..d1e376e 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nullable_types_test_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nullable_types_test_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_nullable_types_test_interface.h"
 
 #include "base/trace_event/trace_event.h"
@@ -27,6 +29,7 @@
 #include "cobalt/script/script_value.h"
 #include "cobalt/script/value_handle.h"
 #include "cobalt/bindings/testing/arbitrary_interface.h"
+#include "cobalt/bindings/testing/test_dictionary.h"
 #include "cobalt/bindings/testing/v8c_arbitrary_interface.h"
 
 #include "v8c_gen_type_conversion.h"
@@ -57,6 +60,7 @@
 using cobalt::bindings::testing::NullableTypesTestInterface;
 using cobalt::bindings::testing::V8cNullableTypesTestInterface;
 using cobalt::bindings::testing::ArbitraryInterface;
+using cobalt::bindings::testing::TestDictionary;
 using cobalt::bindings::testing::V8cArbitraryInterface;
 using cobalt::script::CallbackInterfaceTraits;
 using cobalt::script::GlobalEnvironment;
@@ -338,6 +342,82 @@
 }
 
 
+void nullableDictionaryPropertyAttributeGetter(
+    const v8::FunctionCallbackInfo<v8::Value>& info) {
+  v8::Isolate* isolate = info.GetIsolate();
+  v8::Local<v8::Object> object = info.Holder();
+
+
+  V8cGlobalEnvironment* global_environment = V8cGlobalEnvironment::GetFromIsolate(isolate);
+  WrapperFactory* wrapper_factory = global_environment->wrapper_factory();
+  if (!WrapperPrivate::HasWrapperPrivate(object) ||
+      !V8cNullableTypesTestInterface::GetTemplate(isolate)->HasInstance(object)) {
+    V8cExceptionState exception(isolate);
+    exception.SetSimpleException(script::kDoesNotImplementInterface);
+    return;
+  }
+  V8cExceptionState exception_state{isolate};
+  v8::Local<v8::Value> result_value;
+
+  WrapperPrivate* wrapper_private =
+      WrapperPrivate::GetFromWrapperObject(object);
+  if (!wrapper_private) {
+    NOTIMPLEMENTED();
+    return;
+  }
+  NullableTypesTestInterface* impl =
+      wrapper_private->wrappable<NullableTypesTestInterface>().get();
+
+
+  if (!exception_state.is_exception_set()) {
+    ToJSValue(isolate,
+              impl->nullable_dictionary_property(),
+              &result_value);
+  }
+  if (exception_state.is_exception_set()) {
+    return;
+  }
+  info.GetReturnValue().Set(result_value);
+}
+
+void nullableDictionaryPropertyAttributeSetter(
+    const v8::FunctionCallbackInfo<v8::Value>& info) {
+  v8::Isolate* isolate = info.GetIsolate();
+  v8::Local<v8::Object> object = info.Holder();
+  v8::Local<v8::Value> v8_value = info[0];
+
+  V8cGlobalEnvironment* global_environment = V8cGlobalEnvironment::GetFromIsolate(isolate);
+  WrapperFactory* wrapper_factory = global_environment->wrapper_factory();
+  if (!WrapperPrivate::HasWrapperPrivate(object) ||
+      !V8cNullableTypesTestInterface::GetTemplate(isolate)->HasInstance(object)) {
+    V8cExceptionState exception(isolate);
+    exception.SetSimpleException(script::kDoesNotImplementInterface);
+    return;
+  }
+  V8cExceptionState exception_state{isolate};
+  v8::Local<v8::Value> result_value;
+
+  WrapperPrivate* wrapper_private =
+      WrapperPrivate::GetFromWrapperObject(object);
+  if (!wrapper_private) {
+    NOTIMPLEMENTED();
+    return;
+  }
+  NullableTypesTestInterface* impl =
+      wrapper_private->wrappable<NullableTypesTestInterface>().get();
+  TypeTraits<base::Optional<TestDictionary > >::ConversionType value;
+  FromJSValue(isolate, v8_value, (kConversionFlagNullable), &exception_state,
+              &value);
+  if (exception_state.is_exception_set()) {
+    return;
+  }
+
+  impl->set_nullable_dictionary_property(value);
+  result_value = v8::Undefined(isolate);
+  return;
+}
+
+
 void nullableObjectPropertyAttributeGetter(
     const v8::FunctionCallbackInfo<v8::Value>& info) {
   v8::Isolate* isolate = info.GetIsolate();
@@ -497,6 +577,88 @@
 
 
 
+void nullableDictionaryArgumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
+  v8::Isolate* isolate = info.GetIsolate();
+  v8::Local<v8::Object> object = info.Holder();
+  V8cGlobalEnvironment* global_environment = V8cGlobalEnvironment::GetFromIsolate(isolate);
+  WrapperFactory* wrapper_factory = global_environment->wrapper_factory();
+  if (!WrapperPrivate::HasWrapperPrivate(object) ||
+      !V8cNullableTypesTestInterface::GetTemplate(isolate)->HasInstance(object)) {
+    V8cExceptionState exception(isolate);
+    exception.SetSimpleException(script::kDoesNotImplementInterface);
+    return;
+  }
+  V8cExceptionState exception_state{isolate};
+  v8::Local<v8::Value> result_value;
+
+  WrapperPrivate* wrapper_private =
+      WrapperPrivate::GetFromWrapperObject(object);
+  if (!wrapper_private) {
+    NOTIMPLEMENTED();
+    return;
+  }
+  NullableTypesTestInterface* impl =
+      wrapper_private->wrappable<NullableTypesTestInterface>().get();
+  const size_t kMinArguments = 1;
+  if (info.Length() < kMinArguments) {
+    exception_state.SetSimpleException(script::kInvalidNumberOfArguments);
+    return;
+  }
+  // Non-optional arguments
+  TypeTraits<base::Optional<TestDictionary > >::ConversionType arg;
+  DCHECK_LT(0, info.Length());
+  v8::Local<v8::Value> non_optional_value0 = info[0];
+  FromJSValue(isolate,
+              non_optional_value0,
+              (kConversionFlagNullable),
+              &exception_state, &arg);
+  if (exception_state.is_exception_set()) {
+    return;
+  }
+
+  impl->NullableDictionaryArgument(arg);
+  result_value = v8::Undefined(isolate);
+
+}
+
+
+
+void nullableDictionaryOperationMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
+  v8::Isolate* isolate = info.GetIsolate();
+  v8::Local<v8::Object> object = info.Holder();
+  V8cGlobalEnvironment* global_environment = V8cGlobalEnvironment::GetFromIsolate(isolate);
+  WrapperFactory* wrapper_factory = global_environment->wrapper_factory();
+  if (!WrapperPrivate::HasWrapperPrivate(object) ||
+      !V8cNullableTypesTestInterface::GetTemplate(isolate)->HasInstance(object)) {
+    V8cExceptionState exception(isolate);
+    exception.SetSimpleException(script::kDoesNotImplementInterface);
+    return;
+  }
+  V8cExceptionState exception_state{isolate};
+  v8::Local<v8::Value> result_value;
+
+  WrapperPrivate* wrapper_private =
+      WrapperPrivate::GetFromWrapperObject(object);
+  if (!wrapper_private) {
+    NOTIMPLEMENTED();
+    return;
+  }
+  NullableTypesTestInterface* impl =
+      wrapper_private->wrappable<NullableTypesTestInterface>().get();
+
+  if (!exception_state.is_exception_set()) {
+    ToJSValue(isolate,
+              impl->NullableDictionaryOperation(),
+              &result_value);
+  }
+  if (!exception_state.is_exception_set()) {
+    info.GetReturnValue().Set(result_value);
+  }
+
+}
+
+
+
 void nullableNumericArgumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
   v8::Isolate* isolate = info.GetIsolate();
   v8::Local<v8::Object> object = info.Holder();
@@ -908,6 +1070,42 @@
     // The name of the property is the identifier of the attribute.
     v8::Local<v8::String> name = NewInternalString(
         isolate,
+        "nullableDictionaryProperty");
+
+    // The property has attributes { [[Get]]: G, [[Set]]: S, [[Enumerable]]:
+    // true, [[Configurable]]: configurable }, where: configurable is false if
+    // the attribute was declared with the [Unforgeable] extended attribute and
+    // true otherwise;
+    bool configurable = true;
+    v8::PropertyAttribute attributes = static_cast<v8::PropertyAttribute>(
+        configurable ? v8::None : v8::DontDelete);
+
+    // G is the attribute getter created given the attribute, the interface, and
+    // the relevant Realm of the object that is the location of the property;
+    // and
+    //
+    // S is the attribute setter created given the attribute, the interface, and
+    // the relevant Realm of the object that is the location of the property.
+    v8::Local<v8::FunctionTemplate> getter =
+        v8::FunctionTemplate::New(isolate, nullableDictionaryPropertyAttributeGetter);
+    v8::Local<v8::FunctionTemplate> setter =
+        v8::FunctionTemplate::New(isolate, nullableDictionaryPropertyAttributeSetter);
+
+    // The location of the property is determined as follows:
+    // Otherwise, the property exists solely on the interface's interface
+    // prototype object.
+    prototype_template->
+        SetAccessorProperty(
+            name,
+            getter,
+            setter,
+            attributes);
+
+  }
+  {
+    // The name of the property is the identifier of the attribute.
+    v8::Local<v8::String> name = NewInternalString(
+        isolate,
         "nullableObjectProperty");
 
     // The property has attributes { [[Get]]: G, [[Set]]: S, [[Enumerable]]:
@@ -1020,6 +1218,72 @@
     // The name of the property is the identifier.
     v8::Local<v8::String> name = NewInternalString(
         isolate,
+        "nullableDictionaryArgument");
+
+    // The property has attributes { [[Writable]]: B, [[Enumerable]]: true,
+    // [[Configurable]]: B }, where B is false if the operation is unforgeable
+    // on the interface, and true otherwise.
+    bool B = true;
+    v8::PropertyAttribute attributes = static_cast<v8::PropertyAttribute>(
+        B ? v8::None : (v8::ReadOnly | v8::DontDelete));
+
+    v8::Local<v8::FunctionTemplate> method_template =
+        v8::FunctionTemplate::New(isolate, nullableDictionaryArgumentMethod);
+    method_template->RemovePrototype();
+    method_template->SetLength(1);
+
+    // The location of the property is determined as follows:
+    // Otherwise, the property exists solely on the interface's interface
+    // prototype object.
+    prototype_template->
+        Set(name, method_template);
+
+    // The value of the property is the result of creating an operation function
+    // given the operation, the interface, and the relevant Realm of the object
+    // that is the location of the property.
+
+    // Note: that is, even if an includes statement was used to make an
+    // operation available on the interface, we pass in the interface which
+    // includes the interface mixin, and not the interface mixin on which the
+    // operation was originally declared.
+  }
+  {
+    // The name of the property is the identifier.
+    v8::Local<v8::String> name = NewInternalString(
+        isolate,
+        "nullableDictionaryOperation");
+
+    // The property has attributes { [[Writable]]: B, [[Enumerable]]: true,
+    // [[Configurable]]: B }, where B is false if the operation is unforgeable
+    // on the interface, and true otherwise.
+    bool B = true;
+    v8::PropertyAttribute attributes = static_cast<v8::PropertyAttribute>(
+        B ? v8::None : (v8::ReadOnly | v8::DontDelete));
+
+    v8::Local<v8::FunctionTemplate> method_template =
+        v8::FunctionTemplate::New(isolate, nullableDictionaryOperationMethod);
+    method_template->RemovePrototype();
+    method_template->SetLength(0);
+
+    // The location of the property is determined as follows:
+    // Otherwise, the property exists solely on the interface's interface
+    // prototype object.
+    prototype_template->
+        Set(name, method_template);
+
+    // The value of the property is the result of creating an operation function
+    // given the operation, the interface, and the relevant Realm of the object
+    // that is the location of the property.
+
+    // Note: that is, even if an includes statement was used to make an
+    // operation available on the interface, we pass in the interface which
+    // includes the interface mixin, and not the interface mixin on which the
+    // operation was originally declared.
+  }
+  {
+    // The name of the property is the identifier.
+    v8::Local<v8::String> name = NewInternalString(
+        isolate,
         "nullableNumericArgument");
 
     // The property has attributes { [[Writable]]: B, [[Enumerable]]: true,
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nullable_types_test_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nullable_types_test_interface.h
index f480aef..05c2a0e 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nullable_types_test_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_nullable_types_test_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cNullableTypesTestInterface_h
 #define V8cNullableTypesTestInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_numeric_types_test_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_numeric_types_test_interface.cc
index f1e4dee..d63da1b 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_numeric_types_test_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_numeric_types_test_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_numeric_types_test_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_numeric_types_test_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_numeric_types_test_interface.h
index 5c0baf5..c12d014 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_numeric_types_test_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_numeric_types_test_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cNumericTypesTestInterface_h
 #define V8cNumericTypesTestInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_object_type_bindings_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_object_type_bindings_interface.cc
index 59cdc0d..4162e1d 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_object_type_bindings_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_object_type_bindings_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_object_type_bindings_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_object_type_bindings_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_object_type_bindings_interface.h
index 2c9b262..68527cd 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_object_type_bindings_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_object_type_bindings_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cObjectTypeBindingsInterface_h
 #define V8cObjectTypeBindingsInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_operations_test_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_operations_test_interface.cc
index 60239cc..fb718c6 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_operations_test_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_operations_test_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_operations_test_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_operations_test_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_operations_test_interface.h
index e309a04..f5c8bca 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_operations_test_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_operations_test_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cOperationsTestInterface_h
 #define V8cOperationsTestInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_promise_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_promise_interface.cc
index 28cfd45..be33c06 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_promise_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_promise_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_promise_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_promise_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_promise_interface.h
index 0c6ac25..3867345 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_promise_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_promise_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cPromiseInterface_h
 #define V8cPromiseInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_put_forwards_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_put_forwards_interface.cc
index e8455c3..3387251 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_put_forwards_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_put_forwards_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_put_forwards_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_put_forwards_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_put_forwards_interface.h
index 90fb786..811f9e5 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_put_forwards_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_put_forwards_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cPutForwardsInterface_h
 #define V8cPutForwardsInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_sequence_user.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_sequence_user.cc
index 691712f..6598389 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_sequence_user.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_sequence_user.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_sequence_user.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_sequence_user.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_sequence_user.h
index 75565c3..d7c543f 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_sequence_user.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_sequence_user.h
@@ -21,6 +21,8 @@
 #ifndef V8cSequenceUser_h
 #define V8cSequenceUser_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_static_properties_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_static_properties_interface.cc
index f67bbe1..ed60f65 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_static_properties_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_static_properties_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_static_properties_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_static_properties_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_static_properties_interface.h
index 5f07e01..0bc2dbb 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_static_properties_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_static_properties_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cStaticPropertiesInterface_h
 #define V8cStaticPropertiesInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_anonymous_operation_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_anonymous_operation_interface.cc
index 951a540..7affa31 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_anonymous_operation_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_anonymous_operation_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_stringifier_anonymous_operation_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_anonymous_operation_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_anonymous_operation_interface.h
index fafbe1e..67b5026 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_anonymous_operation_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_anonymous_operation_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cStringifierAnonymousOperationInterface_h
 #define V8cStringifierAnonymousOperationInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_attribute_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_attribute_interface.cc
index ed73f86..58269d7 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_attribute_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_attribute_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_stringifier_attribute_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_attribute_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_attribute_interface.h
index 55be7da..03490de 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_attribute_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_attribute_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cStringifierAttributeInterface_h
 #define V8cStringifierAttributeInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_operation_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_operation_interface.cc
index ec0e463..043c675 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_operation_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_operation_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_stringifier_operation_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_operation_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_operation_interface.h
index 0d74439..386095c 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_operation_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_stringifier_operation_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cStringifierOperationInterface_h
 #define V8cStringifierOperationInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_target_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_target_interface.cc
index 9fdbde9..f1fa8a8 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_target_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_target_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_target_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_target_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_target_interface.h
index eeb2644..9827702 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_target_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_target_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cTargetInterface_h
 #define V8cTargetInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_union_types_interface.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_union_types_interface.cc
index 34421e7..b1f1049 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_union_types_interface.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_union_types_interface.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_union_types_interface.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_union_types_interface.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_union_types_interface.h
index 6018b89..9f964bd 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_union_types_interface.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_union_types_interface.h
@@ -21,6 +21,8 @@
 #ifndef V8cUnionTypesInterface_h
 #define V8cUnionTypesInterface_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.cc
index fc592cc..3aef49e 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.cc
@@ -19,6 +19,8 @@
 // This file has been auto-generated by bindings/code_generator_cobalt.py. DO NOT MODIFY!
 // Auto-generated from template: bindings/v8c/templates/interface.cc.template
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "cobalt/bindings/testing/v8c_window.h"
 
 #include "base/trace_event/trace_event.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.h b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.h
index 76b36f6..a03b0e4 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.h
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.h
@@ -21,6 +21,8 @@
 #ifndef V8cWindow_h
 #define V8cWindow_h
 
+#include "cobalt/bindings/shared/idl_conditional_macros.h"
+
 #include "base/containers/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "base/memory/ref_counted.h"
diff --git a/src/cobalt/bindings/shared/idl_conditional_macros.h b/src/cobalt/bindings/shared/idl_conditional_macros.h
index 42763eb..c4ee247 100644
--- a/src/cobalt/bindings/shared/idl_conditional_macros.h
+++ b/src/cobalt/bindings/shared/idl_conditional_macros.h
@@ -29,4 +29,10 @@
 #define COBALT_ENABLE_ON_SCREEN_KEYBOARD
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
 
+#if SB_API_VERSION >= 11
+// This is used to conditionally define setMaxVideoCapabilities() in
+// HTMLVideoElement.
+#define COBALT_ENABLE_SET_MAX_VIDEO_CAPABILITIES
+#endif  // SB_HAS(ON_SCREEN_KEYBOARD)
+
 #endif  // COBALT_BINDINGS_SHARED_IDL_CONDITIONAL_MACROS_H_
diff --git a/src/cobalt/bindings/templates/dictionary.h.template b/src/cobalt/bindings/templates/dictionary.h.template
index 8b9085d..e1f9de0 100644
--- a/src/cobalt/bindings/templates/dictionary.h.template
+++ b/src/cobalt/bindings/templates/dictionary.h.template
@@ -71,20 +71,31 @@
 {% else %}
 class {{class_name}} {
 {% endif %}
- public:
-  {{class_name}}() {
+{% set initializer_list = [] %}
 {% for member in members %}
 {% if not member.default_value %}
-    has_{{member.name}}_ = false;
+{% do initializer_list.append(("has_" + member.name, "false")) %}
 {% endif %}
 {% if not member.is_script_value %}
 {% if member.default_value %}
-    {{member.name}}_ = {{member.default_value}};
+{% do initializer_list.append((member.name, member.default_value)) %}
 {% else %}
-    {{member.name}}_ = {{member.type}}();
+{% do initializer_list.append((member.name, member.type + "()")) %}
 {% endif %}
 {% endif %}
 {% endfor %}
+{% if initializer_list %}
+{% set formatted_initializer_list = [] %}
+{% for name, value in initializer_list %}
+{% do formatted_initializer_list.append(name + "_(" + value + ")") %}
+{% endfor %}
+ public:
+  {{class_name}}()
+    : {{ formatted_initializer_list|join(',\n      ') }} {
+{% else %}
+ public:
+  {{class_name}}() {
+{% endif %}
   }
 
 {% if parent %}
diff --git a/src/cobalt/bindings/templates/interface-base.cc.template b/src/cobalt/bindings/templates/interface-base.cc.template
index 1b3c5dc..a526b85 100644
--- a/src/cobalt/bindings/templates/interface-base.cc.template
+++ b/src/cobalt/bindings/templates/interface-base.cc.template
@@ -32,12 +32,14 @@
 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY!
 // Auto-generated from template: {{template_path}}
 
-{% if conditional %}
-
-// This must be included above the check for {{conditional}}, since
-// {{conditional}} may be defined within.
+{#
+ # This must be included above the check for {{conditional}}, since
+ # {{conditional}} may be defined within.
+ #}
 #include "cobalt/bindings/shared/idl_conditional_macros.h"
 
+{% if conditional %}
+
 #if defined({{conditional}})
 
 {% endif %}
diff --git a/src/cobalt/bindings/templates/interface-base.h.template b/src/cobalt/bindings/templates/interface-base.h.template
index 7f3305c..7e37d5e 100644
--- a/src/cobalt/bindings/templates/interface-base.h.template
+++ b/src/cobalt/bindings/templates/interface-base.h.template
@@ -35,12 +35,14 @@
 #ifndef {{binding_class}}_h
 #define {{binding_class}}_h
 
-{% if conditional %}
-
-// This must be included above the check for {{conditional}}, since
-// {{conditional}} may be defined within.
+{#
+ # This must be included above the check for {{conditional}}, since
+ # {{conditional}} may be defined within.
+ #}
 #include "cobalt/bindings/shared/idl_conditional_macros.h"
 
+{% if conditional %}
+
 #if defined({{conditional}})
 
 {% endif %}
diff --git a/src/cobalt/bindings/testing/nullable_types_bindings_test.cc b/src/cobalt/bindings/testing/nullable_types_bindings_test.cc
index 2512e13..189dfd6 100644
--- a/src/cobalt/bindings/testing/nullable_types_bindings_test.cc
+++ b/src/cobalt/bindings/testing/nullable_types_bindings_test.cc
@@ -29,6 +29,43 @@
     NullableTypesBindingsTest;
 }  // namespace
 
+// EXPECT_CALL needs a compare operator to check the parameter.
+bool operator==(const TestDictionary& a, const TestDictionary& b) {
+  // clang-format off
+  return
+      (!a.has_boolean_member()
+           ? !b.has_boolean_member()
+           : a.boolean_member() == b.boolean_member()) &&
+      (!a.has_short_clamp_member()
+           ? !b.has_short_clamp_member()
+           : a.short_clamp_member() == b.short_clamp_member()) &&
+      (!a.has_long_member()
+           ? !b.has_long_member()
+           : a.long_member() == b.long_member()) &&
+      (!a.has_double_member()
+           ? !b.has_double_member()
+           : a.double_member() == b.double_member()) &&
+      (!a.has_string_member()
+           ? !b.has_string_member()
+           : a.string_member() == b.string_member()) &&
+      (!a.has_interface_member()
+           ? !b.has_interface_member()
+           : a.interface_member() == b.interface_member()) &&
+      (!a.has_member_with_default()
+           ? !b.has_member_with_default()
+           : a.member_with_default() == b.member_with_default()) &&
+      (!a.has_non_default_member()
+           ? !b.has_non_default_member()
+           : a.non_default_member() == b.non_default_member()) &&
+      (!a.has_any_member_with_default()
+           ? !b.has_any_member_with_default()
+           : a.any_member_with_default() == b.any_member_with_default()) &&
+      (!a.has_any_member()
+           ? !b.has_any_member()
+           : a.any_member() == b.any_member());
+  // clang-format on
+}
+
 TEST_F(NullableTypesBindingsTest, GetNullProperty) {
   InSequence in_sequence_dummy;
   std::string result;
@@ -50,6 +87,12 @@
   EXPECT_TRUE(EvaluateScript("test.nullableStringProperty === null;", &result));
   EXPECT_STREQ("true", result.c_str());
 
+  EXPECT_CALL(test_mock(), nullable_dictionary_property())
+      .WillOnce(Return(base::nullopt));
+  EXPECT_TRUE(
+      EvaluateScript("test.nullableDictionaryProperty === null;", &result));
+  EXPECT_STREQ("true", result.c_str());
+
   EXPECT_CALL(test_mock(), nullable_object_property())
       .WillOnce(Return(scoped_refptr<ArbitraryInterface>()));
   EXPECT_TRUE(EvaluateScript("test.nullableObjectProperty === null;", &result));
@@ -77,6 +120,14 @@
       EvaluateScript("test.nullableStringProperty === \"foo\";", &result));
   EXPECT_STREQ("true", result.c_str());
 
+  TestDictionary test_dictionary;
+  test_dictionary.set_string_member("foobar");
+  EXPECT_CALL(test_mock(), nullable_dictionary_property())
+      .WillOnce(Return(base::Optional<TestDictionary>(test_dictionary)));
+  EXPECT_TRUE(
+      EvaluateScript("test.nullableDictionaryProperty.stringMember;", &result));
+  EXPECT_STREQ("foobar", result.c_str());
+
   EXPECT_CALL(test_mock(), nullable_object_property())
       .WillOnce(Return(base::WrapRefCounted(new ArbitraryInterface())));
   EXPECT_TRUE(
@@ -107,6 +158,12 @@
       EvaluateScript("test.nullableStringOperation() === null;", &result));
   EXPECT_STREQ("true", result.c_str());
 
+  EXPECT_CALL(test_mock(), NullableDictionaryOperation())
+      .WillOnce(Return(base::nullopt));
+  EXPECT_TRUE(
+      EvaluateScript("test.nullableDictionaryOperation() === null;", &result));
+  EXPECT_STREQ("true", result.c_str());
+
   EXPECT_CALL(test_mock(), NullableObjectOperation())
       .WillOnce(Return(scoped_refptr<ArbitraryInterface>()));
   EXPECT_TRUE(
@@ -136,6 +193,14 @@
       EvaluateScript("test.nullableStringOperation() === \"foo\";", &result));
   EXPECT_STREQ("true", result.c_str());
 
+  TestDictionary test_dictionary;
+  test_dictionary.set_string_member("foobar");
+  EXPECT_CALL(test_mock(), NullableDictionaryOperation())
+      .WillOnce(Return(base::Optional<TestDictionary>(test_dictionary)));
+  EXPECT_TRUE(EvaluateScript("test.nullableDictionaryOperation().stringMember;",
+                             &result));
+  EXPECT_STREQ("foobar", result.c_str());
+
   EXPECT_CALL(test_mock(), NullableObjectOperation())
       .WillOnce(Return(base::WrapRefCounted(new ArbitraryInterface())));
   EXPECT_TRUE(
@@ -159,6 +224,10 @@
               set_nullable_string_property(base::Optional<std::string>()));
   EXPECT_TRUE(EvaluateScript("test.nullableStringProperty = null;", NULL));
 
+  EXPECT_CALL(test_mock(), set_nullable_dictionary_property(
+                               base::Optional<TestDictionary>()));
+  EXPECT_TRUE(EvaluateScript("test.nullableDictionaryProperty = null;", NULL));
+
   EXPECT_CALL(test_mock(), set_nullable_object_property(
                                scoped_refptr<ArbitraryInterface>()));
   EXPECT_TRUE(EvaluateScript("test.nullableObjectProperty = null;", NULL));
@@ -179,6 +248,14 @@
               set_nullable_string_property(base::Optional<std::string>("foo")));
   EXPECT_TRUE(EvaluateScript("test.nullableStringProperty = \"foo\";", NULL));
 
+  TestDictionary test_dictionary;
+  test_dictionary.set_string_member("foobar");
+  EXPECT_CALL(test_mock(),
+              set_nullable_dictionary_property(
+                  base::Optional<TestDictionary>(test_dictionary)));
+  EXPECT_TRUE(EvaluateScript(
+      "test.nullableDictionaryProperty = {stringMember: \"foobar\"};", NULL));
+
   scoped_refptr<ArbitraryInterface> mock_interface = new ArbitraryInterface();
   EXPECT_CALL(test_mock(), NullableObjectOperation())
       .WillOnce(Return(mock_interface));
@@ -201,6 +278,10 @@
   EXPECT_TRUE(EvaluateScript("test.nullableStringArgument(null);", NULL));
 
   EXPECT_CALL(test_mock(),
+              NullableDictionaryArgument(base::Optional<TestDictionary>()));
+  EXPECT_TRUE(EvaluateScript("test.nullableDictionaryArgument(null);", NULL));
+
+  EXPECT_CALL(test_mock(),
               NullableObjectArgument(scoped_refptr<ArbitraryInterface>()));
   EXPECT_TRUE(EvaluateScript("test.nullableObjectArgument(null);", NULL));
 }
@@ -218,6 +299,14 @@
               NullableStringArgument(base::Optional<std::string>("foo")));
   EXPECT_TRUE(EvaluateScript("test.nullableStringArgument(\"foo\");", NULL));
 
+  TestDictionary test_dictionary;
+  test_dictionary.set_string_member("foobar");
+  EXPECT_CALL(test_mock(),
+              NullableDictionaryArgument(
+                  base::Optional<TestDictionary>(test_dictionary)));
+  EXPECT_TRUE(EvaluateScript(
+      "test.nullableDictionaryArgument({stringMember: \"foobar\"});", NULL));
+
   scoped_refptr<ArbitraryInterface> mock_interface = new ArbitraryInterface();
   EXPECT_CALL(test_mock(), nullable_object_property())
       .WillOnce(Return(mock_interface));
diff --git a/src/cobalt/bindings/testing/nullable_types_test_interface.h b/src/cobalt/bindings/testing/nullable_types_test_interface.h
index d5233ed..6685f8b 100644
--- a/src/cobalt/bindings/testing/nullable_types_test_interface.h
+++ b/src/cobalt/bindings/testing/nullable_types_test_interface.h
@@ -20,6 +20,7 @@
 #include "base/memory/ref_counted.h"
 #include "base/optional.h"
 #include "cobalt/bindings/testing/arbitrary_interface.h"
+#include "cobalt/bindings/testing/test_dictionary.h"
 #include "cobalt/script/wrappable.h"
 #include "testing/gmock/include/gmock/gmock.h"
 
@@ -38,6 +39,10 @@
   MOCK_METHOD0(nullable_string_property, base::Optional<std::string>());
   MOCK_METHOD1(set_nullable_string_property, void(base::Optional<std::string>));
 
+  MOCK_METHOD0(nullable_dictionary_property, base::Optional<TestDictionary>());
+  MOCK_METHOD1(set_nullable_dictionary_property,
+               void(base::Optional<TestDictionary>));
+
   MOCK_METHOD0(nullable_object_property, scoped_refptr<ArbitraryInterface>());
   MOCK_METHOD1(set_nullable_object_property,
                void(scoped_refptr<ArbitraryInterface>));
@@ -45,11 +50,14 @@
   MOCK_METHOD0(NullableBooleanOperation, base::Optional<bool>());
   MOCK_METHOD0(NullableNumericOperation, base::Optional<int32_t>());
   MOCK_METHOD0(NullableStringOperation, base::Optional<std::string>());
+  MOCK_METHOD0(NullableDictionaryOperation, base::Optional<TestDictionary>());
   MOCK_METHOD0(NullableObjectOperation, scoped_refptr<ArbitraryInterface>());
 
   MOCK_METHOD1(NullableBooleanArgument, void(base::Optional<bool>));
   MOCK_METHOD1(NullableNumericArgument, void(base::Optional<int32_t>));
   MOCK_METHOD1(NullableStringArgument, void(base::Optional<std::string>));
+  MOCK_METHOD1(NullableDictionaryArgument,
+               void(base::Optional<TestDictionary>));
   MOCK_METHOD1(NullableObjectArgument, void(scoped_refptr<ArbitraryInterface>));
 
   DEFINE_WRAPPABLE_TYPE(NullableTypesTestInterface);
diff --git a/src/cobalt/bindings/testing/nullable_types_test_interface.idl b/src/cobalt/bindings/testing/nullable_types_test_interface.idl
index ddd57da..e9204b5 100644
--- a/src/cobalt/bindings/testing/nullable_types_test_interface.idl
+++ b/src/cobalt/bindings/testing/nullable_types_test_interface.idl
@@ -16,15 +16,18 @@
   attribute boolean? nullableBooleanProperty;
   attribute long? nullableNumericProperty;
   attribute DOMString? nullableStringProperty;
+  attribute TestDictionary? nullableDictionaryProperty;
   attribute ArbitraryInterface? nullableObjectProperty;
 
   boolean? nullableBooleanOperation();
   long? nullableNumericOperation();
   DOMString? nullableStringOperation();
+  TestDictionary? nullableDictionaryOperation();
   ArbitraryInterface? nullableObjectOperation();
 
   void nullableBooleanArgument(boolean? arg);
   void nullableNumericArgument(long? arg);
   void nullableStringArgument(DOMString? arg);
+  void nullableDictionaryArgument(TestDictionary? arg);
   void nullableObjectArgument(ArbitraryInterface? arg);
 };
diff --git a/src/cobalt/black_box_tests/black_box_cobalt_runner.py b/src/cobalt/black_box_tests/black_box_cobalt_runner.py
index 3810081..1ca3ea9 100644
--- a/src/cobalt/black_box_tests/black_box_cobalt_runner.py
+++ b/src/cobalt/black_box_tests/black_box_cobalt_runner.py
@@ -1,3 +1,17 @@
+# Copyright 2017 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 """The base class for black box tests."""
 
 from __future__ import absolute_import
diff --git a/src/cobalt/black_box_tests/black_box_tests.py b/src/cobalt/black_box_tests/black_box_tests.py
index a34a122..108972e 100644
--- a/src/cobalt/black_box_tests/black_box_tests.py
+++ b/src/cobalt/black_box_tests/black_box_tests.py
@@ -1,4 +1,4 @@
-# Copyright 2019 The Cobalt Authors. All Rights Reserved.
+# Copyright 2017 The Cobalt Authors. All Rights Reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@
 from cobalt.tools.automated_testing import cobalt_runner
 from proxy_server import ProxyServer
 from starboard.tools import abstract_launcher
+from starboard.tools import build
 
 _PORT_SELECTION_RETRY_LIMIT = 10
 _PORT_SELECTION_RANGE = [5000, 7000]
@@ -39,16 +40,18 @@
 _TESTS_NEEDING_SYSTEM_SIGNAL = [
     'cancel_sync_loads_when_suspended',
     'preload_font',
-    'timer_hit_in_preload',
-    'timer_hit_after_preload',
     'preload_visibility',
+    'signal_handler_doesnt_crash',
     'suspend_visibility',
+    'timer_hit_after_preload',
+    'timer_hit_in_preload',
 ]
 # These tests only need app launchers with webdriver.
 _TESTS_NO_SIGNAL = [
     'allow_eval',
     'disable_eval_with_csp',
     'persistent_cookie',
+    'web_debugger',
     'web_platform_tests',
 ]
 # Location of test files.
@@ -71,17 +74,23 @@
 
   def __init__(self, *args, **kwargs):
     super(BlackBoxTestCase, self).__init__(*args, **kwargs)
+    self.device_params = _device_params
+    self.platform_config = build.GetPlatformConfig(_device_params.platform)
+    self.cobalt_config = self.platform_config.GetApplicationConfiguration(
+        'cobalt')
 
   @classmethod
   def setUpClass(cls):
+    super(BlackBoxTestCase, cls).setUpClass()
     print('Running ' + cls.__name__)
 
   @classmethod
   def tearDownClass(cls):
+    super(BlackBoxTestCase, cls).tearDownClass()
     print('Done ' + cls.__name__)
 
-  def CreateCobaltRunner(self, url, target_params=[]):
-    all_target_params = target_params
+  def CreateCobaltRunner(self, url, target_params=None):
+    all_target_params = list(target_params) if target_params else []
     if _device_params.target_params is not None:
       all_target_params += _device_params.target_params
     new_runner = black_box_cobalt_runner.BlackBoxCobaltRunner(
@@ -147,7 +156,7 @@
   def Run(self):
     if self.proxy_port_number == '-1':
       return 1
-    logging.info('Using proxy port number: %s' % self.proxy_port_number)
+    logging.info('Using proxy port number: %s', self.proxy_port_number)
 
     with ProxyServer(port=self.proxy_port_number,
                      host_resolve_map=self.host_resolve_map):
@@ -174,7 +183,7 @@
           return port_number
         if i == _PORT_SELECTION_RETRY_LIMIT - 1:
           logging.error(
-              'Can not find unused port on target machine within %s attempts.' %
+              'Can not find unused port on target machine within %s attempts.',
               _PORT_SELECTION_RETRY_LIMIT)
           return -1
     finally:
diff --git a/src/cobalt/black_box_tests/tests/allow_eval.py b/src/cobalt/black_box_tests/tests/allow_eval.py
index 6e80467..3df2594 100644
--- a/src/cobalt/black_box_tests/tests/allow_eval.py
+++ b/src/cobalt/black_box_tests/tests/allow_eval.py
@@ -1,4 +1,16 @@
-"""Ensure that client page can use eval() when CSP is missing."""
+# Copyright 2017 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
 from __future__ import absolute_import
 from __future__ import division
@@ -11,6 +23,7 @@
 
 
 class AllowEvalTest(black_box_tests.BlackBoxTestCase):
+  """Ensure that client page can use eval() when CSP is missing."""
 
   def test_simple(self):
 
diff --git a/src/cobalt/black_box_tests/tests/disable_eval_with_csp.py b/src/cobalt/black_box_tests/tests/disable_eval_with_csp.py
index 978ac9f..45f22df 100644
--- a/src/cobalt/black_box_tests/tests/disable_eval_with_csp.py
+++ b/src/cobalt/black_box_tests/tests/disable_eval_with_csp.py
@@ -1,4 +1,16 @@
-"""Ensure that Cobalt prohibits eval() when CSP is present in client page."""
+# Copyright 2017 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
 from __future__ import absolute_import
 from __future__ import division
@@ -11,6 +23,7 @@
 
 
 class DisableEvalWithCSPTest(black_box_tests.BlackBoxTestCase):
+  """Ensure that Cobalt prohibits eval() when CSP is present in client page."""
 
   def test_simple(self):
 
diff --git a/src/cobalt/black_box_tests/tests/persistent_cookie.py b/src/cobalt/black_box_tests/tests/persistent_cookie.py
index a54e518..31da099 100644
--- a/src/cobalt/black_box_tests/tests/persistent_cookie.py
+++ b/src/cobalt/black_box_tests/tests/persistent_cookie.py
@@ -1,4 +1,16 @@
-"""Ensure that Cobalt can have persistent cookie across sessions/launches."""
+# Copyright 2017 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
 from __future__ import absolute_import
 from __future__ import division
@@ -14,6 +26,7 @@
 
 
 class PersistentCookieTest(black_box_tests.BlackBoxTestCase):
+  """Ensure that Cobalt can have persistent cookie across sessions/launches."""
 
   # The same page has to be used since cookie are stored per URL.
 
diff --git a/src/cobalt/black_box_tests/tests/preload_font.py b/src/cobalt/black_box_tests/tests/preload_font.py
index 24721c9..479d963 100644
--- a/src/cobalt/black_box_tests/tests/preload_font.py
+++ b/src/cobalt/black_box_tests/tests/preload_font.py
@@ -1,4 +1,16 @@
-"""Verify that fonts are loaded correctly after preload event."""
+# Copyright 2017 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
 from __future__ import absolute_import
 from __future__ import division
@@ -15,6 +27,7 @@
 
 
 class PreloadFontTest(black_box_tests.BlackBoxTestCase):
+  """Verify that fonts are loaded correctly after preload event."""
 
   def test_simple(self):
 
diff --git a/src/cobalt/black_box_tests/tests/preload_visibility.py b/src/cobalt/black_box_tests/tests/preload_visibility.py
index 3ff7ae8..eb0a148 100644
--- a/src/cobalt/black_box_tests/tests/preload_visibility.py
+++ b/src/cobalt/black_box_tests/tests/preload_visibility.py
@@ -1,4 +1,16 @@
-"""Set a JS timer that expires after exiting preload mode."""
+# Copyright 2017 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
 from __future__ import absolute_import
 from __future__ import division
@@ -11,6 +23,7 @@
 
 
 class PreloadVisibilityTest(black_box_tests.BlackBoxTestCase):
+  """Set a JS timer that expires after exiting preload mode."""
 
   def test_simple(self):
 
diff --git a/src/cobalt/black_box_tests/tests/signal_handler_doesnt_crash.py b/src/cobalt/black_box_tests/tests/signal_handler_doesnt_crash.py
new file mode 100644
index 0000000..443ffce
--- /dev/null
+++ b/src/cobalt/black_box_tests/tests/signal_handler_doesnt_crash.py
@@ -0,0 +1,44 @@
+# Copyright 2019 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+
+import signal
+import time
+
+import _env  # pylint: disable=unused-import
+
+from cobalt.black_box_tests import black_box_tests
+
+
+class SignalHandlerDoesntCrashTest(black_box_tests.BlackBoxTestCase):
+  """Flood the process with CONT signals, ensuring signal handler is robust."""
+
+  def setUp(self):
+    if 'linux' not in self.device_params.platform:
+      self.skipTest('This test needs POSIX system signal handlers')
+
+  def test_simple(self):
+    with self.CreateCobaltRunner(url='', target_params=[]) as runner:
+      runner.WaitForUrlLoadedEvents()
+
+      # About minimum duration to trigger the original crash issue consistently
+      duration_seconds = 5
+      interval_seconds = 0.0005
+      start_time = time.time()
+      while time.time() < (start_time + duration_seconds):
+        runner.launcher.proc.send_signal(signal.SIGCONT)
+        time.sleep(interval_seconds)
diff --git a/src/cobalt/black_box_tests/tests/suspend_visibility.py b/src/cobalt/black_box_tests/tests/suspend_visibility.py
index 966bbc3..17fa597 100644
--- a/src/cobalt/black_box_tests/tests/suspend_visibility.py
+++ b/src/cobalt/black_box_tests/tests/suspend_visibility.py
@@ -1,4 +1,16 @@
-"""Verify correct visibility changes during and after suspend event."""
+# Copyright 2017 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
 from __future__ import absolute_import
 from __future__ import division
@@ -11,6 +23,7 @@
 
 
 class SuspendVisibilityTest(black_box_tests.BlackBoxTestCase):
+  """Verify correct visibility changes during and after suspend event."""
 
   def test_simple(self):
 
diff --git a/src/cobalt/black_box_tests/tests/timer_hit_after_preload.py b/src/cobalt/black_box_tests/tests/timer_hit_after_preload.py
index 25faa06..16decec 100644
--- a/src/cobalt/black_box_tests/tests/timer_hit_after_preload.py
+++ b/src/cobalt/black_box_tests/tests/timer_hit_after_preload.py
@@ -1,4 +1,16 @@
-"""Set a JS timer that expires after exiting preload mode."""
+# Copyright 2017 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
 from __future__ import absolute_import
 from __future__ import division
@@ -11,6 +23,7 @@
 
 
 class TimerAfterPreloadTest(black_box_tests.BlackBoxTestCase):
+  """Set a JS timer that expires after exiting preload mode."""
 
   def test_simple(self):
 
diff --git a/src/cobalt/black_box_tests/tests/timer_hit_in_preload.py b/src/cobalt/black_box_tests/tests/timer_hit_in_preload.py
index 7ed80c8..e77b1e1 100644
--- a/src/cobalt/black_box_tests/tests/timer_hit_in_preload.py
+++ b/src/cobalt/black_box_tests/tests/timer_hit_in_preload.py
@@ -1,4 +1,16 @@
-"""Set a JS timer that expires during preload mode."""
+# Copyright 2017 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
 from __future__ import absolute_import
 from __future__ import division
@@ -11,6 +23,7 @@
 
 
 class TimerInPreloadTest(black_box_tests.BlackBoxTestCase):
+  """Set a JS timer that expires during preload mode."""
 
   def test_simple(self):
 
diff --git a/src/cobalt/black_box_tests/tests/web_debugger.py b/src/cobalt/black_box_tests/tests/web_debugger.py
index 74e186a..e170032 100644
--- a/src/cobalt/black_box_tests/tests/web_debugger.py
+++ b/src/cobalt/black_box_tests/tests/web_debugger.py
@@ -173,6 +173,15 @@
 class WebDebuggerTest(black_box_tests.BlackBoxTestCase):
   """Test interaction with the web debugger over a WebSocket."""
 
+  def setUp(self):
+    platform_vars = self.platform_config.GetVariables(self.device_params.config)
+    if platform_vars['javascript_engine'] != 'v8':
+      self.skipTest('DevTools requires V8')
+
+    cobalt_vars = self.cobalt_config.GetVariables(self.device_params.config)
+    if not cobalt_vars['enable_debugger']:
+      self.skipTest('DevTools is disabled on this platform')
+
   def create_debugger_connection(self, runner):
     devtools_url = runner.GetCval('Cobalt.Server.DevTools')
     parts = list(urlparse.urlsplit(devtools_url))
diff --git a/src/cobalt/black_box_tests/tests/web_platform_tests.py b/src/cobalt/black_box_tests/tests/web_platform_tests.py
index 1444cee..12adcd0 100644
--- a/src/cobalt/black_box_tests/tests/web_platform_tests.py
+++ b/src/cobalt/black_box_tests/tests/web_platform_tests.py
@@ -11,7 +11,6 @@
 # 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.
-"""Launch web platform tests."""
 
 
 from __future__ import absolute_import
@@ -20,33 +19,24 @@
 
 import _env  # pylint: disable=unused-import
 
-import logging
-
 from cobalt.black_box_tests import black_box_tests
 from cobalt.black_box_tests.web_platform_test_server import WebPlatformTestServer
 from starboard.tools import abstract_launcher
-from starboard.tools import build
 from starboard.tools.testing import test_filter
 
-# Configs web_platform_tests can run on.
-_WEB_PLATFORM_TESTS_CONFIGS = ['debug', 'devel']
 
 class WebPlatformTests(black_box_tests.BlackBoxTestCase):
+  """Launch web platform tests."""
+
+  def setUp(self):
+    if self.device_params.config not in ['debug', 'devel']:
+      self.skipTest('Can only run web platform tests on debug or devel config.')
 
   def test_simple(self):
-    device_params = black_box_tests._device_params
-
-    if device_params.config not in _WEB_PLATFORM_TESTS_CONFIGS:
-      logging.warning('Can only run web platform tests on debug or devel '
-                      'configs.')
-      return
-
     with WebPlatformTestServer(binding_address=self.GetBindingAddress()):
       target_params = []
 
-      platform_config = build.GetPlatformConfig(device_params.platform)
-      cobalt_config = platform_config.GetApplicationConfiguration('cobalt')
-      filters = cobalt_config.GetWebPlatformTestFilters()
+      filters = self.cobalt_config.GetWebPlatformTestFilters()
 
       if test_filter.DISABLE_TESTING in filters:
         return
@@ -58,16 +48,16 @@
         target_params.append('--gtest_filter=-{}'.format(':'.join(
             filters)))
 
-      if device_params.target_params:
-        target_params += device_params.target_params
+      if self.device_params.target_params:
+        target_params += self.device_params.target_params
 
       launcher = abstract_launcher.LauncherFactory(
-          device_params.platform,
+          self.device_params.platform,
           'web_platform_tests',
-          device_params.config,
-          device_id=device_params.device_id,
+          self.device_params.config,
+          device_id=self.device_params.device_id,
           target_params=target_params,
           output_file=None,
-          out_directory=device_params.out_directory)
+          out_directory=self.device_params.out_directory)
       status = launcher.Run()
       self.assertEqual(status, 0)
diff --git a/src/cobalt/black_box_tests/web_platform_test_server.py b/src/cobalt/black_box_tests/web_platform_test_server.py
index a4e9403..5199151 100644
--- a/src/cobalt/black_box_tests/web_platform_test_server.py
+++ b/src/cobalt/black_box_tests/web_platform_test_server.py
@@ -13,24 +13,26 @@
 # limitations under the License.
 """Contains a threaded web server used for web platform tests."""
 
-
 import os
 import sys
-SRC_DIR = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)
-WPT_DIR = os.path.join(SRC_DIR, 'third_party', 'web_platform_tests')
-sys.path.insert(0, WPT_DIR)
 import threading
 import time
 import uuid
 
+SRC_DIR = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)
+WPT_DIR = os.path.join(SRC_DIR, 'third_party', 'web_platform_tests')
+sys.path.insert(0, WPT_DIR)
+
+# pylint: disable=g-import-not-at-top
 from tools.serve import serve
 from tools.wptserve.wptserve import stash
 
 
 class WebPlatformTestServer(object):
+  """Runs a WPT StashServer on its own thread in a Python context manager."""
 
   def __init__(self, binding_address=None):
-    # IP that config['host'] should map to either through a dns or the hosts file.
+    # IP config['host'] should map to either through a dns or the hosts file.
     if binding_address:
       self._binding_address = binding_address
     else:
@@ -49,12 +51,13 @@
     with stash.StashServer((self._binding_address, serve.get_port()),
                            authkey=str(uuid.uuid4())):
       with serve.get_ssl_environment(config) as ssl_env:
-        config_, self._servers = serve.start(config, ssl_env,
-                                             serve.default_routes(), **kwargs)
+        _, self._servers = serve.start(config, ssl_env,
+                                       serve.default_routes(), **kwargs)
         self._server_started = True
 
         try:
-          while any(item.is_alive() for item in serve.iter_procs(self._servers)):
+          while any(item.is_alive()
+                    for item in serve.iter_procs(self._servers)):
             for item in serve.iter_procs(self._servers):
               item.join(1)
         except KeyboardInterrupt:
@@ -69,7 +72,7 @@
     return self
 
   def __exit__(self, exc_type, exc_value, traceback):
-    for scheme, servers in self._servers.iteritems():
-      for port, server in servers:
+    for _, servers in self._servers.iteritems():
+      for _, server in servers:
         server.kill()
     self._server_thread.join()
diff --git a/src/cobalt/browser/application.cc b/src/cobalt/browser/application.cc
index 3570403..4ab000d 100644
--- a/src/cobalt/browser/application.cc
+++ b/src/cobalt/browser/application.cc
@@ -53,7 +53,6 @@
 #include "cobalt/base/on_screen_keyboard_shown_event.h"
 #include "cobalt/base/on_screen_keyboard_suggestions_updated_event.h"
 #include "cobalt/base/startup_timer.h"
-#include "cobalt/base/user_log.h"
 #if defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
 #include "cobalt/base/version_compatibility.h"
 #endif  // defined(COBALT_ENABLE_VERSION_COMPATIBILITY_VALIDATIONS)
@@ -160,7 +159,7 @@
 }
 #endif  // ENABLE_WEBDRIVER
 
-#if SB_API_VERSION >= SB_HAS_STARTUP_URL_SIGNING_VERSION
+#if SB_API_VERSION >= 11
 std::string NumberToFourByteString(size_t n) {
   std::string str;
   str += static_cast<char>(((n & 0xff000000) >> 24));
@@ -208,7 +207,7 @@
 
   return base_64_url_signature;
 }
-#endif  // SB_API_VERSION >= SB_HAS_STARTUP_URL_SIGNING_VERSION
+#endif  // SB_API_VERSION >= 11
 
 GURL GetInitialURL() {
   GURL initial_url = GURL(kDefaultURL);
@@ -224,7 +223,7 @@
     }
   }
 
-#if SB_API_VERSION >= SB_HAS_STARTUP_URL_SIGNING_VERSION
+#if SB_API_VERSION >= 11
   // Get cert_scope and base_64_secret
   const size_t kCertificationScopeLength = 1023;
   char cert_scope_property[kCertificationScopeLength + 1] = {0};
@@ -278,7 +277,7 @@
   GURL::Replacements replacements;
   replacements.SetQueryStr(query);
   initial_url = initial_url.ReplaceComponents(replacements);
-#endif  // SB_API_VERSION >= SB_HAS_STARTUP_URL_SIGNING_VERSION
+#endif  // SB_API_VERSION >= 11
 
   return initial_url;
 }
@@ -516,10 +515,8 @@
       base::MessageLoop::TYPE_UI,
       static_cast<base::MessageLoop*>(base::MessageLoop::current())->type());
 
-  network_event_thread_checker_.DetachFromThread();
-  application_event_thread_checker_.DetachFromThread();
-
-  RegisterUserLogs();
+  DETACH_FROM_THREAD(network_event_thread_checker_);
+  DETACH_FROM_THREAD(application_event_thread_checker_);
 
   // Set the minimum logging level, if specified on the command line.
   logging::SetMinLogLevel(StringToLogLevel(GetMinLogLevelString()));
@@ -679,22 +676,6 @@
 
   EnableUsingStubImageDecoderIfRequired();
 
-  if (command_line->HasSwitch(browser::switches::kDisableWebmVp9)) {
-    DLOG(INFO) << "Webm/Vp9 disabled";
-    options.media_module_options.disable_webm_vp9 = true;
-  }
-  if (command_line->HasSwitch(switches::kAudioDecoderStub)) {
-    DLOG(INFO) << "Use ShellRawAudioDecoderStub";
-    options.media_module_options.use_audio_decoder_stub = true;
-  }
-  if (command_line->HasSwitch(switches::kNullAudioStreamer)) {
-    DLOG(INFO) << "Use null audio";
-    options.media_module_options.use_null_audio_streamer = true;
-  }
-  if (command_line->HasSwitch(switches::kVideoDecoderStub)) {
-    DLOG(INFO) << "Use ShellRawVideoDecoderStub";
-    options.media_module_options.use_video_decoder_stub = true;
-  }
   if (command_line->HasSwitch(switches::kMemoryTracker)) {
     std::string command_arg =
         command_line->GetSwitchValueASCII(switches::kMemoryTracker);
@@ -730,7 +711,7 @@
                         (should_preload ? base::kApplicationStatePreloading
                                         : base::kApplicationStateStarted),
                         &event_dispatcher_, account_manager_.get(), options));
-  UpdateAndMaybeRegisterUserAgent();
+  UpdateUserAgent();
 
   app_status_ = (should_preload ? kPreloadingAppStatus : kRunningAppStatus);
 
@@ -765,14 +746,14 @@
   event_dispatcher_.AddEventCallback(
       base::OnScreenKeyboardBlurredEvent::TypeId(),
       on_screen_keyboard_blurred_event_callback_);
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
   on_screen_keyboard_suggestions_updated_event_callback_ =
       base::Bind(&Application::OnOnScreenKeyboardSuggestionsUpdatedEvent,
                  base::Unretained(this));
   event_dispatcher_.AddEventCallback(
       base::OnScreenKeyboardSuggestionsUpdatedEvent::TypeId(),
       on_screen_keyboard_suggestions_updated_event_callback_);
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
 
 #if SB_HAS(CAPTIONS)
@@ -858,11 +839,11 @@
   event_dispatcher_.RemoveEventCallback(
       base::OnScreenKeyboardBlurredEvent::TypeId(),
       on_screen_keyboard_blurred_event_callback_);
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
   event_dispatcher_.RemoveEventCallback(
       base::OnScreenKeyboardSuggestionsUpdatedEvent::TypeId(),
       on_screen_keyboard_suggestions_updated_event_callback_);
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
 #if SB_HAS(CAPTIONS)
   event_dispatcher_.RemoveEventCallback(
@@ -914,9 +895,7 @@
     case kSbEventTypeUnpause:
     case kSbEventTypeSuspend:
     case kSbEventTypeResume:
-#if SB_API_VERSION >= 6
     case kSbEventTypeLowMemory:
-#endif  // SB_API_VERSION >= 6
       OnApplicationEvent(starboard_event->type);
       break;
 #if SB_API_VERSION >= 8
@@ -947,12 +926,12 @@
       DispatchEventInternal(new base::OnScreenKeyboardBlurredEvent(
           *static_cast<int*>(starboard_event->data)));
       break;
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
     case kSbEventTypeOnScreenKeyboardSuggestionsUpdated:
       DispatchEventInternal(new base::OnScreenKeyboardSuggestionsUpdatedEvent(
           *static_cast<int*>(starboard_event->data)));
       break;
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
     case kSbEventTypeLink: {
       const char* link = static_cast<const char*>(starboard_event->data);
@@ -971,13 +950,11 @@
     // Explicitly list unhandled cases here so that the compiler can give a
     // warning when a value is added, but not handled.
     case kSbEventTypeInput:
-#if SB_API_VERSION >= 6
     case kSbEventTypePreload:
-#endif  // SB_API_VERSION >= 6
-#if SB_API_VERSION < SB_DEPRECATE_DISCONNECT_VERSION
+#if SB_API_VERSION < 11
     case kSbEventTypeNetworkConnect:
     case kSbEventTypeNetworkDisconnect:
-#endif  // SB_API_VERSION < SB_DEPRECATE_DISCONNECT_VERSION
+#endif  // SB_API_VERSION < 11
     case kSbEventTypeScheduled:
     case kSbEventTypeStart:
     case kSbEventTypeStop:
@@ -990,7 +967,7 @@
 
 void Application::OnApplicationEvent(SbEventType event_type) {
   TRACE_EVENT0("cobalt::browser", "Application::OnApplicationEvent()");
-  DCHECK(application_event_thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(application_event_thread_checker_);
   switch (event_type) {
     case kSbEventTypeStop:
       DLOG(INFO) << "Got quit event.";
@@ -1035,7 +1012,6 @@
       browser_module_->Resume();
       DLOG(INFO) << "Finished resuming.";
       break;
-#if SB_API_VERSION >= 6
     case kSbEventTypeLowMemory:
       DLOG(INFO) << "Got low memory event.";
       browser_module_->ReduceMemory();
@@ -1043,7 +1019,6 @@
       break;
     // All of the remaining event types are unexpected:
     case kSbEventTypePreload:
-#endif  // SB_API_VERSION >= 6
 #if SB_API_VERSION >= 8
     case kSbEventTypeWindowSizeChanged:
 #endif
@@ -1055,17 +1030,17 @@
     case kSbEventTypeOnScreenKeyboardFocused:
     case kSbEventTypeOnScreenKeyboardHidden:
     case kSbEventTypeOnScreenKeyboardShown:
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
     case kSbEventTypeOnScreenKeyboardSuggestionsUpdated:
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
     case kSbEventTypeAccessiblitySettingsChanged:
     case kSbEventTypeInput:
     case kSbEventTypeLink:
-#if SB_API_VERSION < SB_DEPRECATE_DISCONNECT_VERSION
+#if SB_API_VERSION < 11
     case kSbEventTypeNetworkConnect:
     case kSbEventTypeNetworkDisconnect:
-#endif  // SB_API_VERSION < SB_DEPRECATE_DISCONNECT_VERSION
+#endif  // SB_API_VERSION < 11
     case kSbEventTypeScheduled:
     case kSbEventTypeUser:
     case kSbEventTypeVerticalSync:
@@ -1090,7 +1065,7 @@
   const base::WindowSizeChangedEvent* window_size_change_event =
       base::polymorphic_downcast<const base::WindowSizeChangedEvent*>(event);
   const auto& size = window_size_change_event->size();
-#if SB_API_VERSION >= SB_HAS_SCREEN_DIAGONAL_API_VERSION
+#if SB_API_VERSION >= 11
   float diagonal =
       SbWindowGetDiagonalSizeInInches(window_size_change_event->window());
 #else
@@ -1135,7 +1110,7 @@
           event));
 }
 
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
 void Application::OnOnScreenKeyboardSuggestionsUpdatedEvent(
     const base::Event* event) {
   TRACE_EVENT0("cobalt::browser",
@@ -1144,7 +1119,7 @@
       base::polymorphic_downcast<
           const base::OnScreenKeyboardSuggestionsUpdatedEvent*>(event));
 }
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
 
 #if SB_HAS(CAPTIONS)
@@ -1184,51 +1159,13 @@
   }
 }
 
-void Application::RegisterUserLogs() {
-  if (base::UserLog::IsRegistrationSupported()) {
-    base::UserLog::Register(
-        base::UserLog::kSystemLanguageStringIndex, "SystemLanguage",
-        non_trivial_static_fields.Get().system_language.c_str(),
-        non_trivial_static_fields.Get().system_language.size());
-
-    base::UserLog::Register(base::UserLog::kAvailableMemoryIndex,
-                            "AvailableMemory", &available_memory_,
-                            sizeof(available_memory_));
-    base::UserLog::Register(base::UserLog::kAppLifetimeIndex, "Lifetime(ms)",
-                            &lifetime_in_ms_, sizeof(lifetime_in_ms_));
-    base::UserLog::Register(base::UserLog::kAppStatusIndex, "AppStatus",
-                            &app_status_, sizeof(app_status_));
-    base::UserLog::Register(base::UserLog::kAppPauseCountIndex, "PauseCnt",
-                            &app_pause_count_, sizeof(app_pause_count_));
-    base::UserLog::Register(base::UserLog::kAppUnpauseCountIndex, "UnpauseCnt",
-                            &app_unpause_count_, sizeof(app_unpause_count_));
-    base::UserLog::Register(base::UserLog::kAppSuspendCountIndex, "SuspendCnt",
-                            &app_suspend_count_, sizeof(app_suspend_count_));
-    base::UserLog::Register(base::UserLog::kAppResumeCountIndex, "ResumeCnt",
-                            &app_resume_count_, sizeof(app_resume_count_));
-    base::UserLog::Register(base::UserLog::kNetworkStatusIndex, "NetworkStatus",
-                            &network_status_, sizeof(network_status_));
-    base::UserLog::Register(base::UserLog::kNetworkConnectCountIndex,
-                            "ConnectCnt", &network_connect_count_,
-                            sizeof(network_connect_count_));
-    base::UserLog::Register(base::UserLog::kNetworkDisconnectCountIndex,
-                            "DisconnectCnt", &network_disconnect_count_,
-                            sizeof(network_disconnect_count_));
-  }
-}
-
 // NOTE: UserAgent registration is handled separately, as the value is not
 // available when the app is first being constructed. Registration must happen
 // each time the user agent is modified, because the string may be pointing
 // to a new location on the heap.
-void Application::UpdateAndMaybeRegisterUserAgent() {
+void Application::UpdateUserAgent() {
   non_trivial_static_fields.Get().user_agent = browser_module_->GetUserAgent();
   DLOG(INFO) << "User Agent: " << non_trivial_static_fields.Get().user_agent;
-  if (base::UserLog::IsRegistrationSupported()) {
-    base::UserLog::Register(base::UserLog::kUserAgentStringIndex, "UserAgent",
-                            non_trivial_static_fields.Get().user_agent.c_str(),
-                            non_trivial_static_fields.Get().user_agent.size());
-  }
 }
 
 void Application::UpdatePeriodicStats() {
diff --git a/src/cobalt/browser/application.h b/src/cobalt/browser/application.h
index be261f8..8486ea0 100644
--- a/src/cobalt/browser/application.h
+++ b/src/cobalt/browser/application.h
@@ -82,9 +82,9 @@
   void OnOnScreenKeyboardHiddenEvent(const base::Event* event);
   void OnOnScreenKeyboardFocusedEvent(const base::Event* event);
   void OnOnScreenKeyboardBlurredEvent(const base::Event* event);
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
   void OnOnScreenKeyboardSuggestionsUpdatedEvent(const base::Event* event);
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
 
 #if SB_HAS(CAPTIONS)
@@ -114,9 +114,9 @@
   base::EventCallback on_screen_keyboard_hidden_event_callback_;
   base::EventCallback on_screen_keyboard_focused_event_callback_;
   base::EventCallback on_screen_keyboard_blurred_event_callback_;
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
   base::EventCallback on_screen_keyboard_suggestions_updated_event_callback_;
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
 #if SB_HAS(CAPTIONS)
   base::EventCallback on_caption_settings_changed_event_callback_;
@@ -124,8 +124,8 @@
 
   // Thread checkers to ensure that callbacks for network and application events
   // always occur on the same thread.
-  base::ThreadChecker network_event_thread_checker_;
-  base::ThreadChecker application_event_thread_checker_;
+  THREAD_CHECKER(network_event_thread_checker_);
+  THREAD_CHECKER(application_event_thread_checker_);
 
 #if defined(ENABLE_WEBDRIVER)
   // WebDriver implementation with embedded HTTP server.
@@ -175,8 +175,7 @@
     base::CVal<base::TimeDelta, base::CValPublic> app_lifetime;
   };
 
-  void RegisterUserLogs();
-  void UpdateAndMaybeRegisterUserAgent();
+  void UpdateUserAgent();
   void UpdatePeriodicStats();
   void DispatchEventInternal(base::Event* event);
 
diff --git a/src/cobalt/browser/browser.gyp b/src/cobalt/browser/browser.gyp
index 2d32251..7b04429 100644
--- a/src/cobalt/browser/browser.gyp
+++ b/src/cobalt/browser/browser.gyp
@@ -112,6 +112,7 @@
         'COBALT_SKIA_CACHE_SIZE_IN_BYTES=<(skia_cache_size_in_bytes)',
         'COBALT_SKIA_GLYPH_ATLAS_WIDTH=<(skia_glyph_atlas_width)',
         'COBALT_SKIA_GLYPH_ATLAS_HEIGHT=<(skia_glyph_atlas_height)',
+        'COBALT_ENCODED_IMAGE_CACHE_SIZE_IN_BYTES=<(encoded_image_cache_size_in_bytes)',
         'COBALT_IMAGE_CACHE_SIZE_IN_BYTES=<(image_cache_size_in_bytes)',
         'COBALT_REMOTE_TYPEFACE_CACHE_SIZE_IN_BYTES=<(remote_font_cache_size_in_bytes)',
         'COBALT_IMAGE_CACHE_CAPACITY_MULTIPLIER_WHEN_PLAYING_VIDEO=<(image_cache_capacity_multiplier_when_playing_video)',
@@ -194,9 +195,6 @@
             '<(DEPTH)/cobalt/debug/debug.gyp:debug',
           ],
         }],
-        ['cobalt_enable_lib == 1', {
-          'defines' : ['COBALT_ENABLE_LIB'],
-        }],
         ['mesh_cache_size_in_bytes == "auto"', {
           'conditions': [
             ['enable_map_to_mesh==1', {
diff --git a/src/cobalt/browser/browser_bindings_gen.gyp b/src/cobalt/browser/browser_bindings_gen.gyp
index 55abc6d..6a50f63 100644
--- a/src/cobalt/browser/browser_bindings_gen.gyp
+++ b/src/cobalt/browser/browser_bindings_gen.gyp
@@ -88,6 +88,7 @@
         '../dom/focus_event.idl',
         '../dom/history.idl',
         '../dom/html_anchor_element.idl',
+        '../dom/html_audio_element.idl',
         '../dom/html_body_element.idl',
         '../dom/html_br_element.idl',
         '../dom/html_collection.idl',
@@ -108,6 +109,8 @@
         '../dom/html_unknown_element.idl',
         '../dom/html_video_element.idl',
         '../dom/input_event.idl',
+        '../dom/intersection_observer.idl',
+        '../dom/intersection_observer_entry.idl',
         '../dom/keyboard_event.idl',
         '../dom/location.idl',
         '../dom/media_error.idl',
@@ -180,9 +183,10 @@
         '../media_capture/media_device_info.idl',
         '../media_capture/media_devices.idl',
         '../media_capture/media_recorder.idl',
+
         '../media_session/media_metadata.idl',
         '../media_session/media_session.idl',
-        '../media_session/media_session_action_details.idl',
+
         '../media_stream/media_stream.idl',
         '../media_stream/media_stream_track.idl',
 
@@ -251,6 +255,8 @@
         '../dom/event_modifier_init.idl',
         '../dom/focus_event_init.idl',
         '../dom/input_event_init.idl',
+        '../dom/intersection_observer_entry_init.idl',
+        '../dom/intersection_observer_init.idl',
         '../dom/keyboard_event_init.idl',
         '../dom/media_source_end_of_stream_error.idl',
         '../dom/media_source_ready_state.idl',
@@ -267,7 +273,9 @@
         '../media_capture/recording_state.idl',
         '../media_session/media_image.idl',
         '../media_session/media_metadata_init.idl',
+        '../media_session/media_position_state.idl',
         '../media_session/media_session_action.idl',
+        '../media_session/media_session_action_details.idl',
         '../media_session/media_session_playback_state.idl',
         '../media_stream/media_stream_constraints.idl',
         '../media_stream/media_track_settings.idl',
diff --git a/src/cobalt/browser/browser_module.cc b/src/cobalt/browser/browser_module.cc
index bed8c35..fad5331 100644
--- a/src/cobalt/browser/browser_module.cc
+++ b/src/cobalt/browser/browser_module.cc
@@ -51,8 +51,8 @@
 #include "cobalt/overlay_info/overlay_info_registry.h"
 #include "nb/memory_scope.h"
 #include "starboard/atomic.h"
+#include "starboard/common/string.h"
 #include "starboard/configuration.h"
-#include "starboard/string.h"
 #include "starboard/system.h"
 #include "starboard/time.h"
 
@@ -152,6 +152,17 @@
     "Creates a screenshot of the most recent layout tree and writes it "
     "to disk. Logs the filename of the screenshot to the console when done.";
 
+// Debug console command `disable_media_codecs` for disabling a list of codecs
+// by treating them as unsupported
+const char kDisableMediaCodecsCommand[] = "disable_media_codecs";
+const char kDisableMediaCodecsCommandShortHelp[] =
+    "Specify a semicolon-seperated list of disabled media codecs.";
+const char kDisableMediaCodecsCommandLongHelp[] =
+    "Disabling Media Codecs will force the app to claim they are not "
+    "supported. This "
+    "is useful when trying to target testing to certain codecs, since other "
+    "codecs will get picked as a fallback as a result.";
+
 void ScreenshotCompleteCallback(const base::FilePath& output_path) {
   DLOG(INFO) << "Screenshot written to " << output_path.value();
 }
@@ -260,6 +271,9 @@
           "The total memory that is reserved by the JavaScript engine, which "
           "includes both parts that have live JavaScript values, as well as "
           "preallocated space for future values."),
+      disabled_media_codecs_(
+          "Media.DisabledMediaCodecs", "",
+          "List of codecs that should currently be reported as unsupported."),
 #if defined(ENABLE_DEBUGGER)
       ALLOW_THIS_IN_INITIALIZER_LIST(fuzzer_toggle_command_handler_(
           kFuzzerToggleCommand,
@@ -273,6 +287,12 @@
           kScreenshotCommand,
           base::Bind(&OnScreenshotMessage, base::Unretained(this)),
           kScreenshotCommandShortHelp, kScreenshotCommandLongHelp)),
+      ALLOW_THIS_IN_INITIALIZER_LIST(disable_media_codecs_command_handler_(
+          kDisableMediaCodecsCommand,
+          base::Bind(&BrowserModule::OnDisableMediaCodecs,
+                     base::Unretained(this)),
+          kDisableMediaCodecsCommandShortHelp,
+          kDisableMediaCodecsCommandLongHelp)),
 #endif  // defined(ENABLE_DEBUGGER)
       has_resumed_(base::WaitableEvent::ResetPolicy::MANUAL,
                    base::WaitableEvent::InitialState::NOT_SIGNALED),
@@ -367,6 +387,21 @@
   }
 #endif  // ENABLE_DEBUGGER && ENABLE_DEBUG_COMMAND_LINE_SWITCHES
 
+#if defined(ENABLE_DEBUG_COMMAND_LINE_SWITCHES)
+  if (command_line->HasSwitch(switches::kDisableMediaCodecs)) {
+    std::string codecs =
+        command_line->GetSwitchValueASCII(switches::kDisableMediaCodecs);
+    if (!codecs.empty()) {
+#if defined(ENABLE_DEBUGGER)
+      OnDisableMediaCodecs(codecs);
+#else   // ENABLE_DEBUGGER
+      // Here command line switches are enabled but the debug console is not.
+      can_play_type_handler_->SetDisabledMediaCodecs(codecs);
+#endif  // ENABLE_DEBUGGER
+    }
+  }
+#endif  // ENABLE_DEBUG_COMMAND_LINE_SWITCHES
+
   if (application_state_ == base::kApplicationStateStarted ||
       application_state_ == base::kApplicationStatePaused) {
     InitializeSystemWindow();
@@ -933,7 +968,7 @@
   }
 }
 
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
 void BrowserModule::OnOnScreenKeyboardSuggestionsUpdated(
     const base::OnScreenKeyboardSuggestionsUpdatedEvent* event) {
   DCHECK_EQ(base::MessageLoop::current(), self_message_loop_);
@@ -942,7 +977,7 @@
     web_module_->InjectOnScreenKeyboardSuggestionsUpdatedEvent(event->ticket());
   }
 }
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
 
 #if SB_HAS(CAPTIONS)
@@ -998,6 +1033,11 @@
   }
 }
 
+void BrowserModule::OnDisableMediaCodecs(const std::string& codecs) {
+  disabled_media_codecs_ = codecs;
+  can_play_type_handler_->SetDisabledMediaCodecs(codecs);
+}
+
 void BrowserModule::QueueOnDebugConsoleRenderTreeProduced(
     const browser::WebModule::LayoutResults& layout_results) {
   TRACE_EVENT0("cobalt::browser",
@@ -1576,9 +1616,9 @@
   options_.media_module_options.allow_resume_after_suspend =
       SbSystemSupportsResume();
 #endif  // SB_API_VERSION >= 10
-  media_module_ =
-      media::MediaModule::Create(system_window_.get(), GetResourceProvider(),
-                                 options_.media_module_options);
+  media_module_.reset(new media::MediaModule(system_window_.get(),
+                                             GetResourceProvider(),
+                                             options_.media_module_options));
 
   if (web_module_) {
     web_module_->SetCamera3D(input_device_manager_->camera_3d());
@@ -1762,6 +1802,8 @@
   }
 
   // Web Module options.
+  options_.web_module_options.encoded_image_cache_capacity =
+      static_cast<int>(auto_mem_->encoded_image_cache_size_in_bytes()->value());
   options_.web_module_options.image_cache_capacity =
       static_cast<int>(auto_mem_->image_cache_size_in_bytes()->value());
   options_.web_module_options.remote_typeface_cache_capacity = static_cast<int>(
diff --git a/src/cobalt/browser/browser_module.h b/src/cobalt/browser/browser_module.h
index 2ca69d5..74e0fc3 100644
--- a/src/cobalt/browser/browser_module.h
+++ b/src/cobalt/browser/browser_module.h
@@ -197,10 +197,10 @@
       const base::OnScreenKeyboardFocusedEvent* event);
   void OnOnScreenKeyboardBlurred(
       const base::OnScreenKeyboardBlurredEvent* event);
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
   void OnOnScreenKeyboardSuggestionsUpdated(
       const base::OnScreenKeyboardSuggestionsUpdatedEvent* event);
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
 
 #if SB_HAS(CAPTIONS)
@@ -336,6 +336,12 @@
   // MediaModule::SetConfiguration().
   void OnSetMediaConfig(const std::string& config);
 
+  // Sets the disabled media codecs in the debug console and in
+  // the CanPlayTypeHandler instance.
+  // Future requests to play videos with these codecs will report that these
+  // codecs are unsupported.
+  void OnDisableMediaCodecs(const std::string& codecs);
+
   // Glue function to deal with the production of the debug console render tree,
   // and will manage handing it off to the renderer.
   void QueueOnDebugConsoleRenderTreeProduced(
@@ -534,6 +540,10 @@
   base::CVal<base::cval::SizeInBytes, base::CValPublic>
       javascript_reserved_memory_;
 
+  // Stores the current list of disabled codecs, which are considered
+  // unsupported by media.
+  base::CVal<std::string, base::CValPublic> disabled_media_codecs_;
+
 #if defined(ENABLE_DEBUGGER)
   // Possibly null, but if not, will contain a reference to an instance of
   // a debug fuzzer input device manager.
@@ -554,6 +564,11 @@
   debug::console::ConsoleCommandManager::CommandHandler
       screenshot_command_handler_;
 
+  // Command handler object for changing a list of disabled codecs for
+  // debug and testing purposes.
+  debug::console::ConsoleCommandManager::CommandHandler
+      disable_media_codecs_command_handler_;
+
   base::Optional<SuspendFuzzer> suspend_fuzzer_;
 
   // An object that registers and owns console commands for controlling
diff --git a/src/cobalt/browser/cobalt.gyp b/src/cobalt/browser/cobalt.gyp
index 3ebd102..5f11d1a 100644
--- a/src/cobalt/browser/cobalt.gyp
+++ b/src/cobalt/browser/cobalt.gyp
@@ -22,26 +22,14 @@
       'type': '<(final_executable_type)',
       'conditions': [
         ['sb_evergreen != 1', {
+          'sources': [
+            'main.cc',
+          ],
           'dependencies': [
             '<(DEPTH)/cobalt/browser/browser.gyp:browser',
             '<(DEPTH)/net/net.gyp:net',
           ],
           'conditions': [
-            ['clang and target_os not in ["tvos", "android", "orbis"] and sb_target_platform not in ["linux-x64x11-clang-3-6", "linux-x86x11"]', {
-              'dependencies': [
-                '<(DEPTH)/third_party/musl/musl.gyp:c'
-              ],
-            }],
-            ['cobalt_enable_lib == 1', {
-              'sources': [
-                'lib/cobalt.def',
-                'lib/main.cc',
-              ],
-            }, {
-              'sources': [
-                'main.cc',
-              ],
-            }],
             ['cobalt_splash_screen_file != ""', {
               'dependencies': [
                 '<(DEPTH)/cobalt/browser/splash_screen/splash_screen.gyp:copy_splash_screen',
@@ -58,8 +46,8 @@
             '-Wl,--no-whole-archive',
           ],
           'dependencies': [
-            '<(DEPTH)/starboard/starboard.gyp:starboard_full',
             '<(DEPTH)/cobalt/browser/cobalt.gyp:cobalt_evergreen',
+            '<(DEPTH)/starboard/starboard.gyp:starboard_full',
           ],
         }],
       ],
@@ -99,14 +87,11 @@
             '<(DEPTH)/cobalt/base/base.gyp:base',
             '<(DEPTH)/cobalt/browser/browser.gyp:browser',
             '<(DEPTH)/net/net.gyp:net',
+            '<(DEPTH)/starboard/common/common.gyp:common',
           ],
           'sources': [
             'main.cc',
           ],
-          # TODO: Remove once the log.h is refactored to have only C linkage dependencies.
-          'ldflags': [
-            'obj/starboard/common/common.log_message.cc.o',
-          ],
           'ldflags/': [
             ['exclude', '-Wl,--wrap=eglSwapBuffers'],
           ],
@@ -114,6 +99,7 @@
             ['clang and target_os not in ["tvos", "android", "orbis"] and sb_target_platform not in ["linux-x64x11-clang-3-6", "linux-x86x11"]', {
               'dependencies': [
                 '<(DEPTH)/third_party/musl/musl.gyp:c',
+                '<(DEPTH)/third_party/llvm-project/compiler-rt/compiler-rt.gyp:compiler_rt',
                 '<(DEPTH)/third_party/llvm-project/libunwind/libunwind.gyp:unwind',
                 '<(DEPTH)/third_party/llvm-project/libcxxabi/libcxxabi.gyp:cxxabi',
                 '<(DEPTH)/third_party/llvm-project/libcxx/libcxx.gyp:cxx',
diff --git a/src/cobalt/browser/cobalt_evergreen.gypi b/src/cobalt/browser/cobalt_evergreen.gypi
index 2f85e2f..54605d9 100644
--- a/src/cobalt/browser/cobalt_evergreen.gypi
+++ b/src/cobalt/browser/cobalt_evergreen.gypi
@@ -27,18 +27,15 @@
     '-Wno-bitwise-op-parentheses',
     '-Wno-shift-op-parentheses',
     '-Wno-shorten-64-to-32',
+    '-Wno-unused-command-line-argument',
   ],
   'cflags_cc': [
     '-nostdinc++',
     '-std=c++11',
-    '-stdlib=libc++',
   ],
   'ldflags': [
-    # We use -nodefaultlibs instead of -nostdlib because the latter excludes
-    # standard system startup files, which are needed when linking.
-    '-nodefaultlibs',
-    # We still need libgcc.a when linking.
-    '-lgcc',
+    '-stdlib=libc++',
+    '-nostdlib',
   ],
   'defines' : [
     # This flag is set assuming the system uses pthread.
diff --git a/src/cobalt/browser/lib/README.md b/src/cobalt/browser/lib/README.md
deleted file mode 100644
index 55af499..0000000
--- a/src/cobalt/browser/lib/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-This directory provides an API for clients that build Cobalt into a lib using
-the 'cobalt_enable_lib' flag.
-
-It is highly experimental at this point and is expected to change significantly
-across releases.
-
-As a general convention, functions whose symbols are exported are defined in an
-'exported' subdirectory and functions that are required to be implemented by
-clients are defined in a 'imported' subdirectory.
diff --git a/src/cobalt/browser/lib/cobalt.def b/src/cobalt/browser/lib/cobalt.def
deleted file mode 100644
index 3ee0f29..0000000
--- a/src/cobalt/browser/lib/cobalt.def
+++ /dev/null
@@ -1,663 +0,0 @@
-; This file defines functions which are explicitly exported by cobalt.dll.
-; More info can be found here:
-;   https://msdn.microsoft.com/en-us/library/d91k01sh.aspx
-; And broader context is explained here:
-;   https://blogs.msdn.microsoft.com/oldnewthing/20140321-00/?p=1433/
-
-EXPORTS
-    ; From starboard/shared/lib/exported/starboard_main.h:
-    StarboardMain
-
-    ; From cobalt/browser/lib/exported/user_agent.h:
-    CbLibUserAgentSetPlatformNameSuffix
-    CbLibUserAgentSetDeviceTypeOverride
-    CbLibUserAgentSetBrandNameOverride
-    CbLibUserAgentSetModelNameOverride
-
-    ; From cobalt/browser/lib/exported/main.h:
-    CbLibMainSetCallbackRegistrationReadyCallback
-    CbLibMainSetOnCobaltInitializedCallback
-    CbLibMainSetHandleEventCallback
-    CbLibMainGetSbWindow
-
-    ; From cobalt/render/rasterizer/lib/exported/graphics.h:
-    CbLibGraphicsSetContextCreatedCallback
-    CbLibGraphicsSetRenderFrameCallback
-    CbLibGrapicsGetMainTextureHandle
-    CbLibGraphicsSetTargetMainTextureSize
-    CbLibGraphicsRenderCobalt
-    CbLibGraphicsCopyBackbuffer
-    CbLibGraphicsSwapBackbuffer
-
-    ; From cobalt/render/rasterizer/lib/exported/video.h:
-    CbLibVideoSetOnUpdateProjectionTypeAndStereoMode
-    CbLibVideoSetOnUpdateMeshes
-    CbLibVideoSetOnUpdateRgbTextureId
-    CbLibVideoSetOnUpdateAspectRatio
-
-    ; Following GL functions are copied from libGLESv2.def and EGL from
-    ; libEGL.def. We export these so that host-applications may use the same
-    ; GLES & EGL implementation that Cobalt is using for rendering.
-    glActiveTexture
-    glAttachShader
-    glBindAttribLocation
-    glBindBuffer
-    glBindFramebuffer
-    glBindRenderbuffer
-    glBindTexture
-    glBlendColor
-    glBlendEquation
-    glBlendEquationSeparate
-    glBlendFunc
-    glBlendFuncSeparate
-    glBufferData
-    glBufferSubData
-    glCheckFramebufferStatus
-    glClear
-    glClearColor
-    glClearDepthf
-    glClearStencil
-    glColorMask
-    glCompileShader
-    glCompressedTexImage2D
-    glCompressedTexSubImage2D
-    glCopyTexImage2D
-    glCopyTexSubImage2D
-    glCreateProgram
-    glCreateShader
-    glCullFace
-    glDeleteBuffers
-    glDeleteFramebuffers
-    glDeleteProgram
-    glDeleteRenderbuffers
-    glDeleteShader
-    glDeleteTextures
-    glDepthFunc
-    glDepthMask
-    glDepthRangef
-    glDetachShader
-    glDisable
-    glDisableVertexAttribArray
-    glDrawArrays
-    glDrawElements
-    glEnable
-    glEnableVertexAttribArray
-    glFinish
-    glFlush
-    glFramebufferRenderbuffer
-    glFramebufferTexture2D
-    glFrontFace
-    glGenBuffers
-    glGenFramebuffers
-    glGenRenderbuffers
-    glGenTextures
-    glGenerateMipmap
-    glGetActiveAttrib
-    glGetActiveUniform
-    glGetAttachedShaders
-    glGetAttribLocation
-    glGetBooleanv
-    glGetBufferParameteriv
-    glGetError
-    glGetFloatv
-    glGetFramebufferAttachmentParameteriv
-    glGetIntegerv
-    glGetProgramInfoLog
-    glGetProgramiv
-    glGetRenderbufferParameteriv
-    glGetShaderInfoLog
-    glGetShaderPrecisionFormat
-    glGetShaderSource
-    glGetShaderiv
-    glGetString
-    glGetTexParameterfv
-    glGetTexParameteriv
-    glGetUniformLocation
-    glGetUniformfv
-    glGetUniformiv
-    glGetVertexAttribPointerv
-    glGetVertexAttribfv
-    glGetVertexAttribiv
-    glHint
-    glIsBuffer
-    glIsEnabled
-    glIsFramebuffer
-    glIsProgram
-    glIsRenderbuffer
-    glIsShader
-    glIsTexture
-    glLineWidth
-    glLinkProgram
-    glPixelStorei
-    glPolygonOffset
-    glReadPixels
-    glReleaseShaderCompiler
-    glRenderbufferStorage
-    glSampleCoverage
-    glScissor
-    glShaderBinary
-    glShaderSource
-    glStencilFunc
-    glStencilFuncSeparate
-    glStencilMask
-    glStencilMaskSeparate
-    glStencilOp
-    glStencilOpSeparate
-    glTexImage2D
-    glTexParameterf
-    glTexParameterfv
-    glTexParameteri
-    glTexParameteriv
-    glTexSubImage2D
-    glUniform1f
-    glUniform1fv
-    glUniform1i
-    glUniform1iv
-    glUniform2f
-    glUniform2fv
-    glUniform2i
-    glUniform2iv
-    glUniform3f
-    glUniform3fv
-    glUniform3i
-    glUniform3iv
-    glUniform4f
-    glUniform4fv
-    glUniform4i
-    glUniform4iv
-    glUniformMatrix2fv
-    glUniformMatrix3fv
-    glUniformMatrix4fv
-    glUseProgram
-    glValidateProgram
-    glVertexAttrib1f
-    glVertexAttrib1fv
-    glVertexAttrib2f
-    glVertexAttrib2fv
-    glVertexAttrib3f
-    glVertexAttrib3fv
-    glVertexAttrib4f
-    glVertexAttrib4fv
-    glVertexAttribPointer
-    glViewport
-
-    ; Extensions
-    glBlitFramebufferANGLE
-    glRenderbufferStorageMultisampleANGLE
-    glDeleteFencesNV
-    glFinishFenceNV
-    glGenFencesNV
-    glGetFenceivNV
-    glIsFenceNV
-    glSetFenceNV
-    glTestFenceNV
-    glGetTranslatedShaderSourceANGLE
-    glTexStorage2DEXT
-    glGetGraphicsResetStatusEXT
-    glReadnPixelsEXT
-    glGetnUniformfvEXT
-    glGetnUniformivEXT
-    glGenQueriesEXT
-    glDeleteQueriesEXT
-    glIsQueryEXT
-    glBeginQueryEXT
-    glEndQueryEXT
-    glGetQueryivEXT
-    glGetQueryObjectuivEXT
-    glVertexAttribDivisorANGLE
-    glDrawArraysInstancedANGLE
-    glDrawElementsInstancedANGLE
-    glProgramBinaryOES
-    glGetProgramBinaryOES
-    glDrawBuffersEXT
-    glMapBufferOES
-    glUnmapBufferOES
-    glGetBufferPointervOES
-    glMapBufferRangeEXT
-    glFlushMappedBufferRangeEXT
-    glDiscardFramebufferEXT
-    glInsertEventMarkerEXT
-    glPushGroupMarkerEXT
-    glPopGroupMarkerEXT
-    glEGLImageTargetTexture2DOES
-    glEGLImageTargetRenderbufferStorageOES
-    glBindVertexArrayOES
-    glDeleteVertexArraysOES
-    glGenVertexArraysOES
-    glIsVertexArrayOES
-    glDebugMessageControlKHR
-    glDebugMessageInsertKHR
-    glDebugMessageCallbackKHR
-    glGetDebugMessageLogKHR
-    glPushDebugGroupKHR
-    glPopDebugGroupKHR
-    glObjectLabelKHR
-    glGetObjectLabelKHR
-    glObjectPtrLabelKHR
-    glGetObjectPtrLabelKHR
-    glGetPointervKHR
-    glQueryCounterEXT
-    glGetQueryObjectivEXT
-    glGetQueryObjecti64vEXT
-    glGetQueryObjectui64vEXT
-    glBindUniformLocationCHROMIUM
-    glCoverageModulationCHROMIUM
-
-    glMatrixLoadfCHROMIUM
-    glMatrixLoadIdentityCHROMIUM
-    glGenPathsCHROMIUM
-    glDeletePathsCHROMIUM
-    glIsPathCHROMIUM
-    glPathCommandsCHROMIUM
-    glPathParameterfCHROMIUM
-    glPathParameteriCHROMIUM
-    glGetPathParameterfvCHROMIUM
-    glGetPathParameterivCHROMIUM
-    glPathStencilFuncCHROMIUM
-    glStencilFillPathCHROMIUM
-    glStencilStrokePathCHROMIUM
-    glCoverFillPathCHROMIUM
-    glCoverStrokePathCHROMIUM
-    glStencilThenCoverFillPathCHROMIUM
-    glStencilThenCoverStrokePathCHROMIUM
-    glCoverFillPathInstancedCHROMIUM
-    glCoverStrokePathInstancedCHROMIUM
-    glStencilStrokePathInstancedCHROMIUM
-    glStencilFillPathInstancedCHROMIUM
-    glStencilThenCoverFillPathInstancedCHROMIUM
-    glStencilThenCoverStrokePathInstancedCHROMIUM
-    glBindFragmentInputLocationCHROMIUM
-    glProgramPathFragmentInputGenCHROMIUM
-
-    ; GLES 3.0 Functions
-    glReadBuffer
-    glDrawRangeElements
-    glTexImage3D
-    glTexSubImage3D
-    glCopyTexSubImage3D
-    glCompressedTexImage3D
-    glCompressedTexSubImage3D
-    glGenQueries
-    glDeleteQueries
-    glIsQuery
-    glBeginQuery
-    glEndQuery
-    glGetQueryiv
-    glGetQueryObjectuiv
-    glUnmapBuffer
-    glGetBufferPointerv
-    glDrawBuffers
-    glUniformMatrix2x3fv
-    glUniformMatrix3x2fv
-    glUniformMatrix2x4fv
-    glUniformMatrix4x2fv
-    glUniformMatrix3x4fv
-    glUniformMatrix4x3fv
-    glBlitFramebuffer
-    glRenderbufferStorageMultisample
-    glFramebufferTextureLayer
-    glMapBufferRange
-    glFlushMappedBufferRange
-    glBindVertexArray
-    glDeleteVertexArrays
-    glGenVertexArrays
-    glIsVertexArray
-    glGetIntegeri_v
-    glBeginTransformFeedback
-    glEndTransformFeedback
-    glBindBufferRange
-    glBindBufferBase
-    glTransformFeedbackVaryings
-    glGetTransformFeedbackVarying
-    glVertexAttribIPointer
-    glGetVertexAttribIiv
-    glGetVertexAttribIuiv
-    glVertexAttribI4i
-    glVertexAttribI4ui
-    glVertexAttribI4iv
-    glVertexAttribI4uiv
-    glGetUniformuiv
-    glGetFragDataLocation
-    glUniform1ui
-    glUniform2ui
-    glUniform3ui
-    glUniform4ui
-    glUniform1uiv
-    glUniform2uiv
-    glUniform3uiv
-    glUniform4uiv
-    glClearBufferiv
-    glClearBufferuiv
-    glClearBufferfv
-    glClearBufferfi
-    glGetStringi
-    glCopyBufferSubData
-    glGetUniformIndices
-    glGetActiveUniformsiv
-    glGetUniformBlockIndex
-    glGetActiveUniformBlockiv
-    glGetActiveUniformBlockName
-    glUniformBlockBinding
-    glDrawArraysInstanced
-    glDrawElementsInstanced
-    glFenceSync
-    glIsSync
-    glDeleteSync
-    glClientWaitSync
-    glWaitSync
-    glGetInteger64v
-    glGetSynciv
-    glGetInteger64i_v
-    glGetBufferParameteri64v
-    glGenSamplers
-    glDeleteSamplers
-    glIsSampler
-    glBindSampler
-    glSamplerParameteri
-    glSamplerParameteriv
-    glSamplerParameterf
-    glSamplerParameterfv
-    glGetSamplerParameteriv
-    glGetSamplerParameterfv
-    glVertexAttribDivisor
-    glBindTransformFeedback
-    glDeleteTransformFeedbacks
-    glGenTransformFeedbacks
-    glIsTransformFeedback
-    glPauseTransformFeedback
-    glResumeTransformFeedback
-    glGetProgramBinary
-    glProgramBinary
-    glProgramParameteri
-    glInvalidateFramebuffer
-    glInvalidateSubFramebuffer
-    glTexStorage2D
-    glTexStorage3D
-    glGetInternalformativ
-
-    ; GLES 3.1 Functions
-    glDispatchCompute
-    glDispatchComputeIndirect
-    glDrawArraysIndirect
-    glDrawElementsIndirect
-    glFramebufferParameteri
-    glGetFramebufferParameteriv
-    glGetProgramInterfaceiv
-    glGetProgramResourceIndex
-    glGetProgramResourceName
-    glGetProgramResourceiv
-    glGetProgramResourceLocation
-    glUseProgramStages
-    glActiveShaderProgram
-    glCreateShaderProgramv
-    glBindProgramPipeline
-    glDeleteProgramPipelines
-    glGenProgramPipelines
-    glIsProgramPipeline
-    glGetProgramPipelineiv
-    glProgramUniform1i
-    glProgramUniform2i
-    glProgramUniform3i
-    glProgramUniform4i
-    glProgramUniform1ui
-    glProgramUniform2ui
-    glProgramUniform3ui
-    glProgramUniform4ui
-    glProgramUniform1f
-    glProgramUniform2f
-    glProgramUniform3f
-    glProgramUniform4f
-    glProgramUniform1iv
-    glProgramUniform2iv
-    glProgramUniform3iv
-    glProgramUniform4iv
-    glProgramUniform1uiv
-    glProgramUniform2uiv
-    glProgramUniform3uiv
-    glProgramUniform4uiv
-    glProgramUniform1fv
-    glProgramUniform2fv
-    glProgramUniform3fv
-    glProgramUniform4fv
-    glProgramUniformMatrix2fv
-    glProgramUniformMatrix3fv
-    glProgramUniformMatrix4fv
-    glProgramUniformMatrix2x3fv
-    glProgramUniformMatrix3x2fv
-    glProgramUniformMatrix2x4fv
-    glProgramUniformMatrix4x2fv
-    glProgramUniformMatrix3x4fv
-    glProgramUniformMatrix4x3fv
-    glValidateProgramPipeline
-    glGetProgramPipelineInfoLog
-    glBindImageTexture
-    glGetBooleani_v
-    glMemoryBarrier
-    glMemoryBarrierByRegion
-    glTexStorage2DMultisample
-    glGetMultisamplefv
-    glSampleMaski
-    glGetTexLevelParameteriv
-    glGetTexLevelParameterfv
-    glBindVertexBuffer
-    glVertexAttribFormat
-    glVertexAttribIFormat
-    glVertexAttribBinding
-    glVertexBindingDivisor
-
-    ; ANGLE Platform Implementation
-    ANGLEGetDisplayPlatform
-    ANGLEResetDisplayPlatform
-    eglBindAPI
-    eglBindTexImage
-    eglChooseConfig
-    eglCopyBuffers
-    eglCreateContext
-    eglCreatePbufferFromClientBuffer
-    eglCreatePbufferSurface
-    eglCreatePixmapSurface
-    eglCreateWindowSurface
-    eglDestroyContext
-    eglDestroySurface
-    eglGetConfigAttrib
-    eglGetConfigs
-    eglGetCurrentContext
-    eglGetCurrentDisplay
-    eglGetCurrentSurface
-    eglGetDisplay
-    eglGetError
-    eglGetProcAddress
-    eglInitialize
-    eglMakeCurrent
-    eglQueryAPI
-    eglQueryContext
-    eglQueryString
-    eglQuerySurface
-    eglReleaseTexImage
-    eglReleaseThread
-    eglSurfaceAttrib
-    eglSwapBuffers
-    eglSwapInterval
-    eglTerminate
-    eglWaitClient
-    eglWaitGL
-    eglWaitNative
-
-    ; Extensions
-    eglGetPlatformDisplayEXT
-    eglQuerySurfacePointerANGLE
-    eglPostSubBufferNV
-    eglQueryDisplayAttribEXT
-    eglQueryDeviceAttribEXT
-    eglQueryDeviceStringEXT
-    eglCreateImageKHR
-    eglDestroyImageKHR
-    eglCreateDeviceANGLE
-    eglReleaseDeviceANGLE
-    eglCreateStreamKHR
-    eglDestroyStreamKHR
-    eglStreamAttribKHR
-    eglQueryStreamKHR
-    eglQueryStreamu64KHR
-    eglStreamConsumerGLTextureExternalKHR
-    eglStreamConsumerAcquireKHR
-    eglStreamConsumerReleaseKHR
-    eglStreamConsumerGLTextureExternalAttribsNV
-    eglCreateStreamProducerD3DTextureNV12ANGLE
-    eglStreamPostD3DTextureNV12ANGLE
-    eglGetSyncValuesCHROMIUM
-    eglSwapBuffersWithDamageEXT
-
-    ; 1.5 entry points
-    eglCreateSync
-    eglDestroySync
-    eglClientWaitSync
-    eglGetSyncAttrib
-    eglCreateImage
-    eglDestroyImage
-    eglGetPlatformDisplay
-    eglCreatePlatformWindowSurface
-    eglCreatePlatformPixmapSurface
-    eglWaitSync
-    eglBindAPI
-    eglBindTexImage
-    eglChooseConfig
-    eglCopyBuffers
-    eglCreateContext
-    eglCreatePbufferFromClientBuffer
-    eglCreatePbufferSurface
-    eglCreatePixmapSurface
-    eglCreateWindowSurface
-    eglDestroyContext
-    eglDestroySurface
-    eglGetConfigAttrib
-    eglGetConfigs
-    eglGetCurrentContext
-    eglGetCurrentDisplay
-    eglGetCurrentSurface
-    eglGetDisplay
-    eglGetError
-    eglGetProcAddress
-    eglInitialize
-    eglMakeCurrent
-    eglQueryAPI
-    eglQueryContext
-    eglQueryString
-    eglQuerySurface
-    eglReleaseTexImage
-    eglReleaseThread
-    eglSurfaceAttrib
-    eglSwapBuffers
-    eglSwapInterval
-    eglTerminate
-    eglWaitClient
-    eglWaitGL
-    eglWaitNative
-
-    ; Extensions
-    eglGetPlatformDisplayEXT
-    eglQuerySurfacePointerANGLE
-    eglPostSubBufferNV
-    eglQueryDisplayAttribEXT
-    eglQueryDeviceAttribEXT
-    eglQueryDeviceStringEXT
-    eglCreateImageKHR
-    eglDestroyImageKHR
-    eglCreateDeviceANGLE
-    eglReleaseDeviceANGLE
-    eglCreateStreamKHR
-    eglDestroyStreamKHR
-    eglStreamAttribKHR
-    eglQueryStreamKHR
-    eglQueryStreamu64KHR
-    eglStreamConsumerGLTextureExternalKHR
-    eglStreamConsumerAcquireKHR
-    eglStreamConsumerReleaseKHR
-    eglStreamConsumerGLTextureExternalAttribsNV
-    eglCreateStreamProducerD3DTextureNV12ANGLE
-    eglStreamPostD3DTextureNV12ANGLE
-    eglGetSyncValuesCHROMIUM
-    eglSwapBuffersWithDamageEXT
-
-    ; 1.5 entry points
-    eglCreateSync
-    eglDestroySync
-    eglClientWaitSync
-    eglGetSyncAttrib
-    eglCreateImage
-    eglDestroyImage
-    eglGetPlatformDisplay
-    eglCreatePlatformWindowSurface
-    eglCreatePlatformPixmapSurface
-    eglWaitSync
-    eglBindAPI
-    eglBindTexImage
-    eglChooseConfig
-    eglCopyBuffers
-    eglCreateContext
-    eglCreatePbufferFromClientBuffer
-    eglCreatePbufferSurface
-    eglCreatePixmapSurface
-    eglCreateWindowSurface
-    eglDestroyContext
-    eglDestroySurface
-    eglGetConfigAttrib
-    eglGetConfigs
-    eglGetCurrentContext
-    eglGetCurrentDisplay
-    eglGetCurrentSurface
-    eglGetDisplay
-    eglGetError
-    eglGetProcAddress
-    eglInitialize
-    eglMakeCurrent
-    eglQueryAPI
-    eglQueryContext
-    eglQueryString
-    eglQuerySurface
-    eglReleaseTexImage
-    eglReleaseThread
-    eglSurfaceAttrib
-    eglSwapBuffers
-    eglSwapInterval
-    eglTerminate
-    eglWaitClient
-    eglWaitGL
-    eglWaitNative
-
-    ; Extensions
-    eglGetPlatformDisplayEXT
-    eglQuerySurfacePointerANGLE
-    eglPostSubBufferNV
-    eglQueryDisplayAttribEXT
-    eglQueryDeviceAttribEXT
-    eglQueryDeviceStringEXT
-    eglCreateImageKHR
-    eglDestroyImageKHR
-    eglCreateDeviceANGLE
-    eglReleaseDeviceANGLE
-    eglCreateStreamKHR
-    eglDestroyStreamKHR
-    eglStreamAttribKHR
-    eglQueryStreamKHR
-    eglQueryStreamu64KHR
-    eglStreamConsumerGLTextureExternalKHR
-    eglStreamConsumerAcquireKHR
-    eglStreamConsumerReleaseKHR
-    eglStreamConsumerGLTextureExternalAttribsNV
-    eglCreateStreamProducerD3DTextureNV12ANGLE
-    eglStreamPostD3DTextureNV12ANGLE
-    eglGetSyncValuesCHROMIUM
-    eglSwapBuffersWithDamageEXT
-
-    ; 1.5 entry points
-    eglCreateSync
-    eglDestroySync
-    eglClientWaitSync
-    eglGetSyncAttrib
-    eglCreateImage
-    eglDestroyImage
-    eglGetPlatformDisplay
-    eglCreatePlatformWindowSurface
-    eglCreatePlatformPixmapSurface
-    eglWaitSync
diff --git a/src/cobalt/browser/lib/exported/main.h b/src/cobalt/browser/lib/exported/main.h
deleted file mode 100644
index f29270d..0000000
--- a/src/cobalt/browser/lib/exported/main.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2017 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// All imported functions defined below MUST be implemented by client
-// applications.
-
-#ifndef COBALT_BROWSER_LIB_EXPORTED_MAIN_H_
-#define COBALT_BROWSER_LIB_EXPORTED_MAIN_H_
-
-#include "starboard/event.h"
-#include "starboard/export.h"
-#include "starboard/window.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void (*CbLibMainCallbackRegistrationReadyCallback)(void* context);
-typedef void (*CbLibMainOnCobaltInitializedCallback)(void* context);
-typedef bool (*CbLibMainHandleEventCallback)(void* context,
-                                             const SbEvent* event);
-
-// Sets a callback which will be called once Cobalt is ready to accept
-// further callbacks. This is the only callback that may be set before
-// intializing Cobalt; as soon as this callback is called, all remaining
-// callbacks may be set.
-SB_EXPORT_PLATFORM void CbLibMainSetCallbackRegistrationReadyCallback(
-    void* context, CbLibMainCallbackRegistrationReadyCallback callback);
-
-// Sets a callback which will be called after Cobalt has been initialized.
-SB_EXPORT_PLATFORM void CbLibMainSetOnCobaltInitializedCallback(
-    void* context, CbLibMainOnCobaltInitializedCallback callback);
-
-// Sets a callback which will be called when Cobalt is receiving an event from
-// Starboard. Returns true if the client consumed |event|; false otherwise.
-SB_EXPORT_PLATFORM void CbLibMainSetHandleEventCallback(
-    void* context, CbLibMainHandleEventCallback callback);
-
-// Returns a reference to the system window's underlying Starboard window, or
-// nullptr if the system window does not exist.
-//
-// The system window may be destroyed and recreated during Cobalt's application
-// life-cycle E.G. if a Suspend/Resume event occurs.  For this reason, clients
-// should not cache references returned by this call.  A client which requires
-// long-term access to the system window should re-query the reference each time
-// it is needed.
-SB_EXPORT_PLATFORM SbWindow CbLibMainGetSbWindow();
-
-#ifdef __cplusplus
-}  // extern "C"
-#endif
-
-#endif  // COBALT_BROWSER_LIB_EXPORTED_MAIN_H_
diff --git a/src/cobalt/browser/lib/exported/user_agent.h b/src/cobalt/browser/lib/exported/user_agent.h
deleted file mode 100644
index 56cd65c..0000000
--- a/src/cobalt/browser/lib/exported/user_agent.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2018 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// This file provides a simple API for exposing Starboard as a
-// library to another app.
-
-#ifndef COBALT_BROWSER_LIB_EXPORTED_USER_AGENT_H_
-#define COBALT_BROWSER_LIB_EXPORTED_USER_AGENT_H_
-
-#include "starboard/export.h"
-#include "starboard/system.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Sets a string to be appended to the platform segment of the User Agent
-// string that the Starboard application will report. The maximum length of
-// |suffix| is 128 including null terminator (which is required). Returns false
-// if the suffix could not be set, in which case nothing will be apended to the
-// UA string.
-SB_EXPORT_PLATFORM bool CbLibUserAgentSetPlatformNameSuffix(const char* suffix);
-
-// Sets the device type reported in the UA string. If |type| is not a
-// valid device type, the default value for this platform (as per starboard) is
-// kept and the function returns false.
-SB_EXPORT_PLATFORM bool CbLibUserAgentSetDeviceTypeOverride(
-    SbSystemDeviceType type);
-
-// Set the reported device brand and model names. The maximum length of
-// |value| is 512 bytes including null terminator (which is required). If
-// |value| is null, the property is reset to its default value for this
-// platform. Returns true if the value was set or reset successfully.
-SB_EXPORT_PLATFORM bool CbLibUserAgentSetBrandNameOverride(const char* value);
-SB_EXPORT_PLATFORM bool CbLibUserAgentSetModelNameOverride(const char* value);
-
-#ifdef __cplusplus
-}  // extern "C"
-#endif
-
-#endif  // COBALT_BROWSER_LIB_EXPORTED_USER_AGENT_H_
diff --git a/src/cobalt/browser/lib/main.cc b/src/cobalt/browser/lib/main.cc
deleted file mode 100644
index 973527e..0000000
--- a/src/cobalt/browser/lib/main.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright 2017 The Cobalt Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "cobalt/browser/lib/exported/main.h"
-
-#include "base/bind.h"
-#include "base/callback.h"
-#include "base/lazy_instance.h"
-#include "base/logging.h"
-#include "cobalt/base/wrap_main.h"
-#include "cobalt/browser/application.h"
-#include "starboard/event.h"
-#include "starboard/input.h"
-
-namespace {
-
-cobalt::browser::Application* g_application = NULL;
-typedef base::Callback<void(void)> InitializedCallback;
-typedef base::Callback<bool(const SbEvent*)> HandleEventCallback;
-static base::LazyInstance<InitializedCallback>::DestructorAtExit
-    g_on_cobalt_initialized_callback = LAZY_INSTANCE_INITIALIZER;
-static base::LazyInstance<HandleEventCallback>::DestructorAtExit
-    g_handle_event_callback = LAZY_INSTANCE_INITIALIZER;
-
-// We cannot use LazyInstance here as this can be set before Cobalt has been
-// initialized at all - thus there will not yet exist an AtExitManager which
-// means the app would crash if we tried to replace the lazy instance too
-// early. Instead, for this one callback, we simply do things manually.
-CbLibMainCallbackRegistrationReadyCallback g_callback_registration_ready =
-    nullptr;
-void* g_registration_ready_context = nullptr;
-
-void PreloadApplication(int /*argc*/, char** /*argv*/, const char* /*link*/,
-                        const base::Closure& quit_closure) {
-  LOG(INFO) << "Preloading application.";
-  DCHECK(!g_application);
-  CHECK(g_callback_registration_ready);
-  // Register a default event handler up front.
-  CbLibMainSetHandleEventCallback(nullptr, nullptr);
-  g_callback_registration_ready(g_registration_ready_context);
-  g_application =
-      new cobalt::browser::Application(quit_closure, true /*should_preload*/);
-  DCHECK(g_application);
-}
-
-void StartApplication(int /*argc*/, char** /*argv*/, const char* /*link*/,
-                      const base::Closure& quit_closure) {
-  LOG(INFO) << "Starting application.";
-  if (!g_application) {
-    CHECK(g_callback_registration_ready);
-    // Register a default event handler up front.
-    CbLibMainSetHandleEventCallback(nullptr, nullptr);
-    g_callback_registration_ready(g_registration_ready_context);
-    g_application = new cobalt::browser::Application(quit_closure,
-                                                     false /*should_preload*/);
-    DCHECK(g_application);
-  } else {
-    g_application->Start();
-  }
-  DCHECK(g_application);
-  if (!g_on_cobalt_initialized_callback.Get().is_null())
-    g_on_cobalt_initialized_callback.Get().Run();
-}
-
-void StopApplication() {
-  DCHECK(g_application);
-  LOG(INFO) << "Stopping application.";
-  delete g_application;
-  g_application = NULL;
-}
-
-void HandleStarboardEvent(const SbEvent* starboard_event) {
-  if (!g_application) {
-    return;
-  }
-
-  // TODO(dworsham): Host-generated input events will also be fed through the
-  // host callback, leading to re-entrancy issues.  Set up a way of filtering
-  // them somehow.
-  //
-  // For now, works fine with YTVR as only input events are generated by the
-  // host and the host also ignores all input events sent its way.
-  if (!g_handle_event_callback.Get().Run(starboard_event)) {
-    g_application->HandleStarboardEvent(starboard_event);
-  }
-}
-
-}  // namespace
-
-COBALT_WRAP_MAIN(PreloadApplication, StartApplication, HandleStarboardEvent,
-                 StopApplication);
-
-void CbLibMainSetCallbackRegistrationReadyCallback(
-    void* context, CbLibMainOnCobaltInitializedCallback callback) {
-  g_registration_ready_context = context;
-  g_callback_registration_ready = callback;
-}
-
-void CbLibMainSetOnCobaltInitializedCallback(
-    void* context, CbLibMainOnCobaltInitializedCallback callback) {
-  g_on_cobalt_initialized_callback.Get() =
-      callback ? base::Bind(callback, context) : InitializedCallback();
-}
-
-void CbLibMainSetHandleEventCallback(void* context,
-                                     CbLibMainHandleEventCallback callback) {
-  // If the user passes nullptr, provide a default event handler so that it is
-  // never actually null.
-  g_handle_event_callback.Get() =
-      callback ? base::Bind(callback, context)
-               : base::Bind([](const SbEvent*) { return false; });
-}
-
-SbWindow CbLibMainGetSbWindow() {
-  auto* primary_window = cobalt::system_window::SystemWindow::PrimaryWindow();
-  return primary_window ? primary_window->GetSbWindow() : nullptr;
-}
diff --git a/src/cobalt/browser/memory_settings/auto_mem.cc b/src/cobalt/browser/memory_settings/auto_mem.cc
index b0f77ae..03c57a4 100644
--- a/src/cobalt/browser/memory_settings/auto_mem.cc
+++ b/src/cobalt/browser/memory_settings/auto_mem.cc
@@ -301,6 +301,10 @@
   return remote_typeface_cache_size_in_bytes_.get();
 }
 
+const IntSetting* AutoMem::encoded_image_cache_size_in_bytes() const {
+  return encoded_image_cache_size_in_bytes_.get();
+}
+
 const IntSetting* AutoMem::image_cache_size_in_bytes() const {
   return image_cache_size_in_bytes_.get();
 }
@@ -347,6 +351,7 @@
 std::vector<MemorySetting*> AutoMem::AllMemorySettingsMutable() {
   std::vector<MemorySetting*> all_settings;
   // Keep these in alphabetical order.
+  all_settings.push_back(encoded_image_cache_size_in_bytes_.get());
   all_settings.push_back(image_cache_size_in_bytes_.get());
   all_settings.push_back(javascript_gc_threshold_in_bytes_.get());
   all_settings.push_back(misc_cobalt_cpu_size_in_bytes_.get());
@@ -438,6 +443,14 @@
     reduced_gpu_bytes_->set_value(MemorySetting::kUnset, 0);
   }
 
+  // Set the encoded image cache capacity
+  encoded_image_cache_size_in_bytes_ = CreateMemorySetting<IntSetting, int64_t>(
+      switches::kEncodedImageCacheSizeInBytes,
+      command_line_settings.cobalt_encoded_image_cache_size_in_bytes,
+      build_settings.cobalt_encoded_image_cache_size_in_bytes,
+      kDefaultEncodedImageCacheSize);
+  EnsureValuePositive(encoded_image_cache_size_in_bytes_.get());
+
   // Set the ImageCache
   image_cache_size_in_bytes_ = CreateMemorySetting<IntSetting, int64_t>(
       switches::kImageCacheSizeInBytes,
diff --git a/src/cobalt/browser/memory_settings/auto_mem.h b/src/cobalt/browser/memory_settings/auto_mem.h
index f21f463..fd78576 100644
--- a/src/cobalt/browser/memory_settings/auto_mem.h
+++ b/src/cobalt/browser/memory_settings/auto_mem.h
@@ -42,6 +42,7 @@
                    const AutoMemSettings& build_settings);
   ~AutoMem();
 
+  const IntSetting* encoded_image_cache_size_in_bytes() const;
   const IntSetting* image_cache_size_in_bytes() const;
   const IntSetting* javascript_gc_threshold_in_bytes() const;
   // This setting represents all others cpu-memory consuming systems within
@@ -79,6 +80,7 @@
   std::vector<MemorySetting*> AllMemorySettingsMutable();
 
   // All of the following are included in AllMemorySettings().
+  std::unique_ptr<IntSetting> encoded_image_cache_size_in_bytes_;
   std::unique_ptr<IntSetting> image_cache_size_in_bytes_;
   std::unique_ptr<IntSetting> javascript_gc_threshold_in_bytes_;
   std::unique_ptr<IntSetting> misc_cobalt_cpu_size_in_bytes_;
diff --git a/src/cobalt/browser/memory_settings/auto_mem_settings.cc b/src/cobalt/browser/memory_settings/auto_mem_settings.cc
index c5f7032..c0df087 100644
--- a/src/cobalt/browser/memory_settings/auto_mem_settings.cc
+++ b/src/cobalt/browser/memory_settings/auto_mem_settings.cc
@@ -199,6 +199,9 @@
   AutoMemSettings settings(AutoMemSettings::kTypeBuild);
   settings.has_blitter = HasBlitter();
 
+  settings.cobalt_encoded_image_cache_size_in_bytes =
+      MakeValidIfGreaterThanOrEqualToZero(
+          COBALT_ENCODED_IMAGE_CACHE_SIZE_IN_BYTES);
   settings.cobalt_image_cache_size_in_bytes =
       MakeValidIfGreaterThanOrEqualToZero(COBALT_IMAGE_CACHE_SIZE_IN_BYTES);
   settings.javascript_garbage_collection_threshold_in_bytes =
@@ -239,6 +242,8 @@
   AutoMemSettings settings(AutoMemSettings::kTypeCommandLine);
   settings.has_blitter = HasBlitter();
 
+  Set(command_line, &settings.cobalt_encoded_image_cache_size_in_bytes,
+      switches::kEncodedImageCacheSizeInBytes);
   Set(command_line, &settings.cobalt_image_cache_size_in_bytes,
       switches::kImageCacheSizeInBytes);
   Set(command_line, &settings.javascript_garbage_collection_threshold_in_bytes,
diff --git a/src/cobalt/browser/memory_settings/auto_mem_settings.h b/src/cobalt/browser/memory_settings/auto_mem_settings.h
index fcc6e7b..822c9c8 100644
--- a/src/cobalt/browser/memory_settings/auto_mem_settings.h
+++ b/src/cobalt/browser/memory_settings/auto_mem_settings.h
@@ -41,6 +41,7 @@
 
   Type type;
   bool has_blitter;
+  base::Optional<int64_t> cobalt_encoded_image_cache_size_in_bytes;
   base::Optional<int64_t> cobalt_image_cache_size_in_bytes;
   base::Optional<int64_t> javascript_garbage_collection_threshold_in_bytes;
   base::Optional<int64_t> remote_typeface_cache_capacity_in_bytes;
diff --git a/src/cobalt/browser/memory_settings/calculations_test.cc b/src/cobalt/browser/memory_settings/calculations_test.cc
index e181fdb..c19359a 100644
--- a/src/cobalt/browser/memory_settings/calculations_test.cc
+++ b/src/cobalt/browser/memory_settings/calculations_test.cc
@@ -21,7 +21,7 @@
 #include "cobalt/browser/memory_settings/constants.h"
 #include "cobalt/browser/memory_settings/test_common.h"
 #include "cobalt/browser/switches.h"
-#include "starboard/log.h"
+#include "starboard/common/log.h"
 #include "starboard/memory.h"
 #include "starboard/system.h"
 
diff --git a/src/cobalt/browser/memory_settings/constants.h b/src/cobalt/browser/memory_settings/constants.h
index 74631b3..4832d73 100644
--- a/src/cobalt/browser/memory_settings/constants.h
+++ b/src/cobalt/browser/memory_settings/constants.h
@@ -27,6 +27,10 @@
   // This was experimentally selected.
   kMiscCobaltCpuSizeInBytes = 119 * 1024 * 1024,
 
+  // 1mb of encoded data is enough to avoid downloading new images during
+  // suspend/resume.
+  kDefaultEncodedImageCacheSize = 1024 * 1024,  // 1mb
+
   // Decoding image to multi-plane allows the decoded images to use 3/8 of
   // memory compare to their RGBA counter part due to the more compact nature of
   // the YUV images versus RGBA.  As most images in the image cache are jpegs,
diff --git a/src/cobalt/browser/memory_settings/pretty_print.cc b/src/cobalt/browser/memory_settings/pretty_print.cc
index 4f94be0..81c6228 100644
--- a/src/cobalt/browser/memory_settings/pretty_print.cc
+++ b/src/cobalt/browser/memory_settings/pretty_print.cc
@@ -23,8 +23,8 @@
 #include "base/strings/string_split.h"
 #include "cobalt/browser/memory_settings/memory_settings.h"
 #include "cobalt/browser/memory_settings/table_printer.h"
-#include "starboard/log.h"
-#include "starboard/string.h"
+#include "starboard/common/log.h"
+#include "starboard/common/string.h"
 
 namespace cobalt {
 namespace browser {
diff --git a/src/cobalt/browser/memory_settings/pretty_print_test.cc b/src/cobalt/browser/memory_settings/pretty_print_test.cc
index 4401054..716fb86 100644
--- a/src/cobalt/browser/memory_settings/pretty_print_test.cc
+++ b/src/cobalt/browser/memory_settings/pretty_print_test.cc
@@ -27,7 +27,7 @@
 #include "cobalt/browser/memory_settings/memory_settings.h"
 #include "cobalt/browser/memory_settings/test_common.h"
 #include "cobalt/browser/switches.h"
-#include "starboard/log.h"
+#include "starboard/common/log.h"
 #include "starboard/memory.h"
 #include "starboard/system.h"
 
diff --git a/src/cobalt/browser/memory_settings/table_printer.cc b/src/cobalt/browser/memory_settings/table_printer.cc
index 665c501..db19092 100644
--- a/src/cobalt/browser/memory_settings/table_printer.cc
+++ b/src/cobalt/browser/memory_settings/table_printer.cc
@@ -22,7 +22,7 @@
 #include <string>
 
 #include "base/logging.h"
-#include "starboard/log.h"
+#include "starboard/common/log.h"
 
 namespace cobalt {
 namespace browser {
diff --git a/src/cobalt/browser/memory_tracker/tool.cc b/src/cobalt/browser/memory_tracker/tool.cc
index f1d7528..ee9c2d7 100644
--- a/src/cobalt/browser/memory_tracker/tool.cc
+++ b/src/cobalt/browser/memory_tracker/tool.cc
@@ -33,8 +33,8 @@
 #include "cobalt/browser/memory_tracker/tool/tool_impl.h"
 #include "cobalt/browser/memory_tracker/tool/tool_thread.h"
 #include "nb/analytics/memory_tracker_helpers.h"
+#include "starboard/common/log.h"
 #include "starboard/double.h"
-#include "starboard/log.h"
 
 namespace cobalt {
 namespace browser {
diff --git a/src/cobalt/browser/memory_tracker/tool/buffered_file_writer.cc b/src/cobalt/browser/memory_tracker/tool/buffered_file_writer.cc
index a117688..9993d56 100644
--- a/src/cobalt/browser/memory_tracker/tool/buffered_file_writer.cc
+++ b/src/cobalt/browser/memory_tracker/tool/buffered_file_writer.cc
@@ -17,10 +17,10 @@
 #include "base/basictypes.h"
 #include "base/logging.h"
 
-#include "starboard/condition_variable.h"
+#include "starboard/common/condition_variable.h"
+#include "starboard/common/log.h"
+#include "starboard/common/mutex.h"
 #include "starboard/file.h"
-#include "starboard/log.h"
-#include "starboard/mutex.h"
 #include "starboard/thread.h"
 #include "starboard/types.h"
 
diff --git a/src/cobalt/browser/memory_tracker/tool/buffered_file_writer.h b/src/cobalt/browser/memory_tracker/tool/buffered_file_writer.h
index 890cc58..7001464 100644
--- a/src/cobalt/browser/memory_tracker/tool/buffered_file_writer.h
+++ b/src/cobalt/browser/memory_tracker/tool/buffered_file_writer.h
@@ -17,11 +17,11 @@
 
 #include <string>
 
-#include "starboard/condition_variable.h"
+#include "starboard/common/condition_variable.h"
+#include "starboard/common/log.h"
+#include "starboard/common/mutex.h"
 #include "starboard/file.h"
-#include "starboard/log.h"
 #include "starboard/memory.h"
-#include "starboard/mutex.h"
 #include "starboard/thread.h"
 #include "starboard/types.h"
 
diff --git a/src/cobalt/browser/memory_tracker/tool/compressed_time_series_tool.cc b/src/cobalt/browser/memory_tracker/tool/compressed_time_series_tool.cc
index 02a7e02..5cb3d52 100644
--- a/src/cobalt/browser/memory_tracker/tool/compressed_time_series_tool.cc
+++ b/src/cobalt/browser/memory_tracker/tool/compressed_time_series_tool.cc
@@ -25,7 +25,7 @@
 #include "cobalt/browser/memory_tracker/tool/tool_impl.h"
 #include "cobalt/browser/memory_tracker/tool/util.h"
 #include "nb/analytics/memory_tracker.h"
-#include "starboard/log.h"
+#include "starboard/common/log.h"
 #include "starboard/types.h"
 
 namespace cobalt {
diff --git a/src/cobalt/browser/memory_tracker/tool/leak_finder_tool.cc b/src/cobalt/browser/memory_tracker/tool/leak_finder_tool.cc
index 0718489..5d54e95 100644
--- a/src/cobalt/browser/memory_tracker/tool/leak_finder_tool.cc
+++ b/src/cobalt/browser/memory_tracker/tool/leak_finder_tool.cc
@@ -25,7 +25,7 @@
 #include "cobalt/browser/memory_tracker/tool/util.h"
 #include "cobalt/script/util/stack_trace_helpers.h"
 #include "nb/memory_scope.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 
 namespace cobalt {
 namespace browser {
diff --git a/src/cobalt/browser/memory_tracker/tool/log_writer_tool.cc b/src/cobalt/browser/memory_tracker/tool/log_writer_tool.cc
index c913bce..032f5c4 100644
--- a/src/cobalt/browser/memory_tracker/tool/log_writer_tool.cc
+++ b/src/cobalt/browser/memory_tracker/tool/log_writer_tool.cc
@@ -20,7 +20,7 @@
 #include "cobalt/browser/memory_tracker/tool/buffered_file_writer.h"
 #include "cobalt/browser/memory_tracker/tool/params.h"
 #include "starboard/client_porting/poem/string_poem.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 namespace cobalt {
diff --git a/src/cobalt/browser/memory_tracker/tool/malloc_logger_tool.cc b/src/cobalt/browser/memory_tracker/tool/malloc_logger_tool.cc
index c4f9685..9455c7f 100644
--- a/src/cobalt/browser/memory_tracker/tool/malloc_logger_tool.cc
+++ b/src/cobalt/browser/memory_tracker/tool/malloc_logger_tool.cc
@@ -23,7 +23,7 @@
 #include "cobalt/browser/memory_tracker/tool/util.h"
 #include "nb/memory_scope.h"
 #include "starboard/atomic.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 namespace cobalt {
diff --git a/src/cobalt/browser/memory_tracker/tool/malloc_stats_tool.cc b/src/cobalt/browser/memory_tracker/tool/malloc_stats_tool.cc
index d80456a..bbb7e58 100644
--- a/src/cobalt/browser/memory_tracker/tool/malloc_stats_tool.cc
+++ b/src/cobalt/browser/memory_tracker/tool/malloc_stats_tool.cc
@@ -21,7 +21,7 @@
 #include "cobalt/browser/memory_tracker/tool/params.h"
 #include "cobalt/browser/memory_tracker/tool/tool_impl.h"
 #include "nb/analytics/memory_tracker.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 namespace cobalt {
diff --git a/src/cobalt/browser/memory_tracker/tool/memory_size_binner_tool.cc b/src/cobalt/browser/memory_tracker/tool/memory_size_binner_tool.cc
index f752767..709d88a 100644
--- a/src/cobalt/browser/memory_tracker/tool/memory_size_binner_tool.cc
+++ b/src/cobalt/browser/memory_tracker/tool/memory_size_binner_tool.cc
@@ -24,7 +24,7 @@
 #include "cobalt/browser/memory_tracker/tool/util.h"
 #include "nb/analytics/memory_tracker.h"
 #include "nb/analytics/memory_tracker_helpers.h"
-#include "starboard/log.h"
+#include "starboard/common/log.h"
 #include "starboard/types.h"
 
 namespace cobalt {
diff --git a/src/cobalt/browser/memory_tracker/tool/print_csv_tool.cc b/src/cobalt/browser/memory_tracker/tool/print_csv_tool.cc
index a828499..90ecb57 100644
--- a/src/cobalt/browser/memory_tracker/tool/print_csv_tool.cc
+++ b/src/cobalt/browser/memory_tracker/tool/print_csv_tool.cc
@@ -22,7 +22,7 @@
 #include "cobalt/browser/memory_tracker/tool/util.h"
 #include "nb/analytics/memory_tracker.h"
 #include "nb/analytics/memory_tracker_helpers.h"
-#include "starboard/log.h"
+#include "starboard/common/log.h"
 #include "starboard/types.h"
 
 namespace cobalt {
diff --git a/src/cobalt/browser/memory_tracker/tool/print_tool.cc b/src/cobalt/browser/memory_tracker/tool/print_tool.cc
index 092a03e..6344974 100644
--- a/src/cobalt/browser/memory_tracker/tool/print_tool.cc
+++ b/src/cobalt/browser/memory_tracker/tool/print_tool.cc
@@ -25,7 +25,7 @@
 #include "cobalt/browser/memory_tracker/tool/util.h"
 #include "nb/analytics/memory_tracker.h"
 #include "nb/analytics/memory_tracker_helpers.h"
-#include "starboard/log.h"
+#include "starboard/common/log.h"
 #include "starboard/types.h"
 
 namespace cobalt {
diff --git a/src/cobalt/browser/memory_tracker/tool/tool_impl.cc b/src/cobalt/browser/memory_tracker/tool/tool_impl.cc
index fefa0b6..d653a70 100644
--- a/src/cobalt/browser/memory_tracker/tool/tool_impl.cc
+++ b/src/cobalt/browser/memory_tracker/tool/tool_impl.cc
@@ -35,9 +35,9 @@
 #include "nb/concurrent_map.h"
 #include "nb/memory_scope.h"
 #include "starboard/common/semaphore.h"
+#include "starboard/common/string.h"
 #include "starboard/configuration.h"
 #include "starboard/file.h"
-#include "starboard/string.h"
 #include "starboard/system.h"
 
 namespace cobalt {
diff --git a/src/cobalt/browser/memory_tracker/tool/util.cc b/src/cobalt/browser/memory_tracker/tool/util.cc
index 34108dd..fd57c06 100644
--- a/src/cobalt/browser/memory_tracker/tool/util.cc
+++ b/src/cobalt/browser/memory_tracker/tool/util.cc
@@ -21,7 +21,7 @@
 
 #include "base/time/time.h"
 #include "nb/bit_cast.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 
 namespace cobalt {
 namespace browser {
diff --git a/src/cobalt/browser/memory_tracker/tool/util.h b/src/cobalt/browser/memory_tracker/tool/util.h
index 84329aa..a6ef651 100644
--- a/src/cobalt/browser/memory_tracker/tool/util.h
+++ b/src/cobalt/browser/memory_tracker/tool/util.h
@@ -23,7 +23,7 @@
 #include "base/callback.h"
 #include "base/logging.h"
 #include "base/time/time.h"
-#include "starboard/string.h"
+#include "starboard/common/string.h"
 #include "starboard/types.h"
 
 namespace cobalt {
diff --git a/src/cobalt/browser/on_screen_keyboard_starboard_bridge.cc b/src/cobalt/browser/on_screen_keyboard_starboard_bridge.cc
index a5de195..47c92ea 100644
--- a/src/cobalt/browser/on_screen_keyboard_starboard_bridge.cc
+++ b/src/cobalt/browser/on_screen_keyboard_starboard_bridge.cc
@@ -44,7 +44,7 @@
 
 void OnScreenKeyboardStarboardBridge::UpdateSuggestions(
     const script::Sequence<std::string>& suggestions, int ticket) {
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
   std::unique_ptr<const char* []> suggestions_data(
       new const char*[suggestions.size()]);
   for (script::Sequence<std::string>::size_type i = 0; i < suggestions.size();
@@ -59,7 +59,7 @@
   LOG(WARNING)
       << "Starboard version " << SB_API_VERSION
       << " does not support on-screen keyboard suggestions on this platform.";
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 }
 
 bool OnScreenKeyboardStarboardBridge::IsShown() const {
@@ -69,7 +69,7 @@
 
 bool OnScreenKeyboardStarboardBridge::SuggestionsSupported() const {
 // Delay providing the SbWindow until as late as possible.
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
   return SbWindowOnScreenKeyboardSuggestionsSupported(
       sb_window_provider_.Run());
 #else
@@ -77,7 +77,7 @@
       << "Starboard version " << SB_API_VERSION
       << " does not support on-screen keyboard suggestions on this platform.";
   return false;
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 }
 
 scoped_refptr<dom::DOMRect>
diff --git a/src/cobalt/browser/splash_screen_cache.cc b/src/cobalt/browser/splash_screen_cache.cc
index e028e3d..0dfa22b 100644
--- a/src/cobalt/browser/splash_screen_cache.cc
+++ b/src/cobalt/browser/splash_screen_cache.cc
@@ -17,13 +17,14 @@
 #include <memory>
 #include <string>
 
+#include "base/hash.h"
 #include "base/optional.h"
 #include "base/strings/string_util.h"
 #include "base/synchronization/lock.h"
 #include "cobalt/base/get_application_key.h"
+#include "starboard/common/string.h"
 #include "starboard/directory.h"
 #include "starboard/file.h"
-#include "starboard/string.h"
 
 namespace cobalt {
 namespace browser {
@@ -50,7 +51,9 @@
 
 }  // namespace
 
-SplashScreenCache::SplashScreenCache() { base::AutoLock lock(lock_); }
+SplashScreenCache::SplashScreenCache() : last_page_hash_(0) {
+  base::AutoLock lock(lock_);
+}
 
 bool SplashScreenCache::CacheSplashScreen(const std::string& key,
                                           const std::string& content) const {
@@ -59,6 +62,11 @@
     return false;
   }
 
+  // If an identical page was already read from disk, skip writing
+  if (base::Hash(content) == last_page_hash_) {
+    return false;
+  }
+
   char path[SB_FILE_MAX_PATH] = {0};
   if (!SbSystemGetPath(kSbSystemPathCacheDirectory, path, SB_FILE_MAX_PATH)) {
     return false;
@@ -107,6 +115,7 @@
   const int kFileSize = static_cast<int>(info.size);
   result->reset(new char[kFileSize]);
   int result_size = cache_file.ReadAll(result->get(), kFileSize);
+  last_page_hash_ = base::Hash(result->get(), result_size);
   return result_size;
 }
 
diff --git a/src/cobalt/browser/splash_screen_cache.h b/src/cobalt/browser/splash_screen_cache.h
index b7f19f4..deacfc8 100644
--- a/src/cobalt/browser/splash_screen_cache.h
+++ b/src/cobalt/browser/splash_screen_cache.h
@@ -53,6 +53,8 @@
  private:
   // Lock to protect access to the cache file.
   mutable base::Lock lock_;
+  // Hash of the last read page contents.
+  mutable uint32_t last_page_hash_;
 };
 
 }  // namespace browser
diff --git a/src/cobalt/browser/switches.cc b/src/cobalt/browser/switches.cc
index bc2d9ee..0465c29 100644
--- a/src/cobalt/browser/switches.cc
+++ b/src/cobalt/browser/switches.cc
@@ -23,10 +23,6 @@
 // message needs to be inserted to the help_map manually.
 #if defined(ENABLE_DEBUG_COMMAND_LINE_SWITCHES)
 
-const char kAudioDecoderStub[] = "audio_decoder_stub";
-const char kAudioDecoderStubHelp[] =
-    "Decode audio data using ShellRawAudioDecoderStub.";
-
 const char kDebugConsoleMode[] = "debug_console";
 const char kDebugConsoleModeHelp[] =
     "Switches different debug console modes: on | hud | off";
@@ -59,6 +55,14 @@
     "very similar, even if it is not exactly the same.  Setting this flag "
     "avoids that kind of behavior, allowing strict screen-diff tests to pass.";
 
+const char kDisableMediaCodecs[] = "disable_media_codecs";
+const char kDisableMediaCodecsHelp[] =
+    "Disables the semicolon-separated list of codecs that will be treated as "
+    "unsupported for media playback. Used for debugging and testing purposes."
+    "It uses sub-string match to determine whether a codec is disabled, for "
+    "example, setting the value to \"avc;hvc\" will disable any h264 and h265 "
+    "playbacks.";
+
 const char kDisableRasterizerCaching[] = "disable_rasterizer_caching";
 const char kDisableRasterizerCachingHelp[] =
     "Disables caching of rasterized render tree nodes; caching improves "
@@ -78,9 +82,6 @@
 const char kDisableWebDriver[] = "disable_webdriver";
 const char kDisableWebDriverHelp[] = "Do not create the WebDriver server.";
 
-const char kDisableWebmVp9[] = "disable_webm_vp9";
-const char kDisableWebmVp9Help[] = "Disable webm/vp9.";
-
 const char kExtraWebFileDir[] = "web_file_path";
 const char kExtraWebFileDirHelp[] =
     "Additional base directory for accessing web files via file://.";
@@ -112,11 +113,6 @@
 const char kMinLogLevelHelp[] =
     "Set the minimum logging level: info|warning|error|fatal.";
 
-const char kNullAudioStreamer[] = "null_audio_streamer";
-const char kNullAudioStreamerHelp[] =
-    "Use the NullAudioStreamer. Audio will be decoded but will not play back. "
-    "No audio output library will be initialized or used.";
-
 const char kNullSavegame[] = "null_savegame";
 const char kNullSavegameHelp[] =
     "Setting NullSavegame will result in no data being read from previous "
@@ -185,10 +181,6 @@
     "speech synthesis API. If the platform doesn't have speech synthesis, "
     "TTSLogger will be used instead.";
 
-extern const char kVideoDecoderStub[] = "video_decoder_stub";
-extern const char kVideoDecoderStubHelp[] =
-    "Decode video data using ShellRawVideoDecoderStub.";
-
 const char kWebDriverListenIp[] = "webdriver_listen_ip";
 const char kWebDriverListenIpHelp[] =
     "IP that the WebDriver server should be listening on. (INADDR_ANY if "
@@ -224,6 +216,12 @@
     "video on platforms that do not support stereoscopy natively, letting the "
     "client apply a stereo mesh projection (one that differs for each eye).";
 
+const char kEncodedImageCacheSizeInBytes[] =
+    "encoded_image_cache_size_in_bytes";
+const char kEncodedImageCacheSizeInBytesHelp[] =
+    "Determines the capacity of the encoded image cache which manages encoded "
+    "images downloaded from a web page. The cache uses CPU memory.";
+
 const char kForceMigrationForStoragePartitioning[] =
     "force_migration_for_storage_partitioning";
 const char kForceMigrationForStoragePartitioningHelp[] =
@@ -252,8 +250,8 @@
 const char kImageCacheSizeInBytes[] = "image_cache_size_in_bytes";
 const char kImageCacheSizeInBytesHelp[] =
     "Determines the capacity of the image cache which manages image "
-    "surfaces300 downloaded from a web page.  While it depends on the "
-    "platform, often (and ideally) these images are cached within GPU memory.";
+    "surfaces downloaded from a web page.  While it depends on the platform, "
+    "often (and ideally) these images are cached within GPU memory.";
 
 const char kInitialURL[] = "url";
 const char kInitialURLHelp[] =
@@ -384,26 +382,23 @@
   std::string help_message;
   std::map<const char*, const char*> help_map {
 #if defined(ENABLE_DEBUG_COMMAND_LINE_SWITCHES)
-    {kAudioDecoderStub, kAudioDecoderStubHelp},
-        {kDebugConsoleMode, kDebugConsoleModeHelp},
+    {kDebugConsoleMode, kDebugConsoleModeHelp},
 #if defined(ENABLE_DEBUGGER)
         {kWaitForWebDebugger, kWaitForWebDebuggerHelp},
 #endif  // ENABLE_DEBUGGER
         {kDisableImageAnimations, kDisableImageAnimationsHelp},
         {kForceDeterministicRendering, kForceDeterministicRenderingHelp},
+        {kDisableMediaCodecs, kDisableMediaCodecsHelp},
         {kDisableRasterizerCaching, kDisableRasterizerCachingHelp},
         {kDisableSignIn, kDisableSignInHelp},
         {kDisableSplashScreenOnReloads, kDisableSplashScreenOnReloadsHelp},
         {kDisableWebDriver, kDisableWebDriverHelp},
-        {kDisableWebmVp9, kDisableWebmVp9Help},
         {kExtraWebFileDir, kExtraWebFileDirHelp},
         {kFakeMicrophone, kFakeMicrophoneHelp},
         {kIgnoreCertificateErrors, kIgnoreCertificateErrorsHelp},
         {kInputFuzzer, kInputFuzzerHelp}, {kMemoryTracker, kMemoryTrackerHelp},
         {kMinCompatibilityVersion, kMinCompatibilityVersionHelp},
-        {kMinLogLevel, kMinLogLevelHelp},
-        {kNullAudioStreamer, kNullAudioStreamerHelp},
-        {kNullSavegame, kNullSavegameHelp},
+        {kMinLogLevel, kMinLogLevelHelp}, {kNullSavegame, kNullSavegameHelp},
         {kDisablePartialLayout, kDisablePartialLayoutHelp}, {kProd, kProdHelp},
         {kRemoteDebuggingPort, kRemoteDebuggingPortHelp},
         {kRequireCSP, kRequireCSPHelp},
@@ -413,8 +408,7 @@
         {kSuspendFuzzer, kSuspendFuzzerHelp}, {kTimedTrace, kTimedTraceHelp},
         {kUserAgent, kUserAgentHelp},
         {kUserAgentOsNameVersion, kUserAgentOsNameVersionHelp},
-        {kUseTTS, kUseTTSHelp}, {kVideoDecoderStub, kVideoDecoderStubHelp},
-        {kWebDriverListenIp, kWebDriverListenIpHelp},
+        {kUseTTS, kUseTTSHelp}, {kWebDriverListenIp, kWebDriverListenIpHelp},
         {kWebDriverPort, kWebDriverPortHelp},
 #if SB_HAS(ON_SCREEN_KEYBOARD)
         {kDisableOnScreenKeyboard, kDisableOnScreenKeyboardHelp},
@@ -424,6 +418,7 @@
         {kDisableJavaScriptJit, kDisableJavaScriptJitHelp},
         {kDisableTimerResolutionLimit, kDisableTimerResolutionLimitHelp},
         {kEnableMapToMeshRectanglar, kEnableMapToMeshRectanglarHelp},
+        {kEncodedImageCacheSizeInBytes, kEncodedImageCacheSizeInBytesHelp},
         {kForceMigrationForStoragePartitioning,
          kForceMigrationForStoragePartitioningHelp},
         {kFPSPrint, kFPSPrintHelp}, {kFPSOverlay, kFPSOverlayHelp},
diff --git a/src/cobalt/browser/switches.h b/src/cobalt/browser/switches.h
index 365df8b..6b3b163 100644
--- a/src/cobalt/browser/switches.h
+++ b/src/cobalt/browser/switches.h
@@ -24,8 +24,6 @@
 namespace switches {
 
 #if defined(ENABLE_DEBUG_COMMAND_LINE_SWITCHES)
-extern const char kAudioDecoderStub[];
-extern const char kAudioDecoderStubHelp[];
 extern const char kDebugConsoleMode[];
 extern const char kDebugConsoleModeHelp[];
 
@@ -39,6 +37,8 @@
 extern const char kDisableImageAnimations[];
 extern const char kDisableImageAnimationsHelp[];
 extern const char kForceDeterministicRendering[];
+extern const char kDisableMediaCodecs[];
+extern const char kDisableMediaCodecsHelp[];
 extern const char kDisableRasterizerCaching[];
 extern const char kDisableSignIn[];
 extern const char kDisableSignInHelp[];
@@ -46,8 +46,6 @@
 extern const char kDisableSplashScreenOnReloadsHelp[];
 extern const char kDisableWebDriver[];
 extern const char kDisableWebDriverHelp[];
-extern const char kDisableWebmVp9[];
-extern const char kDisableWebmVp9Help[];
 extern const char kExtraWebFileDir[];
 extern const char kExtraWebFileDirHelp[];
 extern const char kFakeMicrophone[];
@@ -62,8 +60,6 @@
 extern const char kMinCompatibilityVersionHelp[];
 extern const char kMinLogLevel[];
 extern const char kMinLogLevelHelp[];
-extern const char kNullAudioStreamer[];
-extern const char kNullAudioStreamerHelp[];
 extern const char kNullSavegame[];
 extern const char kNullSavegameHelp[];
 extern const char kDisablePartialLayout[];
@@ -86,8 +82,6 @@
 extern const char kUserAgentOsNameVersionHelp[];
 extern const char kUseTTS[];
 extern const char kUseTTSHelp[];
-extern const char kVideoDecoderStub[];
-extern const char kVideoDecoderStubHelp[];
 extern const char kWebDriverListenIp[];
 extern const char kWebDriverListenIpHelp[];
 extern const char kWebDriverPort[];
@@ -104,6 +98,8 @@
 extern const char kDisableTimerResolutionLimit[];
 extern const char kDisableTimerResolutionLimitHelp[];
 extern const char kEnableMapToMeshRectanglar[];
+extern const char kEncodedImageCacheSizeInBytes[];
+extern const char kEncodedImageCacheSizeInBytesHelp[];
 extern const char kForceMigrationForStoragePartitioning[];
 extern const char kFPSPrint[];
 extern const char kFPSPrintHelp[];
diff --git a/src/cobalt/browser/system_platform_error_handler.cc b/src/cobalt/browser/system_platform_error_handler.cc
index 1771847..49e9b25 100644
--- a/src/cobalt/browser/system_platform_error_handler.cc
+++ b/src/cobalt/browser/system_platform_error_handler.cc
@@ -25,7 +25,7 @@
 
   CallbackData* callback_data = new CallbackData{ &mutex_, options.callback };
 
-#if SB_API_VERSION < SB_DEPRECATE_CLEAR_PLATFORM_ERROR_VERSION
+#if SB_API_VERSION < 11
   SbSystemPlatformError handle = SbSystemRaisePlatformError(options.error_type,
       &SystemPlatformErrorHandler::HandleSystemPlatformErrorResponse,
       callback_data);
@@ -34,7 +34,7 @@
     delete callback_data;
     callback_data = nullptr;
   }
-#else   // SB_API_VERSION < SB_DEPRECATE_CLEAR_PLATFORM_ERROR_VERSION
+#else   // SB_API_VERSION < 11
   if (!SbSystemRaisePlatformError(
           options.error_type,
           &SystemPlatformErrorHandler::HandleSystemPlatformErrorResponse,
@@ -43,7 +43,7 @@
     delete callback_data;
     callback_data = nullptr;
   }
-#endif  // SB_API_VERSION < SB_DEPRECATE_CLEAR_PLATFORM_ERROR_VERSION
+#endif  // SB_API_VERSION < 11
 
   // In case the response callback is never called, track the callback data
   // for all active errors. When this object is destroyed, all dangling data
diff --git a/src/cobalt/browser/system_platform_error_handler.h b/src/cobalt/browser/system_platform_error_handler.h
index e60b67c..aefb8f0 100644
--- a/src/cobalt/browser/system_platform_error_handler.h
+++ b/src/cobalt/browser/system_platform_error_handler.h
@@ -19,7 +19,7 @@
 #include <vector>
 
 #include "base/callback.h"
-#include "starboard/mutex.h"
+#include "starboard/common/mutex.h"
 #include "starboard/system.h"
 
 namespace cobalt {
diff --git a/src/cobalt/browser/trace_manager.h b/src/cobalt/browser/trace_manager.h
index 897b295..b774f11 100644
--- a/src/cobalt/browser/trace_manager.h
+++ b/src/cobalt/browser/trace_manager.h
@@ -64,7 +64,7 @@
   // Whether input tracing is enabled.
   bool input_tracing_enabled_;
 
-  base::ThreadChecker thread_checker_;
+  THREAD_CHECKER(thread_checker_);
   // This object can be set to start a trace if a hotkey (like F3) is pressed.
   // While initialized, it means that a trace is on-going.
   scoped_ptr<trace_event::ScopedTraceToFile> trace_to_file_;
diff --git a/src/cobalt/browser/user_agent_string.cc b/src/cobalt/browser/user_agent_string.cc
index 47670c1..42c7034 100644
--- a/src/cobalt/browser/user_agent_string.cc
+++ b/src/cobalt/browser/user_agent_string.cc
@@ -20,110 +20,14 @@
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "cobalt/browser/switches.h"
-#if defined(COBALT_ENABLE_LIB)
-#include "cobalt/browser/lib/exported/user_agent.h"
-#endif
 #include "cobalt/renderer/get_default_rasterizer_for_platform.h"
 #include "cobalt/script/javascript_engine.h"
 #include "cobalt/version.h"
 #include "cobalt_build_id.h"  // NOLINT(build/include)
-#include "starboard/log.h"
-#include "starboard/string.h"
+#include "starboard/common/log.h"
+#include "starboard/common/string.h"
 #include "starboard/system.h"
 
-// Setup CobaltLib overrides for some user agent components.
-#if defined(COBALT_ENABLE_LIB)
-
-namespace {
-
-// Max length including null terminator.
-const size_t kUserAgentPlatformSuffixMaxLength = 128;
-char g_user_agent_platform_suffix[kUserAgentPlatformSuffixMaxLength] = {0};
-
-bool g_device_type_override_set = false;
-SbSystemDeviceType g_device_type_override = kSbSystemDeviceTypeUnknown;
-
-// Max length including null terminator.
-const size_t kPropertyMaxLength = 512;
-bool g_brand_name_override_set = false;
-char g_brand_name_override[kPropertyMaxLength] = {0};
-bool g_model_name_override_set = false;
-char g_model_name_override[kPropertyMaxLength] = {0};
-
-bool CopyStringAndTestIfSuccess(char* out_value, size_t value_length,
-                                const char* from_value) {
-  if (strlen(from_value) + 1 > value_length) return false;
-  base::strlcpy(out_value, from_value, value_length);
-  return true;
-}
-
-}  // namespace
-
-// Allow host app to append a suffix to the reported platform name.
-bool CbLibUserAgentSetPlatformNameSuffix(const char* suffix) {
-  if (!CopyStringAndTestIfSuccess(g_user_agent_platform_suffix,
-                                  kPropertyMaxLength, suffix)) {
-    // If the suffix is too large then nothing is appended to the platform.
-    g_user_agent_platform_suffix[0] = '\0';
-    return false;
-  }
-
-  return true;
-}
-
-bool CbLibUserAgentSetBrandNameOverride(const char* value) {
-  if (!value) {
-    g_brand_name_override_set = false;
-    return true;
-  }
-
-  if (CopyStringAndTestIfSuccess(g_brand_name_override, kPropertyMaxLength,
-                                 value)) {
-    g_brand_name_override_set = true;
-    return true;
-  }
-
-  // Failed to reset/set value.
-  return false;
-}
-
-bool CbLibUserAgentSetModelNameOverride(const char* value) {
-  if (!value) {
-    g_model_name_override_set = false;
-    return true;
-  }
-
-  if (CopyStringAndTestIfSuccess(g_model_name_override, kPropertyMaxLength,
-                                 value)) {
-    g_model_name_override_set = true;
-    return true;
-  }
-
-  // Failed to reset/set value.
-  return false;
-}
-
-bool CbLibUserAgentSetDeviceTypeOverride(SbSystemDeviceType device_type) {
-  switch (device_type) {
-    case kSbSystemDeviceTypeBlueRayDiskPlayer:
-    case kSbSystemDeviceTypeGameConsole:
-    case kSbSystemDeviceTypeOverTheTopBox:
-    case kSbSystemDeviceTypeSetTopBox:
-    case kSbSystemDeviceTypeTV:
-    case kSbSystemDeviceTypeDesktopPC:
-    case kSbSystemDeviceTypeAndroidTV:
-    case kSbSystemDeviceTypeUnknown:
-      g_device_type_override_set = true;
-      g_device_type_override = device_type;
-      return true;
-    default:
-      g_device_type_override_set = false;
-      return false;
-  }
-}
-
-#endif  // defined(COBALT_ENABLE_LIB)
-
 namespace cobalt {
 namespace browser {
 
@@ -212,7 +116,7 @@
   SbSystemDeviceType device_type = SbSystemGetDeviceType();
 
   // Original Design Manufacturer (ODM)
-#if SB_API_VERSION >= SB_ODM_VERSION
+#if SB_API_VERSION >= 11
   result = SbSystemGetProperty(kSbSystemPropertyOriginalDesignManufacturerName,
                                value, kSystemPropertyMaxLength);
 #else
@@ -296,25 +200,6 @@
     platform_info.connection_type = connection_type;
   }
 
-#if defined(COBALT_ENABLE_LIB)
-  if (g_user_agent_platform_suffix[0] != '\0') {
-    platform_info.os_name_and_version += "; ";
-    platform_info.os_name_and_version += g_user_agent_platform_suffix;
-  }
-
-  // Check for overrided values, to see if a client of CobaltLib has explicitly
-  // requested that some values be overridden.
-  if (g_device_type_override_set) {
-    platform_info.device_type = g_device_type_override;
-  }
-  if (g_brand_name_override_set) {
-    platform_info.brand = g_brand_name_override;
-  }
-  if (g_model_name_override_set) {
-    platform_info.model = g_model_name_override;
-  }
-#endif  // defined(COBALT_ENABLE_LIB)
-
   return platform_info;
 }
 
diff --git a/src/cobalt/browser/web_module.cc b/src/cobalt/browser/web_module.cc
index 7a7c08b..e1ba8b4 100644
--- a/src/cobalt/browser/web_module.cc
+++ b/src/cobalt/browser/web_module.cc
@@ -67,7 +67,7 @@
 #include "cobalt/script/javascript_engine.h"
 #include "cobalt/storage/storage_manager.h"
 #include "starboard/accessibility.h"
-#include "starboard/log.h"
+#include "starboard/common/log.h"
 
 namespace cobalt {
 namespace browser {
@@ -138,11 +138,11 @@
   // Injects an on screen keyboard blurred event into the web module. Event is
   // directed at the on screen keyboard element.
   void InjectOnScreenKeyboardBlurredEvent(int ticket);
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
   // Injects an on screen keyboard suggestions updated event into the web
   // module. Event is directed at the on screen keyboard element.
   void InjectOnScreenKeyboardSuggestionsUpdatedEvent(int ticket);
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
 
   // Injects a keyboard event into the web module. Event is directed at a
@@ -280,7 +280,7 @@
   void OnCspPolicyChanged();
 
   scoped_refptr<script::GlobalEnvironment> global_environment() {
-    DCHECK(thread_checker_.CalledOnValidThread());
+    DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
     return global_environment_;
   }
 
@@ -307,7 +307,7 @@
 
   // Thread checker ensures all calls to the WebModule are made from the same
   // thread that it is created in.
-  base::ThreadChecker thread_checker_;
+  THREAD_CHECKER(thread_checker_);
 
   std::string name_;
 
@@ -527,9 +527,11 @@
       read_cache_callback));
   DCHECK(fetcher_factory_);
 
-  loader_factory_.reset(
-      new loader::LoaderFactory(fetcher_factory_.get(), resource_provider_,
-                                data.options.loader_thread_priority));
+  DCHECK_LE(0, data.options.encoded_image_cache_capacity);
+  loader_factory_.reset(new loader::LoaderFactory(
+      name_.c_str(), fetcher_factory_.get(), resource_provider_,
+      data.options.encoded_image_cache_capacity,
+      data.options.loader_thread_priority));
 
   animated_image_tracker_.reset(new loader::image::AnimatedImageTracker(
       data.options.animated_image_decode_thread_priority));
@@ -740,7 +742,7 @@
 }
 
 WebModule::Impl::~Impl() {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(is_running_);
   is_running_ = false;
   global_environment_->SetReportEvalCallback(base::Closure());
@@ -788,7 +790,7 @@
                                        const scoped_refptr<dom::Event>& event) {
   TRACE_EVENT1("cobalt::browser", "WebModule::Impl::InjectInputEvent()",
                "event", event->type().c_str());
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(is_running_);
   DCHECK(window_);
 
@@ -819,7 +821,7 @@
 }
 
 void WebModule::Impl::InjectOnScreenKeyboardShownEvent(int ticket) {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(is_running_);
   DCHECK(window_);
   DCHECK(window_->on_screen_keyboard());
@@ -828,7 +830,7 @@
 }
 
 void WebModule::Impl::InjectOnScreenKeyboardHiddenEvent(int ticket) {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(is_running_);
   DCHECK(window_);
   DCHECK(window_->on_screen_keyboard());
@@ -837,7 +839,7 @@
 }
 
 void WebModule::Impl::InjectOnScreenKeyboardFocusedEvent(int ticket) {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(is_running_);
   DCHECK(window_);
   DCHECK(window_->on_screen_keyboard());
@@ -846,7 +848,7 @@
 }
 
 void WebModule::Impl::InjectOnScreenKeyboardBlurredEvent(int ticket) {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(is_running_);
   DCHECK(window_);
   DCHECK(window_->on_screen_keyboard());
@@ -854,17 +856,17 @@
   window_->on_screen_keyboard()->DispatchBlurEvent(ticket);
 }
 
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
 void WebModule::Impl::InjectOnScreenKeyboardSuggestionsUpdatedEvent(
     int ticket) {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(is_running_);
   DCHECK(window_);
   DCHECK(window_->on_screen_keyboard());
 
   window_->on_screen_keyboard()->DispatchSuggestionsUpdatedEvent(ticket);
 }
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
 
 void WebModule::Impl::InjectKeyboardEvent(scoped_refptr<dom::Element> element,
@@ -894,7 +896,7 @@
 void WebModule::Impl::ExecuteJavascript(
     const std::string& script_utf8, const base::SourceLocation& script_location,
     base::WaitableEvent* got_result, std::string* result, bool* out_succeeded) {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(is_running_);
   DCHECK(script_runner_);
 
@@ -913,13 +915,13 @@
 }
 
 void WebModule::Impl::ClearAllIntervalsAndTimeouts() {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(window_);
   window_->DestroyTimers();
 }
 
 void WebModule::Impl::OnRanAnimationFrameCallbacks() {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(is_running_);
   // Notify the stat tracker that the animation frame callbacks have finished.
   // This may end the current event being tracked.
@@ -929,7 +931,7 @@
 
 void WebModule::Impl::OnRenderTreeProduced(
     const LayoutResults& layout_results) {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(is_running_);
 
   last_render_tree_produced_time_ = base::TimeTicks::Now();
@@ -964,7 +966,7 @@
 void WebModule::Impl::ProcessOnRenderTreeRasterized(
     const base::TimeTicks& produced_time,
     const base::TimeTicks& rasterized_time) {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   web_module_stat_tracker_->OnRenderTreeRasterized(produced_time,
                                                    rasterized_time);
   if (produced_time >= last_render_tree_produced_time_) {
@@ -977,7 +979,7 @@
 }
 
 void WebModule::Impl::OnCspPolicyChanged() {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(is_running_);
   DCHECK(window_);
   DCHECK(window_->document());
@@ -995,7 +997,7 @@
 
 bool WebModule::Impl::ReportScriptError(
     const script::ErrorReport& error_report) {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(is_running_);
   DCHECK(window_);
   return window_->ReportScriptError(error_report);
@@ -1005,7 +1007,7 @@
 void WebModule::Impl::CreateWindowDriver(
     const webdriver::protocol::WindowId& window_id,
     std::unique_ptr<webdriver::WindowDriver>* window_driver_out) {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(is_running_);
   DCHECK(window_);
   DCHECK(window_weak_);
@@ -1023,7 +1025,7 @@
 
 #if defined(ENABLE_DEBUGGER)
 void WebModule::Impl::WaitForWebDebugger() {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(debug_module_);
   LOG(WARNING) << "\n-------------------------------------"
                   "\n Waiting for web debugger to connect "
@@ -1036,7 +1038,7 @@
 
 void WebModule::Impl::InjectCustomWindowAttributes(
     const Options::InjectedWindowAttributes& attributes) {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   DCHECK(global_environment_);
 
   for (Options::InjectedWindowAttributes::const_iterator iter =
@@ -1192,7 +1194,7 @@
 
 void WebModule::Impl::ReduceMemory() {
   TRACE_EVENT0("cobalt::browser", "WebModule::Impl::ReduceMemory()");
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   if (!is_running_) {
     return;
   }
@@ -1214,7 +1216,7 @@
     const JavaScriptHeapStatisticsCallback& callback) {
   TRACE_EVENT0("cobalt::browser",
                "WebModule::Impl::GetJavaScriptHeapStatistics()");
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   script::HeapStatistics heap_statistics =
       javascript_engine_->GetHeapStatistics();
   callback.Run(heap_statistics);
@@ -1240,7 +1242,7 @@
 }
 
 void WebModule::Impl::InjectBeforeUnloadEvent() {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   if (window_ && window_->HasEventListener(base::Tokens::beforeunload())) {
     window_->DispatchEvent(new dom::Event(base::Tokens::beforeunload()));
   } else if (!on_before_unload_fired_but_not_handled_.is_null()) {
@@ -1249,7 +1251,7 @@
 }
 
 void WebModule::Impl::InjectCaptionSettingsChangedEvent() {
-  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
   system_caption_settings_->OnCaptionSettingsChanged();
 }
 
@@ -1299,22 +1301,7 @@
 WebModule::Options::Options()
     : name("WebModule"),
       layout_trigger(layout::LayoutManager::kOnDocumentMutation),
-      image_cache_capacity(32 * 1024 * 1024),
-      remote_typeface_cache_capacity(4 * 1024 * 1024),
-      mesh_cache_capacity(COBALT_MESH_CACHE_SIZE_IN_BYTES),
-      enable_map_to_mesh_rectangular(false),
-      csp_enforcement_mode(dom::kCspEnforcementEnable),
-      csp_insecure_allowed_token(0),
-      track_event_stats(false),
-      image_cache_capacity_multiplier_when_playing_video(1.0f),
-      thread_priority(base::ThreadPriority::NORMAL),
-      loader_thread_priority(base::ThreadPriority::BACKGROUND),
-      animated_image_decode_thread_priority(base::ThreadPriority::BACKGROUND),
-      video_playback_rate_multiplier(1.f),
-      enable_image_animations(true),
-      should_retain_remote_typeface_cache_on_suspend(false),
-      can_fetch_cache(false),
-      clear_window_with_background_color(true) {}
+      mesh_cache_capacity(COBALT_MESH_CACHE_SIZE_IN_BYTES) {}
 
 WebModule::WebModule(
     const GURL& initial_url, base::ApplicationState initial_application_state,
@@ -1446,7 +1433,7 @@
                  base::Unretained(impl_.get()), ticket));
 }
 
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
 void WebModule::InjectOnScreenKeyboardSuggestionsUpdatedEvent(int ticket) {
   TRACE_EVENT1("cobalt::browser",
                "WebModule::InjectOnScreenKeyboardSuggestionsUpdatedEvent()",
@@ -1459,7 +1446,7 @@
           &WebModule::Impl::InjectOnScreenKeyboardSuggestionsUpdatedEvent,
           base::Unretained(impl_.get()), ticket));
 }
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
 
 void WebModule::InjectKeyboardEvent(base::Token type,
diff --git a/src/cobalt/browser/web_module.h b/src/cobalt/browser/web_module.h
index d43820a..5e94dbb 100644
--- a/src/cobalt/browser/web_module.h
+++ b/src/cobalt/browser/web_module.h
@@ -136,49 +136,54 @@
     // Whether Cobalt is forbidden to render without receiving CSP headers.
     csp::CSPHeaderPolicy require_csp;
 
+    // Encoded image cache capacity in bytes.
+    int encoded_image_cache_capacity = 1024 * 1024;
+
     // Image cache capacity in bytes.
-    int image_cache_capacity;
+    int image_cache_capacity = 32 * 1024 * 1024;
 
     // Typeface cache capacity in bytes.
-    int remote_typeface_cache_capacity;
+    int remote_typeface_cache_capacity = 4 * 1024 * 1024;
 
     // Mesh cache capacity in bytes.
     int mesh_cache_capacity;
 
     // Whether map-to-mesh for rectangular videos is enabled.
-    bool enable_map_to_mesh_rectangular;
+    bool enable_map_to_mesh_rectangular = false;
 
     // Content Security Policy enforcement mode for this web module.
-    dom::CspEnforcementType csp_enforcement_mode;
+    dom::CspEnforcementType csp_enforcement_mode = dom::kCspEnforcementEnable;
 
     // Token obtained from CSP to allow creation of insecure delegates.
-    int csp_insecure_allowed_token;
+    int csp_insecure_allowed_token = 0;
 
     // Whether or not the web module's stat tracker should track event stats.
-    bool track_event_stats;
+    bool track_event_stats = false;
 
     // If set to something other than 1.0f, when a video starts to play, the
     // image cache will be flushed and temporarily multiplied by this value (
     // must be less than or equal to 1.0f) until the video ends.  This can
     // help for platforms that are low on image memory while playing a video.
-    float image_cache_capacity_multiplier_when_playing_video;
+    float image_cache_capacity_multiplier_when_playing_video = 1.0f;
 
     // Specifies the priority of the web module's thread.  This is the thread
     // that is responsible for executing JavaScript, managing the DOM, and
     // performing layouts.  The default value is base::ThreadPriority::NORMAL.
-    base::ThreadPriority thread_priority;
+    base::ThreadPriority thread_priority = base::ThreadPriority::NORMAL;
 
     // Specifies the priority that the web module's corresponding loader thread
     // will be assigned.  This is the thread responsible for performing resource
     // decoding, such as image decoding.  The default value is
     // base::ThreadPriority::BACKGROUND.
-    base::ThreadPriority loader_thread_priority;
+    base::ThreadPriority loader_thread_priority =
+        base::ThreadPriority::BACKGROUND;
 
     // Specifies the priority tha the web module's animated image decoding
     // thread will be assigned. This thread is responsible for decoding,
     // blending and constructing individual frames from animated images. The
     // default value is base::ThreadPriority::BACKGROUND.
-    base::ThreadPriority animated_image_decode_thread_priority;
+    base::ThreadPriority animated_image_decode_thread_priority =
+        base::ThreadPriority::BACKGROUND;
 
     // To support 3D camera movements.
     scoped_refptr<input::Camera3D> camera_3d;
@@ -187,15 +192,15 @@
 
     // The video playback rate will be multiplied with the following value.  Its
     // default value is 1.0.
-    float video_playback_rate_multiplier;
+    float video_playback_rate_multiplier = 1.f;
 
     // Allows image animations to be enabled/disabled.  Its default value
     // is true to enable them.
-    bool enable_image_animations;
+    bool enable_image_animations = true;
 
     // Whether or not to retain the remote typeface cache when the app enters
     // the suspend state.
-    bool should_retain_remote_typeface_cache_on_suspend;
+    bool should_retain_remote_typeface_cache_on_suspend = false;
 
     // The language and script to use with fonts. If left empty, then the
     // language-script combination provided by base::GetSystemLanguageScript()
@@ -215,7 +220,7 @@
 
     // Whether or not the WebModule is allowed to fetch from cache via
     // h5vcc-cache://.
-    bool can_fetch_cache;
+    bool can_fetch_cache = false;
 
     // The dom::OnScreenKeyboard forwards calls to this interface.
     dom::OnScreenKeyboardBridge* on_screen_keyboard_bridge = NULL;
@@ -236,7 +241,7 @@
     // as a clear, i.e. with blending disabled.  This means that a background
     // color of transparent will replace existing pixel values, effectively
     // clearing the screen.
-    bool clear_window_with_background_color;
+    bool clear_window_with_background_color = true;
 
     // As a preventative measure against Spectre attacks, we explicitly limit
     // the resolution of the performance timer by default.  Setting this option
@@ -295,11 +300,11 @@
   void InjectOnScreenKeyboardFocusedEvent(int ticket);
   // Injects an on screen keyboard blurred event into the web module.
   void InjectOnScreenKeyboardBlurredEvent(int ticket);
-#if SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#if SB_API_VERSION >= 11
   // Injects an on screen keyboard suggestions updated event into the web
   // module.
   void InjectOnScreenKeyboardSuggestionsUpdatedEvent(int ticket);
-#endif  // SB_API_VERSION >= SB_ON_SCREEN_KEYBOARD_SUGGESTIONS_VERSION
+#endif  // SB_API_VERSION >= 11
 #endif  // SB_HAS(ON_SCREEN_KEYBOARD)
 
   // Injects a keyboard event into the web module. The value for type
diff --git a/src/cobalt/build/all.gyp b/src/cobalt/build/all.gyp
index f7b2df9..8909d7a 100644
--- a/src/cobalt/build/all.gyp
+++ b/src/cobalt/build/all.gyp
@@ -47,6 +47,7 @@
         '<(DEPTH)/cobalt/dom/testing/dom_testing.gyp:*',
         '<(DEPTH)/cobalt/dom_parser/dom_parser.gyp:*',
         '<(DEPTH)/cobalt/dom_parser/dom_parser_test.gyp:*',
+        '<(DEPTH)/cobalt/extension/extension.gyp:*',
         '<(DEPTH)/cobalt/h5vcc/h5vcc.gyp:*',
         '<(DEPTH)/cobalt/input/input.gyp:*',
         '<(DEPTH)/cobalt/layout/layout.gyp:*',
@@ -55,6 +56,7 @@
         '<(DEPTH)/cobalt/loader/loader.gyp:*',
         '<(DEPTH)/cobalt/loader/origin.gyp:*',
         '<(DEPTH)/cobalt/math/math.gyp:*',
+        '<(DEPTH)/cobalt/media/media.gyp:*',
         '<(DEPTH)/cobalt/media/sandbox/sandbox.gyp:*',
         '<(DEPTH)/cobalt/media_capture/media_capture.gyp:*',
         '<(DEPTH)/cobalt/media_capture/media_capture_test.gyp:*',
diff --git a/src/cobalt/build/build.id b/src/cobalt/build/build.id
index 7f319dc..04c18cb 100644
--- a/src/cobalt/build/build.id
+++ b/src/cobalt/build/build.id
@@ -1 +1 @@
-205881
\ No newline at end of file
+215766
\ No newline at end of file
diff --git a/src/cobalt/build/cobalt_archive.py b/src/cobalt/build/cobalt_archive.py
index 70dd863..9e50fec 100644
--- a/src/cobalt/build/cobalt_archive.py
+++ b/src/cobalt/build/cobalt_archive.py
@@ -15,6 +15,32 @@
 # limitations under the License.
 
 
+"""Tools for creating and extracting a Cobalt Archive."""
+
+import argparse
+import fnmatch
+import hashlib
+import json
+import logging
+import os
+import random
+import stat
+import sys
+import time
+import zipfile
+
+import _env  # pylint: disable=relative-import,unused-import
+from cobalt.build import cobalt_archive_extract
+import starboard.build.filelist as filelist
+import starboard.build.port_symlink as port_symlink
+from starboard.tools.app_launcher_packager import CopyAppLauncherTools
+from starboard.tools.build import GetPlatformConfig
+from starboard.tools.config import GetAll as GetAllConfigs
+import starboard.tools.paths as paths
+from starboard.tools.platform import GetAll as GetAllPlatforms
+from starboard.tools.util import SetupDefaultLoggingConfig
+
+
 ################################################################################
 #                                  API                                         #
 ################################################################################
@@ -25,24 +51,26 @@
                                   platform_name,
                                   platform_sdk_version,
                                   config,
-                                  additional_buildinfo_dict={}):
-  additional_buildinfo_dict = dict(additional_buildinfo_dict)
-  b = Bundler(archive_zip_path=output_archive_path)
-  b.MakeArchive(platform_name=platform_name,
-                platform_sdk_version=platform_sdk_version,
-                config=config,
-                file_list=input_file_list,
-                additional_buildinfo_dict=additional_buildinfo_dict)
+                                  additional_buildinfo_dict=None):
+  if additional_buildinfo_dict is None:
+    additional_buildinfo_dict = {}
+  archive = CobaltArchive(archive_zip_path=output_archive_path)
+  archive.MakeArchive(platform_name=platform_name,
+                      platform_sdk_version=platform_sdk_version,
+                      config=config,
+                      file_list=input_file_list,
+                      additional_buildinfo_dict=additional_buildinfo_dict)
 
 
 def MakeCobaltArchiveFromSource(output_archive_path,
                                 platform_name,
                                 config,
                                 platform_sdk_version,
-                                additional_buildinfo_dict={},
+                                additional_buildinfo_dict=None,
                                 include_black_box_tests=False):
-  """ Returns None, failure is signaled via exception. """
-  additional_buildinfo_dict = dict(additional_buildinfo_dict)
+  """Returns None, failure is signaled via exception."""
+  if additional_buildinfo_dict is None:
+    additional_buildinfo_dict = {}
   _MakeCobaltArchiveFromSource(
       output_archive_path=output_archive_path,
       platform_name=platform_name,
@@ -54,13 +82,14 @@
 
 def ExtractCobaltArchive(input_zip_path, output_directory_path, outstream=None):
   """Returns True if the extract operation was successfull."""
-  b = Bundler(archive_zip_path=input_zip_path)
-  return b.ExtractTo(output_dir=output_directory_path, outstream=outstream)
+  archive = CobaltArchive(archive_zip_path=input_zip_path)
+  return archive.ExtractTo(output_dir=output_directory_path,
+                           outstream=outstream)
 
 
 def ReadCobaltArchiveInfo(input_zip_path):
-  b = Bundler(archive_zip_path=input_zip_path)
-  return b.ReadMetaData()
+  archive = CobaltArchive(archive_zip_path=input_zip_path)
+  return archive.ReadMetaData()
 
 
 ################################################################################
@@ -68,40 +97,6 @@
 ################################################################################
 
 
-import argparse
-import hashlib
-import json
-import md5
-import os
-import random
-import shutil
-import subprocess
-import sys
-import tempfile
-import time
-import traceback
-import zipfile
-
-from sets import Set
-
-import _env
-
-from starboard.build.port_symlink \
-    import IsSymLink, IsWindows, MakeSymLink, ReadSymLink, Rmtree, OsWalk
-
-from starboard.tools.app_launcher_packager import CopyAppLauncherTools
-from starboard.tools.paths import BuildOutputDirectory, REPOSITORY_ROOT
-
-from starboard.build.filelist import \
-    FileList, GetFileType, TempFileSystem, \
-    TYPE_NONE, TYPE_SYMLINK_DIR, TYPE_DIRECTORY, TYPE_FILE
-
-from starboard.build.port_symlink import Rmtree
-from starboard.tools.build import GetPlatformConfig
-from starboard.tools.config import GetAll as GetAllConfigs
-from starboard.tools.platform import GetAll as GetAllPlatforms
-
-
 # Source resource paths.
 _SELF_DIR = os.path.abspath(os.path.dirname(__file__))
 _SRC_CONTENT_PATH = os.path.join(_SELF_DIR, 'cobalt_archive_content')
@@ -111,49 +106,43 @@
 # is normalized to '/'.
 _OUT_ARCHIVE_ROOT = '__cobalt_archive'
 _OUT_FINALIZE_DECOMPRESSION_PATH = '%s/%s' % (_OUT_ARCHIVE_ROOT,
-                                             'finalize_decompression')
+                                              'finalize_decompression')
 _OUT_METADATA_PATH = '%s/%s' % (_OUT_ARCHIVE_ROOT, 'metadata.json')
-_OUT_DECOMP_PY = '%s/%s' % (_OUT_FINALIZE_DECOMPRESSION_PATH,
-                           'decompress.py')
 _OUT_DECOMP_JSON = '%s/%s' % (_OUT_FINALIZE_DECOMPRESSION_PATH,
-                             'decompress.json')
+                              'decompress.json')
 
 
-class Bundler:
-  """Bundler is a utility for managing device bundles of codes. It is
-  used for creating the zip file and also unzipping."""
+class CobaltArchive(object):
+  """CobaltArchive is a utility generating archives."""
+
   def __init__(self, archive_zip_path):
     self.archive_zip_path = archive_zip_path
 
   def ExtractTo(self, output_dir, outstream=None):
     """Returns True if all files were extracted, False otherwise."""
-    outstream = outstream if outstream else sys.stdout
-    assert(os.path.exists(self.archive_zip_path))
-    print('UNZIPPING ' + self.archive_zip_path + ' -> ' + output_dir)
-    ok = _ExtractFiles(self.archive_zip_path, output_dir, outstream)
-    # Now that all files have been extracted, execute the final decompress
-    # step.
-    decomp_py = os.path.abspath(os.path.join(output_dir, _OUT_DECOMP_PY))
-    assert(os.path.isfile(decomp_py)), decomp_py
-    cmd_str = 'python ' + decomp_py
-    outstream.write('Executing: %s\n' % cmd_str)
-    rc = subprocess.call(cmd_str, shell=True, stdout=outstream,
-                         stderr=outstream)
-    ok &= rc is 0
-    return ok
+    return cobalt_archive_extract.ExtractTo(
+        self.archive_zip_path, output_dir, outstream)
 
   def ReadMetaData(self):
-    with zipfile.ZipFile(self.archive_zip_path, 'r', allowZip64=True) as zf:
-      json_str = zf.read(_OUT_METADATA_PATH)
+    json_str = self.ReadFile(_OUT_METADATA_PATH)
     return json.loads(json_str)
 
+  def ReadFile(self, file_path):
+    with zipfile.ZipFile(self.archive_zip_path, 'r', allowZip64=True) as zf:
+      return zf.read(file_path)
+
   def MakeArchive(self,
                   platform_name,
                   platform_sdk_version,
                   config,
                   file_list,  # class FileList
-                  additional_buildinfo_dict={}):
-    if not config in GetAllConfigs():
+                  additional_buildinfo_dict=None):
+    """Creates an archive for the given platform and config."""
+    logging.info('Making cobalt archive...')
+    is_windows = port_symlink.IsWindows()
+    if additional_buildinfo_dict is None:
+      additional_buildinfo_dict = {}
+    if config not in GetAllConfigs():
       raise ValueError('Expected %s to be one of %s'
                        % (config, GetAllConfigs()))
     additional_buildinfo_dict = dict(additional_buildinfo_dict)  # Copy
@@ -166,9 +155,9 @@
                          compression=zipfile.ZIP_DEFLATED,
                          allowZip64=True) as zf:
       # Copy the cobalt_archive_content directory into the root of the archive.
-      content_file_list = FileList()
+      content_file_list = filelist.FileList()
       content_file_list.AddAllFilesInPath(root_dir=_SRC_CONTENT_PATH,
-                                          sub_dir=_SRC_CONTENT_PATH)
+                                          sub_path=_SRC_CONTENT_PATH)
       for file_path, archive_path in content_file_list.file_list:
         # Skip the fake metadata.json file because the real one
         # is a generated in it's place.
@@ -178,14 +167,35 @@
       # Write out the metadata.
       zf.writestr(_OUT_METADATA_PATH, build_info_str)
       if file_list.file_list:
-        print('  Compressing ' + str(len(file_list.file_list)) + ' files')
-      for file_path, archive_path in file_list.file_list:
-        # TODO: Use and implement _FoldIdenticalFiles() to reduce duplicate
-        # files. This will help platforms like nxswitch which include a lot
-        # of duplicate files for the sdk.
-        zf.write(file_path, arcname=archive_path)
+        logging.info('  Compressing %d files', len(file_list.file_list))
+
+      executable_files = []
+      n_file_list = len(file_list.file_list)
+      progress_set = set()
+      for i in range(n_file_list):
+        # Logging every 5% increment during compression step.
+        prog = int((float(i)/n_file_list) * 100)
+        if prog not in progress_set:
+          progress_set.add(prog)
+          logging.info('  Compressed %d%%...', prog)
+        file_path, archive_path = file_list.file_list[i]
+        if not is_windows:
+          perms = _GetFilePermissions(file_path)
+          if (stat.S_IXUSR) & perms:
+            executable_files.append(archive_path)
+        # TODO(niteris): Use and implement _FoldIdenticalFiles() to reduce
+        # duplicate files. This will help platforms like nxswitch which include
+        # a lot of duplicate files for the sdk.
+        try:
+          zf.write(file_path, arcname=archive_path)
+        except WindowsError:  # pylint: disable=undefined-variable
+          # Happens for long file path names.
+          zf.write(cobalt_archive_extract.ToWinUncPath(file_path),
+                   arcname=archive_path)
+
       if file_list.symlink_dir_list:
-        print('  Compressing ' + str(len(file_list.symlink_dir_list)) + ' symlinks')
+        logging.info('  Compressing %d symlinks',
+                     len(file_list.symlink_dir_list))
       # Generate the decompress.json file used by decompress.py.
       # Removes the first element which is the root directory, which is not
       # important for symlink creation.
@@ -193,10 +203,12 @@
       # Replace '\\' with '/'
       symlink_dir_list = [_ToUnixPaths(l) for l in symlink_dir_list]
       decompress_json_str = _JsonDumpPrettyPrint({
-        'symlink_dir': symlink_dir_list,
-        'symlink_dir_doc': '[link_dir_path, target_dir_path]'
+          'symlink_dir': symlink_dir_list,
+          'symlink_dir_doc': '[link_dir_path, target_dir_path]',
+          'executable_files': executable_files,
       })
       zf.writestr(_OUT_DECOMP_JSON, decompress_json_str)
+      logging.info('Done...')
 
 
 def _ToUnixPaths(path_list):
@@ -206,55 +218,72 @@
   return out
 
 
+def _GetFilePermissions(path):
+  return stat.S_IMODE(os.stat(path).st_mode)
+
+
 def _JsonDumpPrettyPrint(data):
   return json.dumps(data, sort_keys=True, indent=4, separators=(',', ': '))
 
 
-def _CheckChildPathIsUnderParentPath(child_path, parent_path):
-  parent_path = os.path.join(
-      os.path.realpath(parent_path), '')
-  f = os.path.realpath(child_path)
-  common_prefix = os.path.commonprefix([child_path, parent_path])
-  if common_prefix != parent_path:
-    raise ValueError('Bundle files MUST be located under ' + \
-                       parent_path + ', BadFile = ' + f)
-
-
 def _MakeDirs(path):
   if not os.path.isdir(path):
     os.makedirs(path)
 
 
-def _FindPossibleDeployDirs(build_root):
+def _FindPossibleDeployPaths(build_root):
+  """Searches for folders that are likely required for archiving."""
   out = []
-  root_dirs = os.listdir(build_root)
-  for d in root_dirs:
-    if d in ('gen', 'gypfiles', 'obj', 'obj.host'):
+  # Ultimately, this function should not be needed as each platform should
+  # implement GetDeployPathPatterns(). This is stop-gap for platforms that do
+  # not have GetDeployPathPatterns() implemented yet.
+  root_paths = os.listdir(build_root)
+  for p in root_paths:
+    if p in ('gen', 'gypfiles', 'gyp-win-tool', 'obj', 'obj.host'):
       continue
-    d = os.path.join(build_root, d)
-    if os.path.isfile(d):
+    if p.endswith('.pdb'):
+      continue  # Skip pdb files for size (only applies to Windows).
+    p = os.path.join(build_root, p)
+    if os.path.isfile(p):
+      out.append(p)
       continue
-    if IsSymLink(d):
+    if port_symlink.IsSymLink(p):
       continue
-    out.append(os.path.normpath(d))
+    out.append(os.path.normpath(p))
   return out
 
 
-def _GetDeployDirs(platform_name, config):
+def _PathMatchesPatterns(file_path, patterns):
+  for p in patterns:
+    if fnmatch.fnmatch(file_path, p):
+      logging.debug('pattern %s matched %s', p, file_path)
+      return True
+  logging.debug('Skipping %s', file_path)
+  return False
+
+
+def _GetDeployPaths(platform_name, config):
+  """Returns a list of paths that should be included in the archive."""
   try:
     gyp_config = GetPlatformConfig(platform_name)
-    return gyp_config.GetDeployDirs()
-  except NotImplementedError:
-    # TODO: Investigate why Logging.info(...) eats messages even when
-    # the logging module is set to logging level INFO or DEBUG and when
-    # this is fixed then replace the print functions in this file with logging.
-    print('\n********************************************************\n'
-          '%s: specific deploy directories not found, auto \n'
-          'including possible deploy directories from build root.'
-          '\n********************************************************\n'
-          % __file__)
-    build_root = BuildOutputDirectory(platform_name, config)
-    return _FindPossibleDeployDirs(build_root)
+    patterns = gyp_config.GetDeployPathPatterns()
+    logging.info('Found platform include patterns: [%s]', ', '.join(patterns))
+    out_directory = paths.BuildOutputDirectory(platform_name, config)
+    out_paths = []
+    for root, _, files in port_symlink.OsWalk(out_directory):
+      for f in files:
+        full_path = os.path.join(root, f)
+        file_path = os.path.relpath(full_path, out_directory)
+        if _PathMatchesPatterns(file_path, patterns):
+          out_paths.append(file_path)
+    return out_paths
+  except NotImplementedError:  # Abstract class throws NotImplementedError.
+    logging.warning('** AUTO INCLUDE: ** Specific deploy paths were not found '
+                    'so including known possible deploy paths from the '
+                    'platform out directory.')
+    build_root = paths.BuildOutputDirectory(platform_name, config)
+    deploy_paths = _FindPossibleDeployPaths(build_root)
+    return deploy_paths
 
 
 def _MakeCobaltArchiveFromSource(output_archive_path,
@@ -263,37 +292,39 @@
                                  platform_sdk_version,
                                  additional_buildinfo_dict,
                                  include_black_box_tests):
+  """Finds necessary files and makes an archive."""
   _MakeDirs(os.path.dirname(output_archive_path))
-  out_directory = BuildOutputDirectory(platform_name, config)
+  out_directory = paths.BuildOutputDirectory(platform_name, config)
   root_dir = os.path.abspath(os.path.join(out_directory, '..', '..'))
-  flist = FileList()
-  inc_dirs = _GetDeployDirs(platform_name, config)
-  print 'Adding binary files to bundle...'
-  for path in inc_dirs:
+  flist = filelist.FileList()
+  inc_paths = _GetDeployPaths(platform_name, config)
+  logging.info('Adding binary files to bundle...')
+  for path in inc_paths:
     path = os.path.join(out_directory, path)
     if not os.path.exists(path):
-      print 'Skipping deploy directory', path, 'because it does not exist.'
+      logging.info('Skipping deploy path %s because it does not exist.',
+                   path)
       continue
-    print '  adding ' + os.path.abspath(path)
-    flist.AddAllFilesInPath(root_dir=root_dir, sub_dir=path)
-  print '...done'
+    logging.info('  adding %s', os.path.abspath(path))
+    flist.AddAllFilesInPath(root_dir=root_dir, sub_path=path)
+  logging.info('...done')
   launcher_tools_path = os.path.join(
       os.path.dirname(output_archive_path),
       '____app_launcher')
   if os.path.exists(launcher_tools_path):
-    Rmtree(launcher_tools_path)
-  print ('Adding app_launcher_files to bundle in ' +
-         os.path.abspath(launcher_tools_path))
+    port_symlink.Rmtree(launcher_tools_path)
+  logging.info('Adding app_launcher_files to bundle in %s',
+               os.path.abspath(launcher_tools_path))
 
   try:
-    CopyAppLauncherTools(repo_root=REPOSITORY_ROOT,
+    CopyAppLauncherTools(repo_root=paths.REPOSITORY_ROOT,
                          dest_root=launcher_tools_path,
                          additional_glob_patterns=[],
                          include_black_box_tests=include_black_box_tests)
     flist.AddAllFilesInPath(root_dir=launcher_tools_path,
-                            sub_dir=launcher_tools_path)
-    print '...done'
-    print 'Making cobalt archive...'
+                            sub_path=launcher_tools_path)
+    logging.info('...done')
+
     MakeCobaltArchiveFromFileList(
         output_archive_path,
         input_file_list=flist,
@@ -301,23 +332,31 @@
         platform_sdk_version=platform_sdk_version,
         config=config,
         additional_buildinfo_dict=additional_buildinfo_dict)
-    print '...done'
+    logging.info('...done')
   finally:
-    Rmtree(launcher_tools_path)
+    port_symlink.Rmtree(launcher_tools_path)
 
 
-# TODO: Implement into bundler. This is unit tested at this time.
-# Returns files_list, copy_list, where file_list is a list of physical
-# files, and copy_list contains a 2-tuple of [physical_file, copy_location]
-# that describes which files should be copied.
-# Example:
-#  files, copy_list = _FoldIdenticalFiles(['in0/test.txt', 'in1/test.txt'])
-#  Output:
-#    files => ['in0/test.txt']
-#    copy_list => ['in0/test.txt', 'in1/test.txt']
 def _FoldIdenticalFiles(file_path_list):
+  """Takes input files and determines which are md5 identical and folds them.
+
+  TODO: Implement into Cobalt Archive.
+
+  Example:
+    files, copy_list = _FoldIdenticalFiles(['in0/test.txt', 'in1/test.txt'])
+    Output:
+      files => ['in0/test.txt']
+      copy_list => ['in0/test.txt', 'in1/test.txt']
+
+  Args:
+    file_path_list: A list of files that will be processed.
+
+  Returns:
+    A 2-tuple (files, copy_list) where files is a list of physical files and
+    copy_list is the list of files that are identical.
+  """
   # Remove duplicates.
-  file_path_list = list(Set(file_path_list))
+  file_path_list = list(set(file_path_list))
   file_path_list.sort()
   def Md5File(fpath):
     hash_md5 = hashlib.md5()
@@ -337,17 +376,17 @@
     files = file_map.get(entry, [])
     files.append(file_path)
     file_map[entry] = files
-  for (fname, fsize), path_list in file_map.iteritems():
-    assert(len(path_list))
+  for (fname, fsize), path_list in file_map.iteritems():  # pylint: disable=unused-variable
+    assert path_list
     phy_file_list.append(path_list[0])
     if len(path_list) == 1:
       continue
     else:
-      md5_dict = { Md5File(path_list[0]): path_list[0]  }
+      md5_dict = {Md5File(path_list[0]): path_list[0]}
       for tail_file in path_list[1:]:
         new_md5 = Md5File(tail_file)
         matching_file = md5_dict.get(new_md5, None)
-        if matching_file != None:
+        if matching_file is not None:
           # Match found.
           copy_list.append((matching_file, tail_file))
         else:
@@ -358,143 +397,20 @@
 
 def _GenerateBuildInfoStr(platform_name, platform_sdk_version,
                           config, additional_buildinfo_dict):
-  from time import gmtime, strftime
+  """Generates a build info string (for the metadata file)."""
   build_info = dict(additional_buildinfo_dict)  # Copy dict.
-  build_info['archive_time_RFC_2822'] = \
-      strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
+  build_info['archive_time_RFC_2822'] = (
+      time.strftime('%a, %d %b %Y %H:%M:%S +0000', time.gmtime()))
   build_info['archive_time_local'] = time.asctime()
   build_info['platform'] = platform_name
   build_info['config'] = config
   build_info['sdk_version'] = platform_sdk_version
   # Can be used by clients for caching reasons.
-  build_info['random_uint64'] = random.randint(0, 0xffffffffffffffff)
+  build_info['nonce'] = random.randint(0, 0xffffffffffffffff)
   build_info_str = _JsonDumpPrettyPrint(build_info)
   return build_info_str
 
 
-def _AddFilesAndSymlinksToZip(open_zipfile, archive_file_list):
-  sym_links = []
-  for path, archive_name in archive_file_list:
-    if IsSymLink(path):
-      sym_links.append([path, archive_name])
-    else:
-      open_zipfile.write(path, arcname=archive_name)
-  for path, archive_name in sym_links:
-    zinfo = zipfile.ZipInfo(path)
-    link_path = ReadSymLink(path)
-    zinfo.filename = rel_path
-    zinfo.comment = json.dumps({'symlink': link_path})
-    open_zipfile.writestr(zinfo, rel_path, compress_type=zipfile.ZIP_DEFLATED)
-
-
-# Returns True if all files were extracted, else False.
-def _ExtractFiles(input_zip_path, output_dir, outstream):
-  all_ok = True
-  with zipfile.ZipFile(input_zip_path, 'r', allowZip64=True) as zf:
-    for zinfo in zf.infolist():
-      try:
-        zf.extract(zinfo, path=output_dir)
-      except Exception as err:
-        msg = 'Exception happend during bundle extraction: ' + str(err) + '\n'
-        outstream.write(msg)
-        all_ok = False
-  return all_ok
-
-
-################################################################################
-#                              UNIT TEST                                       #
-################################################################################
-
-
-def _UnitTestBundler_ExtractTo():
-  flist = FileList()
-  tf = TempFileSystem()
-  tf.Clear()
-  tf.Make()
-  flist.AddSymLink(tf.root_in_tmp, tf.sym_dir)
-  bundle_zip = os.path.join(tf.root_tmp, 'bundle.zip')
-  b = Bundler(bundle_zip)
-  b.MakeArchive(platform_name='fake',
-                platform_sdk_version='fake_sdk',
-                config='devel',
-                file_list=flist)
-  out_dir = os.path.join(tf.root_tmp, 'out')
-  b.ExtractTo(out_dir)
-  out_from_dir = os.path.join(out_dir, 'from_dir')
-  out_from_dir_lnk = os.path.join(out_dir, 'from_dir_lnk')
-  assert(GetFileType(out_from_dir) == TYPE_DIRECTORY)
-  assert(GetFileType(out_from_dir_lnk) == TYPE_SYMLINK_DIR)
-  resolved_from_link_path = os.path.join(out_dir, ReadSymLink(out_from_dir_lnk))
-  assert(os.path.abspath(out_from_dir) ==
-         os.path.abspath(resolved_from_link_path))
-
-
-def _UnitTestBundler_MakesDeployInfo():
-  flist = FileList()
-  tf = TempFileSystem()
-  tf.Clear()
-  tf.Make()
-  bundle_zip = os.path.join(tf.root_tmp, 'bundle.zip')
-  b = Bundler(bundle_zip)
-  b.MakeArchive(platform_name='fake',
-                platform_sdk_version='fake_sdk',
-                config='devel',
-                file_list=flist)
-  out_dir = os.path.join(tf.root_tmp, 'out')
-  b.ExtractTo(out_dir)
-  out_metadata_file = os.path.join(out_dir, _OUT_METADATA_PATH)
-  assert(GetFileType(out_metadata_file) == TYPE_FILE)
-  with open(out_metadata_file) as fd:
-    text = fd.read()
-    js = json.loads(text)
-    assert(js)
-    assert(js['sdk_version'] == 'fake_sdk')
-    assert(js['platform'] == 'fake')
-    assert(js['config'] == 'devel')
-
-
-def _UnitTest_FoldIdenticalFiles():
-  tf_root = TempFileSystem('bundler_fold')
-  tf_root.Clear()
-  tf1 = TempFileSystem(os.path.join('bundler_fold', '1'))
-  tf2 = TempFileSystem(os.path.join('bundler_fold', '2'))
-  tf1.Make()
-  tf2.Make()
-  flist = FileList()
-  subdirs = [tf1.root_in_tmp, tf2.root_in_tmp]
-  flist.AddAllFilesInPaths(tf_root.root_tmp, subdirs)
-  flist.Print()
-  identical_files = [tf1.test_txt, tf2.test_txt]
-  physical_files, copy_files = _FoldIdenticalFiles(identical_files)
-  assert(tf1.test_txt == physical_files[0])
-  assert(tf1.test_txt in copy_files[0][0])
-  assert(tf2.test_txt in copy_files[0][1])
-
-
-def _UnitTest():
-  tests = [
-    ['UnitTestBundler_ExtractTo', _UnitTestBundler_ExtractTo],
-    ['UnitTestBundler_MakesDeployInfo', _UnitTestBundler_MakesDeployInfo],
-    ['UnitTest_FoldIdenticalFiles', _UnitTest_FoldIdenticalFiles],
-  ]
-  failed_tests = []
-  for name, test in tests:
-    try:
-      print('\n' + name + ' started.')
-      test()
-      print(name + ' passed.')
-    except Exception as err:
-      failed_tests.append(name)
-      traceback.print_exc()
-      print('Error happened during test ' + name)
-
-  if failed_tests:
-    print '\n\nThe following tests failed: ' + ','.join(failed_tests)
-    return 1
-  else:
-    return 0
-
-
 ################################################################################
 #                                CMD LINE                                      #
 ################################################################################
@@ -502,9 +418,10 @@
 
 def _MakeCobaltPlatformArchive(platform, config, output_zip,
                                include_black_box_tests):
+  """Makes a Cobalt Archive, prompting for missing platform/config."""
   if not platform:
     platform = raw_input('platform: ')
-  if not platform in GetAllPlatforms():
+  if platform not in GetAllPlatforms():
     raise ValueError('Platform "%s" not recognized, expected one of: \n%s'
                      % (platform, GetAllPlatforms()))
   if not config:
@@ -519,12 +436,13 @@
       platform,
       config,
       platform_sdk_version='TEST',
-      additional_buildinfo_dict={},
+      additional_buildinfo_dict=None,
       include_black_box_tests=include_black_box_tests)
   time_delta = time.time() - start_time
   if not os.path.isfile(output_zip):
     raise ValueError('Expected zip file at ' + output_zip)
-  print '\nGenerated: %s in %d seconds' % (output_zip, int(time_delta))
+  logging.info('\nGenerated: %s in %d seconds', output_zip, int(time_delta))
+
 
 # Returns True/False
 def _DecompressArchive(in_zip, out_path):
@@ -536,31 +454,27 @@
                               output_directory_path=out_path)
 
 
-def _main():
-  # Create a private parser that will print the full help whenever the command
-  # line fails to fully parse.
+def _CreateArgumentParser():
+  """Creates a parser that will print the full help on failure to parse."""
+
   class MyParser(argparse.ArgumentParser):
+
     def error(self, message):
       sys.stderr.write('error: %s\n' % message)
       self.print_help()
       sys.exit(2)
   help_msg = (
-    'Example 1:\n'
-    '  python cobalt_archive.py --create --platform nxswitch'
-    ' --config devel --out_path <OUT_ZIP>\n\n'
-    'Example 2:\n'
-    '  python cobalt_archive.py --extract --in_path <ARCHIVE_PATH.ZIP>'
-    ' --out_path <OUT_DIR>')
+      'Example 1:\n'
+      '  python cobalt_archive.py --create --platform nxswitch'
+      ' --config devel --out_path <OUT_ZIP>\n\n'
+      'Example 2:\n'
+      '  python cobalt_archive.py --extract --in_path <ARCHIVE_PATH.ZIP>'
+      ' --out_path <OUT_DIR>')
   # Enables new lines in the description and epilog.
   formatter_class = argparse.RawDescriptionHelpFormatter
   parser = MyParser(epilog=help_msg, formatter_class=formatter_class)
   group = parser.add_mutually_exclusive_group(required=True)
   group.add_argument(
-      '-u',
-      '--unit_test',
-      help='Run cobalt archive UnitTest',
-      action='store_true')
-  group.add_argument(
       '-c',
       '--create',
       help='Creates an archive from source directory, optional arguments'
@@ -588,10 +502,16 @@
   parser.add_argument('--include_black_box_tests',
                       help='Optional, used for --create to add blackbox tests',
                       action='store_true')
-  args = parser.parse_args()
-  if args.unit_test:
-    sys.exit(_UnitTest())
-  elif args.create:
+  return parser
+
+
+def main():
+  SetupDefaultLoggingConfig()
+  parser = _CreateArgumentParser()
+  args, unknown_args = parser.parse_known_args()
+  if unknown_args:
+    logging.warning('Unknown (ignored) args: %s', unknown_args)
+  if args.create:
     _MakeCobaltPlatformArchive(
         platform=args.platform,
         config=args.config,
@@ -607,4 +527,4 @@
 
 
 if __name__ == '__main__':
-  _main()
+  main()
diff --git a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/finalize_decompression/decompress.py b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/finalize_decompression/decompress.py
index 05254a5..8224154 100644
--- a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/finalize_decompression/decompress.py
+++ b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/finalize_decompression/decompress.py
@@ -15,8 +15,13 @@
 # limitations under the License.
 
 
-"""This file is designed to be placed in the cobalt archive to finalize the
-decompression process."""
+"""Finalizes decompression.
+
+This is meant to be run after the zip is decompressed into the temp directory
+and includes support for special file system operations not supported by the
+zip file.
+"""
+
 
 import json
 import logging
@@ -28,26 +33,40 @@
 _SELF_DIR = os.path.dirname(__file__)
 _ARCHIVE_ROOT = os.path.join(_SELF_DIR, os.pardir, os.pardir)
 _DATA_JSON_PATH = os.path.abspath(os.path.join(_SELF_DIR, 'decompress.json'))
+_FULL_PERMISSIONS = 0o777
 
 
-def _DefineOsSymlinkForWin32():
-  """When invoked, this will define the missing os.symlink for Win32."""
-  def _CreateWin32Symlink(source, link_name):
-    cmd = 'mklink /J %s %s' % (link_name, source)
+_IS_WINDOWS = sys.platform in ['win32', 'cygwin']
+
+
+def _CreateWin32Symlink(source, link_name):
+  rc = subprocess.call('mklink /D %s %s' % (link_name, source), shell=True)
+  if rc != 0:
+    # Some older versions of windows require admin permissions for /D style
+    # reparse points. In this case fallback to using /J.
+    cmd = 'mklink /J %s %s' % (link_name, source),
     rc = subprocess.call(cmd, shell=True)
     if rc != 0:
-      logging.critical('Error using %s during %s, cwd=%s' % (rc,cmd,os.getcwd()))
-  os.symlink = _CreateWin32Symlink
+      logging.critical('Error using %s during %s, cwd=%s', rc, cmd, os.getcwd())
 
 
-if sys.platform == 'win32':
-  _DefineOsSymlinkForWin32()
+def _CreateSymlink(source, link_name):
+  if _IS_WINDOWS:
+    _CreateWin32Symlink(source, link_name)
+  else:
+    os.symlink(source, link_name)
+
+
+def _MakeDirs(path):
+  if _IS_WINDOWS:
+    # Necessary for long file name support
+    subprocess.check_call('mkdir %s' % path, shell=True)
+  else:
+    os.makedirs(path)
 
 
 def _ExtractSymlinks(cwd, symlink_dir_list):
-  if not symlink_dir_list:
-    logging.info('No directory symlinks found.')
-    return
+  """Recreates symlinks on Windows and linux."""
   prev_cwd = os.getcwd()
   cwd = os.path.normpath(cwd)
   all_ok = True
@@ -57,19 +76,19 @@
       link_path = os.path.abspath(link_path)
       real_path = os.path.abspath(real_path)
       if not os.path.exists(real_path):
-        os.makedirs(real_path)
+        _MakeDirs(real_path)
       if not os.path.exists(os.path.dirname(link_path)):
-        os.makedirs(os.path.dirname(link_path))
-      assert(os.path.exists(real_path))
+        _MakeDirs(os.path.dirname(link_path))
+      assert os.path.exists(real_path)
       real_path = os.path.relpath(real_path)
-      os.symlink(real_path, link_path)
+      _CreateSymlink(real_path, link_path)
       if not os.path.exists(real_path):
-        logging.critical('Error target folder %s does not exist.'
-                         % os.path.abspath(real_path))
+        logging.critical('Error target folder %s does not exist.',
+                         os.path.abspath(real_path))
         all_ok = False
       if not os.path.exists(link_path):
-        logging.critical('Error link folder %s does not exist.'
-                         % os.path.abspath(link_path))
+        logging.critical('Error link folder %s does not exist.',
+                         os.path.abspath(link_path))
         all_ok = False
   finally:
     os.chdir(prev_cwd)
@@ -79,7 +98,18 @@
                      '\n*******************************************')
 
 
-def _main():
+def _SetExecutionBits(cwd, executable_files):
+  if not executable_files:
+    return
+  logging.info('Setting Permissions %s on %d files',
+               _FULL_PERMISSIONS, len(executable_files))
+  for f in executable_files:
+    full_path = os.path.abspath(os.path.join(cwd, f))
+    logging.info('  %s', full_path)
+    os.chmod(full_path, _FULL_PERMISSIONS)
+
+
+def main():
   logging.basicConfig(level=logging.INFO,
                       format='%(filename)s(%(lineno)s): %(message)s')
   assert(os.path.exists(_DATA_JSON_PATH)), _DATA_JSON_PATH
@@ -87,7 +117,8 @@
     json_str = fd.read()
   data = json.loads(json_str)
   _ExtractSymlinks(_ARCHIVE_ROOT, data.get('symlink_dir', []))
+  _SetExecutionBits(_ARCHIVE_ROOT, data.get('executable_files', []))
 
 
 if __name__ == '__main__':
-  _main()
+  main()
diff --git a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/__init__.py b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/__init__.py
new file mode 100644
index 0000000..dbab2d5
--- /dev/null
+++ b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/__init__.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+#
+# Copyright 2019 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
diff --git a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/run_test.py b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/run_test.py
new file mode 100644
index 0000000..b1a300d
--- /dev/null
+++ b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/run_test.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python
+#
+# Copyright 2019 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+"""Unit tests the run.py trampoline."""
+
+import os
+import sys
+import unittest
+
+sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
+import run  # pylint: disable=relative-import,g-bad-import-order,g-import-not-at-top
+
+
+class RunGeneralTrampolineTest(unittest.TestCase):
+  """Tests trampoline substitutions for run_cobalt.py."""
+
+  def setUp(self):
+    """Change the trampoline internals for testing purposes."""
+    super(RunGeneralTrampolineTest, self).setUp()
+    run.trampoline.PLATFORM = 'MY_PLATFORM'
+    run.trampoline.CONFIG = 'MY_CONFIG'
+
+  def testOneTarget(self):
+    """Tests that one target gets resolved."""
+    expected_output = (
+        'python starboard/tools/example/app_launcher_client.py'
+        ' --platform MY_PLATFORM --config MY_CONFIG'
+        ' --target_name cobalt')
+    cmd_str = run._ResolveTrampoline(argv=['cobalt'])
+    self.assertEqual(expected_output, cmd_str)
+
+  def testTwoTargets(self):
+    """Tests that two targets gets resolved."""
+    expected_output = (
+        'python starboard/tools/example/app_launcher_client.py'
+        ' --platform MY_PLATFORM --config MY_CONFIG'
+        ' --target_name cobalt --target_name nplb')
+    cmd_str = run._ResolveTrampoline(argv=['cobalt', 'nplb'])
+    self.assertEqual(expected_output, cmd_str)
+
+  def testTargetParams(self):
+    """Tests that the the target_params gets correctly resolved."""
+    expected_output = (
+        'python starboard/tools/example/app_launcher_client.py'
+        ' --platform MY_PLATFORM --config MY_CONFIG'
+        ' --target_params="--url=http://my.server.test"')
+    argv = ['--target_params', '"--url=http://my.server.test"']
+    cmd_str = run._ResolveTrampoline(argv=argv)
+    self.assertEqual(expected_output, cmd_str)
+
+
+if __name__ == '__main__':
+  unittest.main(verbosity=2)
diff --git a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/run_tests_test.py b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/run_tests_test.py
new file mode 100644
index 0000000..cffc18d
--- /dev/null
+++ b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/run_tests_test.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+#
+# Copyright 2019 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+"""Unit tests the run.py trampoline."""
+
+import os
+import sys
+import unittest
+
+sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
+import run_tests  # pylint: disable=relative-import,g-bad-import-order,g-import-not-at-top
+
+
+class RunUnitTestsTrampolineTest(unittest.TestCase):
+  """Tests trampoline substitutions for run_unit_tests.py."""
+
+  def setUp(self):
+    """Change the trampoline internals for testing purposes."""
+    super(RunUnitTestsTrampolineTest, self).setUp()
+    run_tests.trampoline.PLATFORM = 'MY_PLATFORM'
+    run_tests.trampoline.CONFIG = 'MY_CONFIG'
+
+  def testOne(self):
+    """Tests that --target_name resolves to the expected value."""
+    expected_output = (
+        'python starboard/tools/testing/test_runner.py'
+        ' --target_name nplb --platform MY_PLATFORM --config MY_CONFIG')
+    cmd_str = run_tests._ResolveTrampoline(argv=['--target_name', 'nplb'])
+    self.assertEqual(expected_output, cmd_str)
+
+  def testTwo(self):
+    """Tests that --target_name used twice resolves to the expected value."""
+    expected_output = (
+        'python starboard/tools/testing/test_runner.py'
+        ' --platform MY_PLATFORM --config MY_CONFIG'
+        ' --target_name nplb --target_name nb_test')
+    argv=['nplb', 'nb_test']
+    cmd_str = run_tests._ResolveTrampoline(argv=argv)
+    self.assertEqual(expected_output, cmd_str)
+
+
+if __name__ == '__main__':
+  unittest.main(verbosity=2)
diff --git a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/trampoline.py b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/trampoline.py
new file mode 100644
index 0000000..059c1e3
--- /dev/null
+++ b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/trampoline.py
@@ -0,0 +1,165 @@
+#!/usr/bin/env python
+#
+# Copyright 2019 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+"""Trampoline resolves a trampoline to a command string."""
+
+
+import argparse
+import json
+import os
+import subprocess
+import sys
+
+
+################################################################################
+#                                  API                                         #
+################################################################################
+
+
+def RunTrampolineThenExit(trampoline, argv=None):
+  cmd_str = ResolveTrampoline(trampoline, argv)
+  sys.exit(_ShellCmd(cmd_str))
+
+
+def ResolveTrampoline(trampoline, argv=None):
+  r"""Resolves the trampoline list and returns a fully resolve strings.
+
+  The result of this function call is to return the cmd string with
+  the platform, config, device_id resolved to values.
+    Example input:
+      ['python starboard/tools/example/app_launcher_client.py -t cobalt',
+       '{platform_arg}', '{config_arg}', '{device_id_arg}']
+    Example Output:
+      'python starboard/tools/example/app_launcher_client.py -t cobalt ' + \
+      '--platform linux --config devel --device_id IP_ADDRESS'
+
+  Args:
+    trampoline: a list of commands mixed in with unresolved symobls.
+    argv: a list of known resolves symbols to use in the trampoline.
+
+  Returns:
+    A string representing the resolved shell command.
+  """
+  return _ResolveTrampoline(trampoline, argv)
+
+
+def RunThenExit(cmd_str, cwd=None):
+  if cwd == None:
+    cwd = _FindCwd()
+  sys.exit(_ShellCmd(cmd_str, cwd=cwd))
+
+
+################################################################################
+#                                 IMPL                                         #
+################################################################################
+
+
+_SELF_DIR = os.path.dirname(__file__)
+_META_FILE = os.path.normpath(
+    os.path.join(_SELF_DIR, '..', '..', 'metadata.json'))
+with open(_META_FILE) as fd:
+  data = fd.read()
+  _META_DATA = json.loads(data)
+
+
+# Tests can modify these values and alter the output of the trampoline
+# resolver.
+PLATFORM = _META_DATA['platform']
+CONFIG = _META_DATA['config']
+IS_TEST = _META_DATA.get('comment', None) == 'TEST'
+
+
+def _FindCwd():
+  """Gets the current working directory.
+
+  This is detected by whether the metadata.json is real (meaning we are in a
+  cobalt archive) or in the source directory.
+
+  Returns:
+    current working directory for execution.
+  """
+  if IS_TEST:
+    p = os.path.join(_SELF_DIR, '..', '..', '..', '..', '..', '..')
+  else:
+    p = os.path.join(_SELF_DIR, '..', '..', '..')
+  return os.path.normpath(p)
+
+
+def _ShellCmd(cmd_str, cwd):
+  sys.stdout.write('in:      %s\n' % os.path.abspath(cwd))
+  sys.stdout.write('Calling: %s\n\n' % cmd_str)
+  return subprocess.call(cmd_str, cwd=cwd, shell=True,
+                         universal_newlines=True)
+
+
+def _UnQuote(s):
+  if len(s) < 2:
+    return s
+  elif s[0] == '"' and s[-1] == '"':
+    return s[1:-1]
+  else:
+    return s
+
+
+def _ResolveTrampoline(trampoline, argv):
+  """Implemention, see ResolveTrampoline() above."""
+  if argv is None:
+    argv = sys.argv[2:]
+  known_args, unknown_args = _ParseArgs(argv)
+  placeholders = {
+      'platform_arg': '--platform %s' % PLATFORM,
+      'config_arg': '--config %s' % CONFIG
+  }
+  placeholders['device_id_arg'] = (
+      '' if not known_args.device_id
+      else '--device_id %s' % known_args.device_id)
+  placeholders['target_params_arg'] = (
+      '' if not known_args.target_params else
+      '--target_params="%s"' % _UnQuote(known_args.target_params))
+  if not known_args.target_name:
+    placeholders['target_names_arg'] = ''
+  else:
+    targets = ['--target_name ' + name for name in known_args.target_name]
+    placeholders['target_names_arg'] = ' '.join(targets)
+  trampoline = [part.format(**placeholders) for part in trampoline]
+  trampoline = [t for t in trampoline if t.strip()]
+  return ' '.join(trampoline), unknown_args
+
+
+def _ParseArgs(argv):
+  """Parses arguments."""
+
+  class MyParser(argparse.ArgumentParser):
+
+    def error(self, message):
+      sys.stderr.write('error: %s\n' % message)
+      self.print_help()
+
+  formatter_class = argparse.RawDescriptionHelpFormatter
+  parser = MyParser(formatter_class=formatter_class)
+  parser.add_argument('--device_id', type=str,
+                      help=('Choices are a device_id (usually an IP) '
+                            'passed to the launcher.'),
+                      default=None)
+  parser.add_argument('--target_params', type=str,
+                      help='Key=Value list of args to pass to the client.',
+                      default=None)
+  parser.add_argument('-t', '--target_name', action='append',
+                      help=('Name of executable target. Repeatable for '
+                            'multiple targets.'))
+  args = parser.parse_known_args(argv)
+  return args
diff --git a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/trampoline_test.py b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/trampoline_test.py
new file mode 100644
index 0000000..cc34e91
--- /dev/null
+++ b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/impl/trampoline_test.py
@@ -0,0 +1,75 @@
+#!/usr/bin/env python
+#
+# Copyright 2019 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import unittest
+
+import trampoline  # pylint: disable=relative-import,g-bad-import-order,g-import-not-at-top
+
+
+class TrampolineTest(unittest.TestCase):
+  """Tests trampoline substitutions."""
+
+  def setUp(self):
+    super(TrampolineTest, self).setUp()
+    # Change the trampoline internals for testing purposes.
+    trampoline.PLATFORM = 'MY_PLATFORM'
+    trampoline.CONFIG ='MY_CONFIG'
+
+  def testResolvePlatformConfig(self):
+    """Tests that a device_id resolves to the expected value."""
+    tramp = [
+        'python dummy.py', '{platform_arg}', '{config_arg}', '{device_id_arg}',
+        '{target_params_arg}',
+    ]
+    expected_output = (
+        'python dummy.py --platform MY_PLATFORM --config MY_CONFIG')
+    cmd_str, _ = trampoline.ResolveTrampoline(tramp, argv=[])
+    self.assertEqual(expected_output, cmd_str)
+
+  def testResolveDeviceId(self):
+    """Tests that a device_id resolves to the expected value."""
+    tramp = [
+        'python dummy.py', '{platform_arg}', '{config_arg}', '{device_id_arg}',
+        '{target_params_arg}',
+    ]
+    expected_output = (
+        'python dummy.py --platform MY_PLATFORM --config MY_CONFIG'
+        ' --device_id 1234')
+    cmd_str, _ = trampoline.ResolveTrampoline(
+        tramp,
+        argv=['--device_id', '1234'])
+    self.assertEqual(expected_output, cmd_str)
+
+  def testTargetParams(self):
+    """Tests that target_params resolves to the expected value."""
+    tramp = [
+        'python dummy.py', '--target_name cobalt',
+        '{platform_arg}', '{config_arg}', '{device_id_arg}',
+        '{target_params_arg}',
+    ]
+    expected_output = (
+        'python dummy.py'
+        ' --target_name cobalt --platform MY_PLATFORM'
+        ' --config MY_CONFIG --target_params="--url=http://my.server.test"')
+    cmd_str, _ = trampoline.ResolveTrampoline(
+        tramp,
+        argv=['--target_params', '"--url=http://my.server.test"'])
+    self.assertEqual(expected_output, cmd_str)
+
+
+if __name__ == '__main__':
+  unittest.main(verbosity=2)
diff --git a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run.py b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run.py
new file mode 100644
index 0000000..896010a
--- /dev/null
+++ b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+#
+# Copyright 2019 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+"""A trampoline that launches starboard/tools/example/app_launcher.py.
+
+
+   Example: python __cobalt_archive/run/run.py cobalt
+"""
+
+
+import sys
+sys.path.insert(0, '.')
+from impl import trampoline # pylint: disable=relative-import,g-import-not-at-top
+
+
+TRAMPOLINE = [
+    'python starboard/tools/example/app_launcher_client.py',
+    '{platform_arg}',
+    '{config_arg}',
+    '{device_id_arg}',
+    '{target_params_arg}',
+]
+
+
+def _ResolveTrampoline(argv=None):
+  if argv == None:
+    argv = sys.argv[1:]
+  resolved_cmd, unresolve_args = trampoline.ResolveTrampoline(
+      TRAMPOLINE, argv=argv)
+  # Interpret all tail args as the target_name param.
+  tail_args = ['--target_name %s' % a for a in unresolve_args]
+  resolved_cmd = ' '.join([resolved_cmd] + tail_args)
+  return resolved_cmd
+
+
+if __name__ == '__main__':
+  trampoline.RunThenExit(_ResolveTrampoline())
diff --git a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run_black_box_tests.py b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run_black_box_tests.py
new file mode 100644
index 0000000..dda40e7
--- /dev/null
+++ b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run_black_box_tests.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+#
+# Copyright 2019 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+"""A trampoline that launches cobalt/tools/buildbot/run_black_box_tests.py.
+
+
+   Example: python __cobalt_archive/run/run_black_box_tests.py
+"""
+
+
+import sys
+sys.path.insert(0, '.')
+from impl import trampoline # pylint: disable=relative-import,g-import-not-at-top
+
+
+TRAMPOLINE = [
+    'python cobalt/tools/buildbot/run_black_box_tests.py',
+    '--action', 'run',
+    '{platform_arg}',
+    '{config_arg}',
+    '{device_id_arg}',
+    '{target_params_arg}',
+]
+
+
+def _ResolveTrampoline(argv=None):
+  if argv == None:
+    argv = sys.argv[1:]
+  resolved_cmd, _ = trampoline.ResolveTrampoline(
+      TRAMPOLINE, argv=argv)
+  return resolved_cmd
+
+
+if __name__ == '__main__':
+  trampoline.RunThenExit(_ResolveTrampoline())
diff --git a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run_cobalt.py b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run_cobalt.py
deleted file mode 100644
index b06f37c..0000000
--- a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run_cobalt.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2019 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-"""A trampoline for running the Cobalt product from a Cobalt Archive.
-   See readme.md for more information on trampolines."""
-
-
-import trampoline  # pylint: disable=relative-import
-
-TRAMPOLINE = [
-    'python starboard/tools/example/app_launcher_client.py',
-    '--target_name cobalt',
-    '{platform_arg}',
-    '{config_arg}',
-    '{device_id_arg}',
-    '{target_params_arg}',
-]
-
-if __name__ == '__main__':
-  trampoline.RunTrampolineThenExit(TRAMPOLINE)
diff --git a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run_platform_tests.py b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run_platform_tests.py
new file mode 100644
index 0000000..f74a7ad
--- /dev/null
+++ b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run_platform_tests.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+#
+# Copyright 2019 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+"""A trampoline for running the unit tests from a Cobalt Archive.
+
+   This will invoke starboard/tools/testing/test_runner.py with
+   --platform_tests_only, which only runs a subset of tests related to platform
+   include nplb, starboard_platform_tests and others.
+
+   Example: python __cobalt_archive/run/run_platform_tests.py
+"""
+
+
+import sys
+sys.path.insert(0, '.')
+from impl import trampoline # pylint: disable=relative-import,g-import-not-at-top
+
+
+TRAMPOLINE = [
+    'python starboard/tools/testing/test_runner.py',
+    '--platform_tests_only',
+    '{platform_arg}',
+    '{config_arg}',
+    '{device_id_arg}',
+    '{target_params_arg}',
+]
+
+
+def _ResolveTrampoline(argv=None):
+  if argv == None:
+    argv = sys.argv[1:]
+  resolved_cmd, unresolve_args = trampoline.ResolveTrampoline(
+      TRAMPOLINE, argv=argv)
+  return resolved_cmd
+
+
+if __name__ == '__main__':
+  trampoline.RunThenExit(_ResolveTrampoline())
diff --git a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run_tests.py b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run_tests.py
index 6866851..041278e 100644
--- a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run_tests.py
+++ b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/run_tests.py
@@ -16,13 +16,24 @@
 
 
 """A trampoline for running the unit tests from a Cobalt Archive.
-   See readme.md for more information on trampolines.
 
-   Example: python __cobalt_archive/run/run_tests.py -t nplb -t nb_test
+   This will invoke starboard/tools/testing/test_runner.py, which runs the
+   specified test with a test filter list for the patform.
+
+   Note that this is different from run.py will invoke
+   starboard/tools/example/app_launcher_client.py which does NOT filter any
+   tests.
+
+   Example: python __cobalt_archive/run/run_tests.py nplb nb_test
+
+   Example: python __cobalt_archive/run/run_tests.py (runs all tests)
 """
 
 
-import trampoline  # pylint: disable=relative-import
+import sys
+sys.path.insert(0, '.')
+from impl import trampoline # pylint: disable=relative-import,g-import-not-at-top
+
 
 TRAMPOLINE = [
     'python starboard/tools/testing/test_runner.py',
@@ -33,5 +44,17 @@
     '{target_params_arg}',
 ]
 
+
+def _ResolveTrampoline(argv=None):
+  if argv == None:
+    argv = sys.argv[1:]
+  resolved_cmd, unresolve_args = trampoline.ResolveTrampoline(
+      TRAMPOLINE, argv=argv)
+  # Interpret all tail args as the target_name param.
+  tail_args = ['--target_name %s' % a for a in unresolve_args]
+  resolved_cmd = ' '.join([resolved_cmd] + tail_args)
+  return resolved_cmd
+
+
 if __name__ == '__main__':
-  trampoline.RunTrampolineThenExit(TRAMPOLINE)
+  trampoline.RunThenExit(_ResolveTrampoline())
diff --git a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/trampoline.py b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/trampoline.py
deleted file mode 100644
index a9a3d52..0000000
--- a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/trampoline.py
+++ /dev/null
@@ -1,138 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2019 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-################################################################################
-#                                  API                                         #
-################################################################################
-
-
-def RunTrampolineThenExit(trampoline, argv=None):
-  cmd_str = ResolveTrampoline(trampoline, argv)
-  sys.exit(_ShellCmd(cmd_str))
-
-
-def ResolveTrampoline(trampoline, argv=None):
-  """
-  The result of this function call is to return the cmd string with
-  the platform, config, device_id resolved to values.
-    Example input:
-      ['python starboard/tools/example/app_launcher_client.py -t cobalt',
-       '{platform_arg}', '{config_arg}', '{device_id_arg}',
-       '{target_params_arg}']
-    Example Output:
-      'python starboard/tools/example/app_launcher_client.py -t cobalt ' + \
-      '--platform linux --config devel --device_id IP_ADDRESS'
-  """
-  return _ResolveTrampoline(trampoline, argv)
-
-
-################################################################################
-#                                 IMPL                                         #
-################################################################################
-
-
-import argparse
-import os
-import sys
-import json
-import subprocess
-
-
-_SELF_DIR = os.path.dirname(__file__)
-_META_FILE = os.path.normpath(os.path.join(_SELF_DIR, '..', 'metadata.json'))
-with open(_META_FILE) as fd:
-  data = fd.read()
-  _META_DATA = json.loads(data)
-
-
-# Tests can modify these values and alter the output of the trampoline
-# resolver.
-PLATFORM = _META_DATA['platform']
-CONFIG = _META_DATA['config']
-IS_TEST = _META_DATA.get('comment', None) == 'TEST'
-
-
-def _FindCwd():
-  """Returns the current working directory, which is detected
-  by whether the metadata.json is real (meaning we are in a
-  cobalt archive) or in the source directory."""
-  if IS_TEST:
-    p = os.path.join(_SELF_DIR, '..', '..', '..', '..', '..')
-  else:
-    p = os.path.join(_SELF_DIR, '..', '..')
-  return os.path.normpath(p)
-
-
-def _ShellCmd(cmd_str, cwd=_FindCwd()):
-  sys.stdout.write('in:      %s\n' % os.path.abspath(cwd))
-  sys.stdout.write('Calling: %s\n\n' % cmd_str)
-  return subprocess.call(cmd_str, cwd=cwd, shell=True,
-                         universal_newlines=True)
-
-
-def _UnQuote(s):
-  if len(s) < 2:
-    return s
-  elif s[0] == '"' and s[-1] == '"':
-    return s[1:-1]
-  else:
-    return s
-
-
-def _ResolveTrampoline(trampoline, argv):
-  if argv is None:
-    argv = sys.argv[1:]
-  args = _ParseArgs(argv)
-  placeholders = {
-    'platform_arg': '--platform %s' % PLATFORM,
-    'config_arg': '--config %s' % CONFIG
-  }
-  placeholders['device_id_arg'] = (
-      '' if not args.device_id else '--device_id %s' % args.device_id)
-  placeholders['target_params_arg'] = (
-      '' if not args.target_params else
-      '--target_params="%s"' % _UnQuote(args.target_params))
-  if not args.target_name:
-    placeholders['target_names_arg'] = ''
-  else:
-    targets = ['--target_name ' + name for name in args.target_name]
-    placeholders['target_names_arg'] = ' '.join(targets)
-  trampoline = [part.format(**placeholders) for part in trampoline]
-  trampoline = [t for t in trampoline if t.strip()]
-  return ' '.join(trampoline)
-
-
-def _ParseArgs(argv):
-  class MyParser(argparse.ArgumentParser):
-    def error(self, message):
-      sys.stderr.write('error: %s\n' % message)
-      self.print_help()
-  formatter_class = argparse.RawDescriptionHelpFormatter
-  parser = MyParser(formatter_class=formatter_class)
-  parser.add_argument('--device_id', type=str,
-                      help=('Choices are a device_id (usually an IP) '
-                            'passed to the launcher.'),
-                      default=None)
-  parser.add_argument('--target_params', type=str,
-                      help='Key=Value list of args to pass to the client.',
-                      default=None)
-  parser.add_argument('-t', '--target_name', action='append',
-                      help=('Name of executable target. Repeatable for '
-                            'multiple targets.'))
-
-  args = parser.parse_args(argv)
-  return args
diff --git a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/trampoline_test.py b/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/trampoline_test.py
deleted file mode 100644
index 5bc4e33..0000000
--- a/src/cobalt/build/cobalt_archive_content/__cobalt_archive/run/trampoline_test.py
+++ /dev/null
@@ -1,139 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2019 The Cobalt Authors. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-import unittest
-
-import trampoline  # pylint: disable=relative-import
-import run_cobalt  # pylint: disable=relative-import
-import run_tests  # pylint: disable=relative-import
-
-
-class TrampolineTest(unittest.TestCase):
-  """Tests trampoline substitutions"""
-  def setUp(self):
-    # Change the trampoline internals for testing purposes.
-    self.prev_platform, trampoline.PLATFORM = trampoline.PLATFORM, 'MY_PLATFORM'
-    self.prev_config, trampoline.CONFIG = trampoline.CONFIG, 'MY_CONFIG'
-
-  def tearDown(self):
-    trampoline.PLATFORM = self.prev_platform
-    trampoline.CONFIG = self.prev_config
-
-  def testResolvePlatformConfig(self):
-    """Tests that a device_id resolves to the expected value."""
-    INPUT = [
-      'python dummy.py', '{platform_arg}', '{config_arg}', '{device_id_arg}',
-      '{target_params_arg}',
-    ]
-    EXPECTED_OUTPUT = (
-        'python dummy.py --platform MY_PLATFORM --config MY_CONFIG')
-    cmd_str = trampoline.ResolveTrampoline(
-        INPUT, argv=[])
-    self.assertEqual(EXPECTED_OUTPUT, cmd_str)
-
-  def testResolveDeviceId(self):
-    """Tests that a device_id resolves to the expected value."""
-    INPUT = [
-      'python dummy.py', '{platform_arg}', '{config_arg}', '{device_id_arg}',
-      '{target_params_arg}',
-    ]
-    EXPECTED_OUTPUT = (
-      'python dummy.py --platform MY_PLATFORM --config MY_CONFIG'
-      ' --device_id 1234')
-    cmd_str = trampoline.ResolveTrampoline(
-        INPUT,
-        argv=['--device_id', '1234'])
-    self.assertEqual(EXPECTED_OUTPUT, cmd_str)
-
-  def testTargetParams(self):
-    """Tests that target_params resolves to the expected value."""
-    INPUT = [
-      'python dummy.py', '--target_name cobalt',
-      '{platform_arg}', '{config_arg}', '{device_id_arg}',
-      '{target_params_arg}',
-    ]
-    EXPECTED_OUTPUT = (
-      'python dummy.py'
-      ' --target_name cobalt --platform MY_PLATFORM'
-      ' --config MY_CONFIG --target_params="--url=http://my.server.test"')
-    cmd_str = trampoline.ResolveTrampoline(
-        INPUT,
-        argv=['--target_params', '"--url=http://my.server.test"'])
-    self.assertEqual(EXPECTED_OUTPUT, cmd_str)
-
-
-class RunCobaltTrampolineTest(unittest.TestCase):
-  """Tests trampoline substitutions for run_cobalt.py"""
-  def setUp(self):
-    # Change the trampoline internals for testing purposes.
-    self.prev_platform, trampoline.PLATFORM = trampoline.PLATFORM, 'MY_PLATFORM'
-    self.prev_config, trampoline.CONFIG = trampoline.CONFIG, 'MY_CONFIG'
-
-  def tearDown(self):
-    trampoline.PLATFORM = self.prev_platform
-    trampoline.CONFIG = self.prev_config
-
-  def testGeneral(self):
-    """Tests that target_params resolves to the expected value."""
-    INPUT = run_cobalt.TRAMPOLINE
-    EXPECTED_OUTPUT = (
-      'python starboard/tools/example/app_launcher_client.py'
-      ' --target_name cobalt --platform MY_PLATFORM --config MY_CONFIG'
-      ' --target_params="--url=http://my.server.test"')
-    cmd_str = trampoline.ResolveTrampoline(
-        INPUT,
-        argv=['--target_params', '"--url=http://my.server.test"'])
-    self.assertEqual(EXPECTED_OUTPUT, cmd_str)
-
-
-class RunUnitTestsTrampolineTest(unittest.TestCase):
-  """Tests trampoline substitutions for run_unit_tests.py"""
-  def setUp(self):
-    # Change the trampoline internals for testing purposes.
-    self.prev_platform, trampoline.PLATFORM = trampoline.PLATFORM, 'MY_PLATFORM'
-    self.prev_config, trampoline.CONFIG = trampoline.CONFIG, 'MY_CONFIG'
-
-  def tearDown(self):
-    trampoline.PLATFORM = self.prev_platform
-    trampoline.CONFIG = self.prev_config
-
-  def testOne(self):
-    """Tests that --target_name resolves to the expected value."""
-    INPUT = run_tests.TRAMPOLINE
-    EXPECTED_OUTPUT = (
-      'python starboard/tools/testing/test_runner.py'
-      ' --target_name nplb --platform MY_PLATFORM --config MY_CONFIG')
-    cmd_str = trampoline.ResolveTrampoline(
-        INPUT,
-        argv=['--target_name', 'nplb'])
-    self.assertEqual(EXPECTED_OUTPUT, cmd_str)
-
-  def testTwo(self):
-    """Tests that --target_name used twice resolves to the expected value."""
-    INPUT = run_tests.TRAMPOLINE
-    EXPECTED_OUTPUT = (
-      'python starboard/tools/testing/test_runner.py'
-      ' --target_name nplb --target_name nb_test'
-      ' --platform MY_PLATFORM --config MY_CONFIG')
-    cmd_str = trampoline.ResolveTrampoline(
-        INPUT,
-        argv=['--target_name', 'nplb', '--target_name', 'nb_test'])
-    self.assertEqual(EXPECTED_OUTPUT, cmd_str)
-
-
-if __name__ == '__main__':
-  unittest.main(verbosity=2)
diff --git a/src/cobalt/build/cobalt_archive_extract.py b/src/cobalt/build/cobalt_archive_extract.py
new file mode 100644
index 0000000..617d1e8
--- /dev/null
+++ b/src/cobalt/build/cobalt_archive_extract.py
@@ -0,0 +1,166 @@
+#!/usr/bin/env python
+#
+# Copyright 2019 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Tools for extracting a Cobalt Archive.
+
+This no-dependency tool will extract a Cobalt Archive across all platforms.
+
+This is slightly complicated because of issues on Windows where the poor
+support for pathnames longer than 255 characters is an issue.
+"""
+
+
+import argparse
+import logging
+import os
+import shutil
+import subprocess
+import sys
+import zipfile
+
+
+################################################################################
+#                                  API                                         #
+################################################################################
+
+
+def ExtractTo(archive_zip_path, output_dir, outstream=None):
+  return _ExtractTo(archive_zip_path=archive_zip_path,
+                    output_dir=output_dir,
+                    outstream=outstream)
+
+
+def ToWinUncPath(dos_path, encoding=None):
+  """Returns a windows UNC path which enables long path names in win32 apis."""
+  return _ToWinUncPath(dos_path, encoding)
+
+
+################################################################################
+#                                 IMPL                                         #
+################################################################################
+
+
+_OUT_ARCHIVE_ROOT = '__cobalt_archive'
+_OUT_FINALIZE_DECOMPRESSION_PATH = '%s/%s' % (_OUT_ARCHIVE_ROOT,
+                                              'finalize_decompression')
+_OUT_DECOMP_PY = '%s/%s' % (_OUT_FINALIZE_DECOMPRESSION_PATH,
+                            'decompress.py')
+_OUT_DECOMP_JSON = '%s/%s' % (_OUT_FINALIZE_DECOMPRESSION_PATH,
+                              'decompress.json')
+
+_IS_WINDOWS = sys.platform in ['win32', 'cygwin']
+
+
+def _ToWinUncPath(dos_path, encoding=None):
+  """Windows supports long file names when using a UNC path."""
+  assert _IS_WINDOWS
+  do_convert = (not isinstance(dos_path, unicode) and encoding is not None)
+  if do_convert:
+    dos_path = dos_path.decode(encoding)
+  path = os.path.abspath(dos_path)
+  if path.startswith(u'\\\\'):
+    return u'\\\\?\\UNC\\' + path[2:]
+  return u'\\\\?\\' + path
+
+
+def _GetZipFileClass():
+  """Get the ZipFile class for the platform"""
+  if not _IS_WINDOWS:
+    return zipfile.ZipFile
+  else:
+    class ZipFileLongPaths(zipfile.ZipFile):
+      """Handles extracting to paths longer than 255 characters."""
+
+      def _extract_member(self, member, targetpath, pwd):
+        targetpath = _ToWinUncPath(targetpath)
+        return zipfile.ZipFile._extract_member(self, member, targetpath, pwd)
+    return ZipFileLongPaths
+
+
+def _UnzipFiles(input_zip_path, output_dir, outstream):
+  """Returns True if all files were extracted, else False."""
+  if outstream is None:
+    outstream = sys.stdout
+  all_ok = True
+  zf_class = _GetZipFileClass()
+  with zf_class(input_zip_path, 'r', allowZip64=True) as zf:
+    for zinfo in zf.infolist():
+      try:
+        logging.debug('Extracting: %s -> %s', zinfo.filename, output_dir)
+        zf.extract(zinfo, path=output_dir)
+      except Exception as err:  # pylint: disable=broad-except
+        msg = 'Exception happend during bundle extraction: ' + str(err) + '\n'
+        outstream.write(msg)
+        all_ok = False
+  return all_ok
+
+
+def _ExtractTo(archive_zip_path, output_dir, outstream=None):
+  """Returns True if all files were extracted, False otherwise."""
+  outstream = outstream if outstream else sys.stdout
+  assert os.path.exists(archive_zip_path), 'No archive at %s' % archive_zip_path
+  logging.info('UNZIPPING %s -> %s', archive_zip_path, output_dir)
+  ok = _UnzipFiles(archive_zip_path, output_dir, outstream)
+  # Now that all files have been extracted, execute the final decompress
+  # step.
+  decomp_py = os.path.abspath(os.path.join(output_dir, _OUT_DECOMP_PY))
+  assert(os.path.isfile(decomp_py)), decomp_py
+  cmd_str = 'python ' + decomp_py
+  outstream.write('Executing: %s\n' % cmd_str)
+  rc = subprocess.call(cmd_str, shell=True, stdout=outstream,
+                       stderr=outstream)
+  ok = ok & (rc == 0)
+  return ok
+
+
+def _CreateArgumentParser():
+  """Creates a parser that will print the full help on failure to parse."""
+  parser = argparse.ArgumentParser()
+  parser.add_argument('archive_path', help='Archive to extract.')
+  parser.add_argument('output_path', help='Output path to extract the archive.')
+  parser.add_argument('--delete', action='store_true',
+                      help='Deletes output_path if it exists.')
+  parser.add_argument('--verbose', action='store_true')
+  return parser
+
+
+def main():
+  parser = _CreateArgumentParser()
+  # To make this future compatible parse_known_args() is used and any unknown
+  # args will generate a warning rather than be a fatal event. This allows
+  # any flags used in the future to be used on this tool.
+  args, unknown_args = parser.parse_known_args()
+  logging_lvl = logging.INFO
+  if args.verbose:
+    logging_lvl = logging.DEBUG
+  fmt = '[%(filename)s:%(lineno)s:%(levelname)s] %(message)s'
+  logging.basicConfig(format=fmt, level=logging_lvl)
+  if unknown_args:
+    logging.warning('Unknown (ignored) args: %s', unknown_args)
+  if args.delete:
+    logging.info('Removing previous folder at %s', args.output_path)
+    shutil.rmtree(args.output_path, ignore_errors=True)
+  all_ok = ExtractTo(args.archive_path, args.output_path)
+  if all_ok:
+    sys.exit(0)
+  else:
+    logging.critical('Errors happened.')
+    sys.exit(1)
+
+
+if __name__ == '__main__':
+  main()
+
diff --git a/src/cobalt/build/cobalt_archive_test.py b/src/cobalt/build/cobalt_archive_test.py
new file mode 100644
index 0000000..086a897
--- /dev/null
+++ b/src/cobalt/build/cobalt_archive_test.py
@@ -0,0 +1,214 @@
+#!/usr/bin/python
+#
+# Copyright 2019 The Cobalt Authors. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+import json
+import os
+import shutil
+import stat
+import subprocess
+import unittest
+
+import _env  # pylint: disable=relative-import,unused-import
+from cobalt.build import cobalt_archive
+from starboard.build import filelist
+from starboard.build import filelist_test
+from starboard.build import port_symlink
+from starboard.tools import util
+
+
+class CobaltArchiveTest(unittest.TestCase):
+
+  def testFoldIdenticalFiles(self):
+    tf_root = filelist_test.TempFileSystem('bundler_fold')
+    tf_root.Clear()
+    tf1 = filelist_test.TempFileSystem(os.path.join('bundler_fold', '1'))
+    tf2 = filelist_test.TempFileSystem(os.path.join('bundler_fold', '2'))
+    tf1.Make()
+    tf2.Make()
+    flist = filelist.FileList()
+    subdirs = [tf1.root_in_tmp, tf2.root_in_tmp]
+    flist.AddAllFilesInPaths(tf_root.root_tmp, subdirs)
+    flist.Print()
+    identical_files = [tf1.test_txt, tf2.test_txt]
+    physical_files, copy_files = cobalt_archive._FoldIdenticalFiles(
+        identical_files)
+    self.assertEqual(tf1.test_txt, physical_files[0])
+    self.assertIn(tf1.test_txt, copy_files[0][0])
+    self.assertIn(tf2.test_txt, copy_files[0][1])
+
+  def testMakesDeployInfo(self):
+    flist = filelist.FileList()
+    tf = filelist_test.TempFileSystem()
+    tf.Clear()
+    tf.Make()
+    bundle_zip = os.path.join(tf.root_tmp, 'bundle.zip')
+    car = cobalt_archive.CobaltArchive(bundle_zip)
+    car.MakeArchive(platform_name='fake',
+                    platform_sdk_version='fake_sdk',
+                    config='devel',
+                    file_list=flist)
+    out_dir = os.path.join(tf.root_tmp, 'out')
+    car.ExtractTo(out_dir)
+    out_metadata_file = os.path.join(out_dir, cobalt_archive._OUT_METADATA_PATH)
+    self.assertEqual(filelist.GetFileType(out_metadata_file),
+                     filelist.TYPE_FILE)
+    with open(out_metadata_file) as fd:
+      text = fd.read()
+      js = json.loads(text)
+      self.assertTrue(js)
+      self.assertEqual(js['sdk_version'], 'fake_sdk')
+      self.assertEqual(js['platform'], 'fake')
+      self.assertEqual(js['config'], 'devel')
+
+  def testExtractTo(self):
+    flist = filelist.FileList()
+    tf = filelist_test.TempFileSystem()
+    tf.Clear()
+    tf.Make()
+    flist.AddSymLink(tf.root_in_tmp, tf.sym_dir)
+    bundle_zip = os.path.join(tf.root_tmp, 'bundle.zip')
+    car = cobalt_archive.CobaltArchive(bundle_zip)
+    car.MakeArchive(platform_name='fake',
+                    platform_sdk_version='fake_sdk',
+                    config='devel',
+                    file_list=flist)
+    out_dir = os.path.join(tf.root_tmp, 'out')
+    car.ExtractTo(out_dir)
+    out_from_dir = os.path.join(out_dir, 'from_dir')
+    out_from_dir_lnk = os.path.join(out_dir, 'from_dir_lnk')
+    self.assertEqual(filelist.GetFileType(out_from_dir),
+                     filelist.TYPE_DIRECTORY)
+    self.assertEqual(filelist.GetFileType(out_from_dir_lnk),
+                     filelist.TYPE_SYMLINK_DIR)
+    resolved_from_link_path = os.path.join(
+        out_dir, port_symlink.ReadSymLink(out_from_dir_lnk))
+    self.assertEqual(os.path.abspath(out_from_dir),
+                     os.path.abspath(resolved_from_link_path))
+
+  def testExtractFileWithLongFileName(self):
+    """Tests that a long file name can be archived and extracted."""
+    flist = filelist.FileList()
+    tf = filelist_test.TempFileSystem()
+    tf.Clear()
+    tf.Make()
+    self.assertTrue(os.path.exists(tf.root_in_tmp))
+    suffix_path = os.path.join(
+        'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+        'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+        'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+        'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+        'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+        'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+        'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+        'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+        'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+        'test.txt'
+    )
+    input_dst = os.path.join(tf.root_in_tmp, suffix_path)
+    out_dir = os.path.join(tf.root_tmp, 'out')
+    output_dst = os.path.join(out_dir, suffix_path)
+    _MoveFileWithLongPath(tf.test_txt, input_dst)
+    self.assertTrue(_LongPathExists(input_dst))
+    flist.AddFile(tf.root_in_tmp, input_dst)
+
+    bundle_zip = os.path.join(tf.root_tmp, 'bundle.zip')
+    car = cobalt_archive.CobaltArchive(bundle_zip)
+    car.MakeArchive(platform_name='fake',
+                    platform_sdk_version='fake_sdk',
+                    config='devel',
+                    file_list=flist)
+    car.ExtractTo(out_dir)
+    self.assertTrue(_LongPathExists(output_dst))
+
+  @unittest.skipIf(port_symlink.IsWindows(), 'Any platform but windows.')
+  def testExecutionAttribute(self):
+    flist = filelist.FileList()
+    tf = filelist_test.TempFileSystem()
+    tf.Make()
+    # Execution bit seems to turn off the read bit, so we just set all
+    # read/write/execute bit for the user.
+    write_flags = stat.S_IXUSR | stat.S_IWUSR | stat.S_IRUSR
+    os.chmod(tf.test_txt, write_flags)
+    self.assertNotEqual(
+        0, write_flags & cobalt_archive._GetFilePermissions(tf.test_txt))
+    flist.AddFile(tf.root_tmp, tf.test_txt)
+    bundle_zip = os.path.join(tf.root_tmp, 'bundle.zip')
+    car = cobalt_archive.CobaltArchive(bundle_zip)
+    car.MakeArchive(platform_name='fake',
+                    platform_sdk_version='fake_sdk',
+                    config='devel',
+                    file_list=flist)
+    # Now grab the json file and check that the file appears in the
+    # executable_file list.
+    json_str = car.ReadFile(
+        '__cobalt_archive/finalize_decompression/decompress.json')
+    decompress_dict = json.loads(json_str)
+    executable_files = decompress_dict.get('executable_files')
+    # Expect that the executable file appears in the executable_files.
+    self.assertTrue(executable_files)
+    archive_path = os.path.relpath(tf.test_txt, tf.root_tmp)
+    self.assertIn(archive_path, executable_files)
+    out_dir = os.path.join(tf.root_tmp, 'out')
+    car.ExtractTo(output_dir=out_dir)
+    out_file = os.path.join(out_dir, tf.test_txt)
+    self.assertTrue(_LongPathExists(out_file))
+    perms = cobalt_archive._GetFilePermissions(out_file)
+    self.assertTrue(perms & stat.S_IXUSR)
+
+
+def _SilentCall(cmd_str):
+  proc = subprocess.Popen(cmd_str,
+                          shell=True,
+                          stdout=subprocess.PIPE,
+                          stderr=subprocess.STDOUT)
+  (_, _) = proc.communicate()
+  return proc.returncode
+
+
+def _LongPathExists(p):
+  if port_symlink.IsWindows():
+    rc = _SilentCall('dir /s /b "%s"' % p)
+    return rc == 0
+  else:
+    return os.path.isfile(p)
+
+
+def _MoveFileWithLongPath(src_file, dst_file):
+  dst_dir = os.path.dirname(dst_file)
+  if port_symlink.IsWindows():
+    # Work around for file-length path limitations on Windows.
+    src_dir = os.path.dirname(src_file)
+    file_name = os.path.basename(src_file)
+    shell_cmd = 'robocopy "%s" "%s" "%s" /MOV' % (src_dir, dst_dir, file_name)
+    rc = _SilentCall(shell_cmd)
+    if 1 != rc:  # Robocopy returns 1 if a file was copied.
+      raise OSError('File %s was not copied' % src_file)
+    expected_out_file = os.path.join(dst_dir, file_name)
+    if not _LongPathExists(expected_out_file):
+      raise OSError('File did not end up in %s' % dst_dir)
+    return
+  else:
+    if not os.path.isdir(dst_dir):
+      os.makedirs(dst_dir)
+    shutil.move(src_file, dst_file)
+    if not os.path.isfile(dst_file):
+      raise OSError('File did not end up in %s' % dst_dir)
+
+
+if __name__ == '__main__':
+  util.SetupDefaultLoggingConfig()
+  unittest.main(verbosity=2)
diff --git a/src/cobalt/build/cobalt_configuration.gypi b/src/cobalt/build/cobalt_configuration.gypi
index fc1d27e..76ffb6b 100644
--- a/src/cobalt/build/cobalt_configuration.gypi
+++ b/src/cobalt/build/cobalt_configuration.gypi
@@ -48,10 +48,6 @@
     # implement spherical video playback.
     'enable_map_to_mesh%': 0,
 
-    # Enables embedding Cobalt as a shared library within another app. This
-    # requires a 'lib' starboard implementation for the corresponding platform.
-    'cobalt_enable_lib': '<(sb_enable_lib)',
-
     # This variable defines what Cobalt's preferred strategy should be for
     # handling internally triggered application exit requests (e.g. the user
     # chooses to back out of the application).
@@ -122,7 +118,7 @@
     'cobalt_font_package_override_fallback_symbols%': -1,
 
     # Build version number.
-    'cobalt_version%': 0,
+    'cobalt_version%': '<(BUILD_NUMBER)',
 
     # Defines what kind of rasterizer will be used.  This can be adjusted to
     # force a stub graphics implementation or software graphics implementation.
@@ -234,6 +230,8 @@
     # Set to "true" to enable v8 snapshot generation at Cobalt build time.
     'cobalt_v8_buildtime_snapshot%': '<(cobalt_v8_buildtime_snapshot)',
 
+    'cobalt_enable_quic': 1,
+
     # Cache parameters
 
     # The following set of parameters define how much memory is reserved for
@@ -271,6 +269,25 @@
     # atlases about a quarter of the frame size.
     'offscreen_target_cache_size_in_bytes%': -1,
 
+    # Determines the capacity of the encoded image cache, which manages encoded
+    # images downloaded from a web page. These images are cached within CPU
+    # memory.  This not only reduces network traffic to download the encoded
+    # images, but also allows the downloaded images to be held during suspend.
+    # Note that there is also a cache for the decoded images whose capacity is
+    # specified in |image_cache_size_in_bytes|.  The decoded images are often
+    # cached in the GPU memory and will be released during suspend.
+    #
+    # If a system meet the following requirements:
+    # 1. Has a fast image decoder.
+    # 2. Has enough CPU memory, or has a unified memory architecture that allows
+    #    sharing of CPU and GPU memory.
+    # Then it may consider to set |encoded_image_cache_size_in_bytes| to a much
+    # bigger value, and set the value of |image_cache_size_in_bytes| to a much
+    # smaller value. This allows the app to cache significant more images.
+    #
+    # Set this to 0 can disable the cache completely.
+    'encoded_image_cache_size_in_bytes%': 1024 * 1024,
+
     # Determines the capacity of the image cache, which manages image surfaces
     # downloaded from a web page.  While it depends on the platform, often (and
     # ideally) these images are cached within GPU memory.
@@ -572,6 +589,11 @@
         'defines': [
           'COBALT_V8_BUILDTIME_SNAPSHOT=1',
         ],
+      }],
+      ['cobalt_enable_quic == 1', {
+        'defines': [
+          'COBALT_ENABLE_QUIC',
+        ],
       }]
     ],
   }, # end of target_defaults
diff --git a/src/cobalt/build/cobalt_configuration.py b/src/cobalt/build/cobalt_configuration.py
index 19d3d2e..f377bff 100644
--- a/src/cobalt/build/cobalt_configuration.py
+++ b/src/cobalt/build/cobalt_configuration.py
@@ -13,11 +13,9 @@
 # limitations under the License.
 """Base cobalt configuration for GYP."""
 
-import logging
 import os
 
 import _env  # pylint: disable=unused-import
-from cobalt.build import gyp_utils
 from cobalt.tools import paths
 import cobalt.tools.webdriver_benchmark_config as wb_config
 from starboard.build import application_configuration
@@ -42,7 +40,6 @@
   def GetVariables(self, config_name):
     variables = {
         'cobalt_fastbuild': os.environ.get('LB_FASTBUILD', 0),
-        'cobalt_version': gyp_utils.GetBuildNumber(),
 
         # This is here rather than cobalt_configuration.gypi so that it's
         # available for browser_bindings_gen.gyp.
@@ -51,7 +48,6 @@
         # Cobalt uses OpenSSL on all platforms.
         'use_openssl': 1,
     }
-    logging.info('Build Number: {}'.format(variables['cobalt_version']))
     return variables
 
   def GetPostIncludes(self):
@@ -136,6 +132,7 @@
         'cssom_test',
         'dom_parser_test',
         'dom_test',
+        'extension_test',
         'layout_test',
         'layout_tests',
         'loader_test',
diff --git a/src/cobalt/build/config/base.gni b/src/cobalt/build/config/base.gni
index d3654dd..9fc16f2 100644
--- a/src/cobalt/build/config/base.gni
+++ b/src/cobalt/build/config/base.gni
@@ -537,17 +537,11 @@
   cobalt_media_source_garbage_collection_duration_threshold_in_seconds = "(170)"
 }
 
-# Enables embedding Cobalt as a shared library within another app. This
-# requires a 'lib' starboard implementation for the corresponding platform.
-if (!defined(cobalt_enable_lib)) {
-  cobalt_enable_lib = sb_enable_lib
-}
-
 # For configurations other than Gold, set the flag that lets test data files be
 # copied and carried along with the build.
 # Clients must copy over all content; to avoid having to copy over extra data,
 # we omit the test data
-_copy_test_data = (cobalt_config != "gold" && !cobalt_enable_lib)
+_copy_test_data = (cobalt_config != "gold")
 if (!defined(enable_debugger)) {
   enable_debugger = _copy_test_data
 }
diff --git a/src/cobalt/build/gyp_cobalt b/src/cobalt/build/gyp_cobalt
index a494bd7..1a3d04a 100755
--- a/src/cobalt/build/gyp_cobalt
+++ b/src/cobalt/build/gyp_cobalt
@@ -23,6 +23,7 @@
 
 import _env  # pylint: disable=unused-import
 from cobalt.build import cobalt_configuration
+from cobalt.build import gyp_utils
 from cobalt.tools import paths
 from starboard.build.gyp_runner import GypRunner
 from starboard.tools import build
@@ -112,6 +113,8 @@
     logging.error('GYP_DEFINES environment variable is not supported.')
     return RETVAL_ERROR
 
+  options.build_number = gyp_utils.GetBuildNumber()
+
   try:
     gyp_runner = GypRunner(options)
   except RuntimeError as e:
diff --git a/src/cobalt/build/gyp_utils.py b/src/cobalt/build/gyp_utils.py
index f8a055a..cabcbe1 100644
--- a/src/cobalt/build/gyp_utils.py
+++ b/src/cobalt/build/gyp_utils.py
@@ -24,8 +24,6 @@
 
 import _env  # pylint: disable=unused-import
 from cobalt.tools import paths
-from starboard.build import clang
-from starboard.tools import build
 
 
 _VERSION_SERVER_URL = 'https://carbon-airlock-95823.appspot.com/build_version/generate'  # pylint:disable=line-too-long
@@ -130,9 +128,3 @@
   expression = match.group(1)
   value = eval(expression)  # pylint:disable=eval-used
   return value
-
-
-def GetHostCompilerEnvironment(goma_supports_compiler=False):
-  # Assume the same clang that Starboard declares.
-  return build.GetHostCompilerEnvironment(clang.GetClangSpecification(),
-                                          goma_supports_compiler)
diff --git a/src/cobalt/build/path_conversion_test.py b/src/cobalt/build/path_conversion_test.py
index 5afe91a..b03524f 100644
--- a/src/cobalt/build/path_conversion_test.py
+++ b/src/cobalt/build/path_conversion_test.py
@@ -13,9 +13,11 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
+import os
 import unittest
 
-import _env  # pylint: disable=unused-import
+import _env  # pylint: disable=unused-import,relative-import
 from cobalt.build.path_conversion import ConvertPath
 
 
@@ -27,12 +29,12 @@
   def testOutputDirectory(self):
     self.assertEqual(
         ConvertPath('this/is/a/path.txt', output_directory='another/location'),
-        'another/location/path.txt')
+        os.path.join('another/location', 'path.txt'))
 
   def testAddPrefix(self):
     self.assertEqual(
         ConvertPath('this/is/a/path.txt', output_prefix='banana_'),
-        'this/is/a/banana_path.txt')
+        os.path.join('this/is/a', 'banana_path.txt'))
 
   def testChangeExtension(self):
     self.assertEqual(
@@ -53,7 +55,8 @@
         ConvertPath(
             'if/this/is/a/path.txt',
             output_directory='then/that',
-            base_directory='if/this'), 'then/that/is/a/path.txt')
+            base_directory='if/this'),
+        os.path.join('then/that', 'is', 'a', 'path.txt'))
 
 
 if __name__ == '__main__':
diff --git a/src/cobalt/content/licenses/licenses_cobalt.txt b/src/cobalt/content/licenses/licenses_cobalt.txt
index 976e8a9..195ae09 100644
--- a/src/cobalt/content/licenses/licenses_cobalt.txt
+++ b/src/cobalt/content/licenses/licenses_cobalt.txt
@@ -179,8 +179,7 @@
 
   Chromium
 
-
-  // Copyright (c) 2013 The Chromium Authors. All rights reserved.
+  // Copyright 2015 The Chromium Authors. All rights reserved.
   //
   // Redistribution and use in source and binary forms, with or without
   // modification, are permitted provided that the following conditions are
@@ -210,18 +209,32 @@
 
 
 
-  openssl
+  boringssl
 
 
+  BoringSSL is a fork of OpenSSL. As such, large parts of it fall under OpenSSL
+  licensing. Files that are completely new have a Google copyright and an ISC
+  license. This license is reproduced at the bottom of this file.
 
-    LICENSE ISSUES
-    ==============
+  Contributors to BoringSSL are required to follow the CLA rules for Chromium:
+  https://cla.developers.google.com/clas
 
-    The OpenSSL toolkit stays under a dual license, i.e. both the conditions of
-    the OpenSSL License and the original SSLeay license apply to the toolkit.
-    See below for the actual license texts. Actually both licenses are BSD-style
-    Open Source licenses. In case of any license issues related to OpenSSL
-    please contact openssl-core@openssl.org.
+  Files in third_party/ have their own licenses, as described therein. The MIT
+  license, for third_party/fiat, which, unlike other third_party directories, is
+  compiled into non-test libraries, is included below.
+
+  The OpenSSL toolkit stays under a dual license, i.e. both the conditions of the
+  OpenSSL License and the original SSLeay license apply to the toolkit. See below
+  for the actual license texts. Actually both licenses are BSD-style Open Source
+  licenses. In case of any license issues related to OpenSSL please contact
+  openssl-core@openssl.org.
+
+  The following are Google-internal bug numbers where explicit permission from
+  some authors is recorded for use of their work. (This is purely for our own
+  record keeping.)
+    27287199
+    27287880
+    27287883
 
     OpenSSL License
     ---------------
@@ -234,7 +247,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
-   *    notice, this list of conditions and the following disclaimer.
+   *    notice, this list of conditions and the following disclaimer. 
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
@@ -289,21 +302,21 @@
    * This package is an SSL implementation written
    * by Eric Young (eay@cryptsoft.com).
    * The implementation was written so as to conform with Netscapes SSL.
-   *
+   * 
    * This library is free for commercial and non-commercial use as long as
    * the following conditions are aheared to.  The following conditions
    * apply to all code found in this distribution, be it the RC4, RSA,
    * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
    * included with this distribution is covered by the same copyright terms
    * except that the holder is Tim Hudson (tjh@cryptsoft.com).
-   *
+   * 
    * Copyright remains Eric Young's, and as such any Copyright notices in
    * the code are not to be removed.
    * If this package is used in a product, Eric Young should be given attribution
    * as the author of the parts of the library used.
    * This can be in the form of a textual message at program startup or
    * in documentation (online or textual) provided with the package.
-   *
+   * 
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
@@ -318,10 +331,10 @@
    *     Eric Young (eay@cryptsoft.com)"
    *    The word 'cryptographic' can be left out if the rouines from the library
    *    being used are not cryptographic related :-).
-   * 4. If you include any Windows specific code (or a derivative thereof) from
+   * 4. If you include any Windows specific code (or a derivative thereof) from 
    *    the apps directory (application code) you must include an acknowledgement:
    *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
-   *
+   * 
    * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
    * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -333,7 +346,7 @@
    * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
-   *
+   * 
    * The licence and distribution terms for any publically available version or
    * derivative of this code cannot be changed.  i.e. this code cannot simply be
    * copied and put under another distribution licence
@@ -341,6 +354,258 @@
    */
 
 
+  ISC license used for completely new code in BoringSSL:
+
+  /* Copyright (c) 2015, Google Inc.
+   *
+   * Permission to use, copy, modify, and/or distribute this software for any
+   * purpose with or without fee is hereby granted, provided that the above
+   * copyright notice and this permission notice appear in all copies.
+   *
+   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+   * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+   * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+   * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+   * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+   * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+
+  The code in third_party/fiat carries the MIT license:
+
+  Copyright (c) 2015-2016 the fiat-crypto authors (see
+  https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS).
+
+  Permission is hereby granted, free of charge, to any person obtaining a copy
+  of this software and associated documentation files (the "Software"), to deal
+  in the Software without restriction, including without limitation the rights
+  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the Software is
+  furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included in all
+  copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+  SOFTWARE.
+
+
+  Licenses for support code
+  -------------------------
+
+  Parts of the TLS test suite are under the Go license. This code is not included
+  in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so
+  distributing code linked against BoringSSL does not trigger this license:
+
+  Copyright (c) 2009 The Go Authors. All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are
+  met:
+
+     * Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above
+  copyright notice, this list of conditions and the following disclaimer
+  in the documentation and/or other materials provided with the
+  distribution.
+     * Neither the name of Google Inc. nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+  BoringSSL uses the Chromium test infrastructure to run a continuous build,
+  trybots etc. The scripts which manage this, and the script for generating build
+  metadata, are under the Chromium license. Distributing code linked against
+  BoringSSL does not trigger this license.
+
+  Copyright 2015 The Chromium Authors. All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are
+  met:
+
+     * Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above
+  copyright notice, this list of conditions and the following disclaimer
+  in the documentation and/or other materials provided with the
+  distribution.
+     * Neither the name of Google Inc. nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+  dmg_fp
+
+
+  /****************************************************************
+   *
+   * The author of this software is David M. Gay.
+   *
+   * Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
+   *
+   * Permission to use, copy, modify, and distribute this software for any
+   * purpose without fee is hereby granted, provided that this entire notice
+   * is included in all copies of any software which is or includes a copy
+   * or modification of this software and in all copies of the supporting
+   * documentation for such software.
+   *
+   * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
+   * WARRANTY.  IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
+   * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
+   * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
+   *
+   ***************************************************************/
+
+
+
+  dynamic_annotations
+
+
+  /* Copyright (c) 2008-2009, Google Inc.
+   * All rights reserved.
+   *
+   * Redistribution and use in source and binary forms, with or without
+   * modification, are permitted provided that the following conditions are
+   * met:
+   *
+   *     * Redistributions of source code must retain the above copyright
+   * notice, this list of conditions and the following disclaimer.
+   *     * Neither the name of Google Inc. nor the names of its
+   * contributors may be used to endorse or promote products derived from
+   * this software without specific prior written permission.
+   *
+   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+   * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   *
+   * ---
+   * Author: Kostya Serebryany
+   */
+
+
+
+  icu(base/third_party/icu)
+
+
+  COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
+
+  Copyright © 1991-2017 Unicode, Inc. All rights reserved.
+  Distributed under the Terms of Use in http://www.unicode.org/copyright.html
+
+  Permission is hereby granted, free of charge, to any person obtaining
+  a copy of the Unicode data files and any associated documentation
+  (the "Data Files") or Unicode software and any associated documentation
+  (the "Software") to deal in the Data Files or Software
+  without restriction, including without limitation the rights to use,
+  copy, modify, merge, publish, distribute, and/or sell copies of
+  the Data Files or Software, and to permit persons to whom the Data Files
+  or Software are furnished to do so, provided that either
+  (a) this copyright and permission notice appear with all copies
+  of the Data Files or Software, or
+  (b) this copyright and permission notice appear in associated
+  Documentation.
+
+  THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+  ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+  WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+  NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
+  DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+  PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+  Except as contained in this notice, the name of a copyright holder
+  shall not be used in advertising or otherwise to promote the sale,
+  use or other dealings in these Data Files or Software without prior
+  written authorization of the copyright holder.
+
+  ---------------------
+
+  Third-Party Software Licenses
+
+  This section contains third-party software notices and/or additional
+  terms for licensed third-party software components included within ICU
+  libraries.
+
+  1. ICU License - ICU 1.8.1 to ICU 57.1
+
+  COPYRIGHT AND PERMISSION NOTICE
+
+  Copyright (c) 1995-2016 International Business Machines Corporation and others
+  All rights reserved.
+
+  Permission is hereby granted, free of charge, to any person obtaining
+  a copy of this software and associated documentation files (the
+  "Software"), to deal in the Software without restriction, including
+  without limitation the rights to use, copy, modify, merge, publish,
+  distribute, and/or sell copies of the Software, and to permit persons
+  to whom the Software is furnished to do so, provided that the above
+  copyright notice(s) and this permission notice appear in all copies of
+  the Software and that both the above copyright notice(s) and this
+  permission notice appear in supporting documentation.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+  OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+  HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
+  SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
+  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+  Except as contained in this notice, the name of a copyright holder
+  shall not be used in advertising or otherwise to promote the sale, use
+  or other dealings in this Software without prior written authorization
+  of the copyright holder.
+
+  All trademarks and registered trademarks mentioned herein are the
+  property of their respective owners.
+
+
+
   Netscape Portable Runtime (NSPR)
 
 
@@ -381,6 +646,1031 @@
    * ***** END LICENSE BLOCK ***** */
 
 
+  symbolize
+
+
+  // Copyright (c) 2006, Google Inc.
+  // All rights reserved.
+  //
+  // Redistribution and use in source and binary forms, with or without
+  // modification, are permitted provided that the following conditions are
+  // met:
+  //
+  //     * Redistributions of source code must retain the above copyright
+  // notice, this list of conditions and the following disclaimer.
+  //     * Redistributions in binary form must reproduce the above
+  // copyright notice, this list of conditions and the following disclaimer
+  // in the documentation and/or other materials provided with the
+  // distribution.
+  //     * Neither the name of Google Inc. nor the names of its
+  // contributors may be used to endorse or promote products derived from
+  // this software without specific prior written permission.
+  //
+  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+  valgrind
+
+
+   Notice that the following BSD-style license applies to the Valgrind header
+   files used by Chromium (valgrind.h and memcheck.h). However, the rest of
+   Valgrind is licensed under the terms of the GNU General Public License,
+   version 2, unless otherwise indicated.
+
+   ----------------------------------------------------------------
+
+   Copyright (C) 2000-2008 Julian Seward.  All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+   2. The origin of this software must not be misrepresented; you must 
+      not claim that you wrote the original software.  If you use this 
+      software in a product, an acknowledgment in the product 
+      documentation would be appreciated but is not required.
+
+   3. Altered source versions must be plainly marked as such, and must
+      not be misrepresented as being the original software.
+
+   4. The name of the author may not be used to endorse or promote 
+      products derived from this software without specific prior written 
+      permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+  xdg_mime
+
+
+  Licensed under the Academic Free License version 2.0 (below)
+  Or under the following terms:
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the
+  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+  Boston, MA 02111-1307, USA.
+
+
+  --------------------------------------------------------------------------------
+  Academic Free License v. 2.0
+  --------------------------------------------------------------------------------
+
+  This Academic Free License (the "License") applies to any original work of
+  authorship (the "Original Work") whose owner (the "Licensor") has placed the
+  following notice immediately following the copyright notice for the Original
+  Work:
+
+  Licensed under the Academic Free License version 2.0
+  1) Grant of Copyright License. Licensor hereby grants You a world-wide,
+  royalty-free, non-exclusive, perpetual, sublicenseable license to do the
+  following:
+
+  a) to reproduce the Original Work in copies;
+  b) to prepare derivative works ("Derivative Works") based upon the Original
+     Work;
+  c) to distribute copies of the Original Work and Derivative Works to the
+     public;
+  d) to perform the Original Work publicly; and
+  e) to display the Original Work publicly.
+
+  2) Grant of Patent License. Licensor hereby grants You a world-wide,
+  royalty-free, non-exclusive, perpetual, sublicenseable license, under patent
+  claims owned or controlled by the Licensor that are embodied in the Original
+  Work as furnished by the Licensor, to make, use, sell and offer for sale the
+  Original Work and Derivative Works.
+
+  3) Grant of Source Code License. The term "Source Code" means the preferred
+  form of the Original Work for making modifications to it and all available
+  documentation describing how to modify the Original Work. Licensor hereby
+  agrees to provide a machine-readable copy of the Source Code of the Original
+  Work along with each copy of the Original Work that Licensor distributes.
+  Licensor reserves the right to satisfy this obligation by placing a
+  machine-readable copy of the Source Code in an information repository
+  reasonably calculated to permit inexpensive and convenient access by You for as
+  long as Licensor continues to distribute the Original Work, and by publishing
+  the address of that information repository in a notice immediately following
+  the copyright notice that applies to the Original Work.
+
+  4) Exclusions From License Grant. Neither the names of Licensor, nor the names
+  of any contributors to the Original Work, nor any of their trademarks or
+  service marks, may be used to endorse or promote products derived from this
+  Original Work without express prior written permission of the Licensor. Nothing
+  in this License shall be deemed to grant any rights to trademarks, copyrights,
+  patents, trade secrets or any other intellectual property of Licensor except as
+  expressly stated herein. No patent license is granted to make, use, sell or
+  offer to sell embodiments of any patent claims other than the licensed claims
+  defined in Section 2. No right is granted to the trademarks of Licensor even if
+  such marks are included in the Original Work. Nothing in this License shall be
+  interpreted to prohibit Licensor from licensing under different terms from this
+  License any Original Work that Licensor otherwise would have a right to
+  license.
+
+  5) This section intentionally omitted.
+
+  6) Attribution Rights. You must retain, in the Source Code of any Derivative
+  Works that You create, all copyright, patent or trademark notices from the
+  Source Code of the Original Work, as well as any notices of licensing and any
+  descriptive text identified therein as an "Attribution Notice." You must cause
+  the Source Code for any Derivative Works that You create to carry a prominent
+  Attribution Notice reasonably calculated to inform recipients that You have
+  modified the Original Work.
+
+  7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
+  the copyright in and to the Original Work and the patent rights granted herein
+  by Licensor are owned by the Licensor or are sublicensed to You under the terms
+  of this License with the permission of the contributor(s) of those copyrights
+  and patent rights. Except as expressly stated in the immediately proceeding
+  sentence, the Original Work is provided under this License on an "AS IS" BASIS
+  and WITHOUT WARRANTY, either express or implied, including, without limitation,
+  the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR
+  PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU.
+  This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No
+  license to Original Work is granted hereunder except under this disclaimer.
+
+  8) Limitation of Liability. Under no circumstances and under no legal theory,
+  whether in tort (including negligence), contract, or otherwise, shall the
+  Licensor be liable to any person for any direct, indirect, special, incidental,
+  or consequential damages of any character arising as a result of this License
+  or the use of the Original Work including, without limitation, damages for loss
+  of goodwill, work stoppage, computer failure or malfunction, or any and all
+  other commercial damages or losses. This limitation of liability shall not
+  apply to liability for death or personal injury resulting from Licensor's
+  negligence to the extent applicable law prohibits such limitation. Some
+  jurisdictions do not allow the exclusion or limitation of incidental or
+  consequential damages, so this exclusion and limitation may not apply to You.
+
+  9) Acceptance and Termination. If You distribute copies of the Original Work or
+  a Derivative Work, You must make a reasonable effort under the circumstances to
+  obtain the express assent of recipients to the terms of this License. Nothing
+  else but this License (or another written agreement between Licensor and You)
+  grants You permission to create Derivative Works based upon the Original Work
+  or to exercise any of the rights granted in Section 1 herein, and any attempt
+  to do so except under the terms of this License (or another written agreement
+  between Licensor and You) is expressly prohibited by U.S. copyright law, the
+  equivalent laws of other countries, and by international treaty. Therefore, by
+  exercising any of the rights granted to You in Section 1 herein, You indicate
+  Your acceptance of this License and all of its terms and conditions.
+
+  10) Termination for Patent Action. This License shall terminate automatically
+  and You may no longer exercise any of the rights granted to You by this License
+  as of the date You commence an action, including a cross-claim or counterclaim,
+  for patent infringement (i) against Licensor with respect to a patent
+  applicable to software or (ii) against any entity with respect to a patent
+  applicable to the Original Work (but excluding combinations of the Original
+  Work with other software or hardware).
+
+  11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
+  License may be brought only in the courts of a jurisdiction wherein the
+  Licensor resides or in which Licensor conducts its primary business, and under
+  the laws of that jurisdiction excluding its conflict-of-law provisions. The
+  application of the United Nations Convention on Contracts for the International
+  Sale of Goods is expressly excluded. Any use of the Original Work outside the
+  scope of this License or after its termination shall be subject to the
+  requirements and penalties of the U.S. Copyright Act, 17 U.S.C. 101 et seq.,
+  the equivalent laws of other countries, and international treaty. This section
+  shall survive the termination of this License.
+
+  12) Attorneys Fees. In any action to enfor