Import Cobalt 17.180626

Includes the following patches:
  https://cobalt-review.googlesource.com/c/cobalt/+/4410
    by errong.leng@samsung.com
  https://cobalt-review.googlesource.com/c/cobalt/+/4510
    by errong.leng@samsung.com

Change-Id: I1b004854c73122c6b5ebb18b079be72a278fc837
diff --git a/src/cobalt/CHANGELOG.md b/src/cobalt/CHANGELOG.md
index 59b3927..559a14b 100644
--- a/src/cobalt/CHANGELOG.md
+++ b/src/cobalt/CHANGELOG.md
@@ -3,6 +3,11 @@
 This document records all notable changes made to Cobalt since the last release.
 
 ## Version 17
+ - **Add support for animated WebP images with transparency**
+
+   This was not originally supported by Cobalt, and any prior use of animated
+   WebP with transparency would have resulted in visual artifacts.
+
  - **Improvements and Bug Fixes**
    - Fix pointer/mouse events not being dispatched to JavaScript in the same
      order that they are generated by Starboard, relative to other input events
@@ -16,6 +21,17 @@
    migrated to the new format the next time Cobalt is launched.
    The schema is available at cobalt/storage/store/storage.proto.
 
+ - **IPv4 Preference**
+
+   Cobalt is now configured to prefer an IPv4 address to IPv6 addresses when
+   choosing an initial server address from DNS responses. That is, if a
+   DNS response contains both IPv4 addresses and IPv6 addresses, Cobalt will
+   now explicitly attempt to connect an IPv4 address before possibly moving onto
+   IPv6 on connect failures. Unfortunately, we've discovered common scenarios
+   where IPv6 addresses were listed in DNS responses but intervening network
+   configurations prevented IPv6 use after connect time. This caused the
+   previous implementation to appear as if no network was available.
+
 ## Version 16
  - **Rebase libwebp to version 1.0.0**
 
diff --git a/src/cobalt/audio/audio_buffer.h b/src/cobalt/audio/audio_buffer.h
index f69d262..ebec826 100644
--- a/src/cobalt/audio/audio_buffer.h
+++ b/src/cobalt/audio/audio_buffer.h
@@ -20,8 +20,6 @@
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"  // For scoped_array
 #include "cobalt/audio/audio_helpers.h"
-#include "cobalt/dom/float32_array.h"
-#include "cobalt/dom/int16_array.h"
 #include "cobalt/script/environment_settings.h"
 #include "cobalt/script/wrappable.h"
 
diff --git a/src/cobalt/audio/audio_context.cc b/src/cobalt/audio/audio_context.cc
index dccd821..737b024 100644
--- a/src/cobalt/audio/audio_context.cc
+++ b/src/cobalt/audio/audio_context.cc
@@ -62,7 +62,7 @@
 
 void AudioContext::DecodeAudioData(
     script::EnvironmentSettings* settings,
-    const scoped_refptr<dom::ArrayBuffer>& audio_data,
+    const script::Handle<script::ArrayBuffer>& audio_data,
     const DecodeSuccessCallbackArg& success_handler) {
   DCHECK(main_message_loop_->BelongsToCurrentThread());
 
@@ -73,7 +73,7 @@
 
 void AudioContext::DecodeAudioData(
     script::EnvironmentSettings* settings,
-    const scoped_refptr<dom::ArrayBuffer>& audio_data,
+    const script::Handle<script::ArrayBuffer>& audio_data,
     const DecodeSuccessCallbackArg& success_handler,
     const DecodeErrorCallbackArg& error_handler) {
   DCHECK(main_message_loop_->BelongsToCurrentThread());
@@ -90,13 +90,14 @@
   const int callback_id = next_callback_id_++;
   CHECK(pending_decode_callbacks_.find(callback_id) ==
         pending_decode_callbacks_.end());
-  const scoped_refptr<dom::ArrayBuffer>& audio_data = info->audio_data;
+  script::Handle<script::ArrayBuffer> audio_data =
+      script::Handle<script::ArrayBuffer>(info->audio_data_reference);
   pending_decode_callbacks_[callback_id] = info.release();
 
   AsyncAudioDecoder::DecodeFinishCallback decode_callback = base::Bind(
       &AudioContext::DecodeFinish, base::Unretained(this), callback_id);
-  audio_decoder_.AsyncDecode(audio_data->data(), audio_data->byte_length(),
-                             decode_callback);
+  audio_decoder_.AsyncDecode(static_cast<const uint8*>(audio_data->Data()),
+                             audio_data->ByteLength(), decode_callback);
 }
 
 // Success callback and error callback should be scheduled to run on the main
diff --git a/src/cobalt/audio/audio_context.h b/src/cobalt/audio/audio_context.h
index ab34490..6410c58 100644
--- a/src/cobalt/audio/audio_context.h
+++ b/src/cobalt/audio/audio_context.h
@@ -28,9 +28,9 @@
 #include "cobalt/audio/audio_buffer_source_node.h"
 #include "cobalt/audio/audio_destination_node.h"
 #include "cobalt/audio/audio_helpers.h"
-#include "cobalt/dom/array_buffer.h"
 #include "cobalt/dom/dom_exception.h"
 #include "cobalt/dom/event_target.h"
+#include "cobalt/script/array_buffer.h"
 #include "cobalt/script/callback_function.h"
 #include "cobalt/script/environment_settings.h"
 #include "cobalt/script/script_value.h"
@@ -118,10 +118,10 @@
   // attribute after setting the responseType to "arraybuffer". Audio file data
   // can be in any of the formats supported by the audio element.
   void DecodeAudioData(script::EnvironmentSettings* settings,
-                       const scoped_refptr<dom::ArrayBuffer>& audio_data,
+                       const script::Handle<script::ArrayBuffer>& audio_data,
                        const DecodeSuccessCallbackArg& success_handler);
   void DecodeAudioData(script::EnvironmentSettings* settings,
-                       const scoped_refptr<dom::ArrayBuffer>& audio_data,
+                       const script::Handle<script::ArrayBuffer>& audio_data,
                        const DecodeSuccessCallbackArg& success_handler,
                        const DecodeErrorCallbackArg& error_handler);
 
@@ -136,26 +136,26 @@
  private:
   struct DecodeCallbackInfo {
     DecodeCallbackInfo(script::EnvironmentSettings* settings,
-                       const scoped_refptr<dom::ArrayBuffer>& data,
+                       const script::Handle<script::ArrayBuffer>& data_handle,
                        AudioContext* const audio_context,
                        const DecodeSuccessCallbackArg& success_handler)
         : env_settings(settings),
-          audio_data(data),
+          audio_data_reference(audio_context, data_handle),
           success_callback(audio_context, success_handler) {}
 
     DecodeCallbackInfo(script::EnvironmentSettings* settings,
-                       const scoped_refptr<dom::ArrayBuffer>& data,
+                       const script::Handle<script::ArrayBuffer>& data_handle,
                        AudioContext* const audio_context,
                        const DecodeSuccessCallbackArg& success_handler,
                        const DecodeErrorCallbackArg& error_handler)
         : env_settings(settings),
-          audio_data(data),
+          audio_data_reference(audio_context, data_handle),
           success_callback(audio_context, success_handler) {
       error_callback.emplace(audio_context, error_handler);
     }
 
     script::EnvironmentSettings* env_settings;
-    const scoped_refptr<dom::ArrayBuffer>& audio_data;
+    script::ScriptValue<script::ArrayBuffer>::Reference audio_data_reference;
     DecodeSuccessCallbackReference success_callback;
     base::optional<DecodeErrorCallbackReference> error_callback;
   };
diff --git a/src/cobalt/base/tokens.h b/src/cobalt/base/tokens.h
index 32f9c55..334a020 100644
--- a/src/cobalt/base/tokens.h
+++ b/src/cobalt/base/tokens.h
@@ -119,6 +119,7 @@
     MacroOpWithNameOnly(sourceended)                                 \
     MacroOpWithNameOnly(sourceopen)                                  \
     MacroOpWithNameOnly(start)                                       \
+    MacroOpWithNameOnly(stop)                                        \
     MacroOpWithNameOnly(storage)                                     \
     MacroOpWithNameOnly(stalled)                                     \
     MacroOpWithNameOnly(suspend)                                     \
diff --git a/src/cobalt/bindings/README.md b/src/cobalt/bindings/README.md
new file mode 100644
index 0000000..d276dc4
--- /dev/null
+++ b/src/cobalt/bindings/README.md
@@ -0,0 +1,169 @@
+# Script/bindings in depth
+
+Bindings is the bridge that allows client JavaScript code to read/modify DOM objects.  In order to better understand what this means, let's start with a simple example from the [V8 embedder's guide](https://github.com/v8/v8/wiki/Embedder%27s-Guide), and build up to Cobalt bindings in their entirety.
+
+Suppose we are working with a native application that deals with `Point` structure, representing two coordinates as integers.  Now suppose that we also wanted to allow for the application to be scripted in JavaScript, meaning that JavaScript code is capable of manipulating our project specific `Point` struct.
+
+
+```
+struct Point {
+  int x;
+  int y;
+};
+```
+
+
+This is accomplished by using embedder only native APIs to both
+
+
+
+*   Allow JavaScript objects to represent `Point`s, by putting a pointer to the `Point` an object represents inside of a native-only internal field.
+*   Register native functions with the JavaScript engine to say "when JavaScript code does this, instead of doing what you normally do, call this function".
+
+In V8, this would look something like:
+
+
+```
+Local<ObjectTemplate> point_template = ObjectTemplate::New(isolate);
+point_template->SetInternalFieldCount(1);
+point_template.SetAccessor(String::NewFromUtf8(isolate, "x"), GetPointX, SetPointX);
+point_template.SetAccessor(String::NewFromUtf8(isolate, "y"), GetPointY, SetPointY);
+
+Point* p = new Point{0, 0};
+Local<Object> obj = point_template->NewInstance();
+obj->SetInternalField(0, External::New(isolate, p));
+
+void GetPointX(Local<String> property,
+               const PropertyCallbackInfo<Value>& info) {
+  Local<Object> self = info.Holder();
+  Local<External> wrap = Local<External>::Cast(self->GetInternalField(0));
+  void* ptr = wrap->Value();
+  int value = static_cast<Point*>(ptr)->x;
+  info.GetReturnValue().Set(value);
+}
+// void GetPointY(...
+```
+
+
+In the above example, we first create an `ObjectTemplate`.  This is a structure that can later be fed into V8 that lets it know the "native shape" of the point object.  In particular, the `SetAccessor` lines are the ones that tell it to call into our `GetPointX` function when the property "x" is accessed on a point object.  After V8 calls into the `GetPointX` function, we find the associated native `Point` object, get its x field, convert that value to a JavaScript integer, and then pass that back to JavaScript as the return value.  Note that in SpiderMonkey this process is conceptually identical to V8, however with slightly different APIs.
+
+That pattern, of intercept, convert from JavaScript to native, perform native operations, and then convert the native result back to JavaScript, is the essence of bindings.  Of course, it is far more complicated, in that there are many different types, and more operations that must be performed.  It is important however, to keep this general pattern in mind.
+
+# Scaling up to full Cobalt bindings
+
+How do we scale up from what we saw before into full Cobalt bindings?  The first problem that must be addressed is what should be exposed to JavaScript within each target.  Instead of manually writing an ObjectTemplate for each object we want to expose to JavaScript, we write an [IDL file](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/dom/document.idl?q=document%5C.idl&sq=package:%5Ecobalt$&dr).  Then, these [IDL files](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/browser/browser_bindings_gen.gyp?q=browser_bindings_gen&sq=package:%5Ecobalt$&dr#32) are collected by the [IDL compiler](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/idl_compiler_cobalt.py?q=idl_compiler&sq=package:%5Ecobalt$&dr=C#17), and then combined with a [jinja2 template file](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/v8c/templates/interface.cc.template?q=interface%5C.cc%5C.template&sq=package:%5Ecobalt$&dr), that will generate [C++ header](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.h?q=v8c_window%5C.h&sq=package:%5Ecobalt$&dr) and [source files](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_window.cc?q=v8c_window%5C.cc&sq=package:%5Ecobalt$&g=0#1) for each IDL.
+
+The jinja2 template file is responsible for
+
+
+
+*   [Providing access to the interface object itself](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/v8c/templates/interface.cc.template?q=interface%5C.cc%5C.template&sq=package:%5Ecobalt$&dr#866).
+*   [Providing a function that creates Wrappers from a Wrappable](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/v8c/templates/interface.cc.template?q=interface%5C.cc%5C.template&sq=package:%5Ecobalt$&dr#844).
+*   [Providing enum conversion functions](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/v8c/templates/interface.cc.template?q=interface%5C.cc%5C.template&sq=package:%5Ecobalt$&dr#939).
+*   [Implementing and setting up interceptors if necessary](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/v8c/templates/interface.cc.template?q=interface%5C.cc%5C.template&sq=package:%5Ecobalt$&dr#102).
+*   [Possibly implementing and attaching a constructor](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/v8c/templates/interface.cc.template?q=interface%5C.cc%5C.template&sq=package:%5Ecobalt$&dr#353), [which might have to also handle overloads](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/v8c/templates/macros.cc.template?q=macros%5C.cc%5C.template&sq=package:%5Ecobalt$&dr#357).
+*   [Attaching attributes and functions to either the interface object, the object prototype, or object instances](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/v8c/templates/interface.cc.template?q=interface%5C.cc%5C.template&sq=package:%5Ecobalt$&dr#382).
+*   [Rejecting edge case scenarios in which bindings functions are called on non-platform objects](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/v8c/templates/macros.cc.template?q=macros%5C.cc%5C.template&sq=package:%5Ecobalt$&dr#20).
+*   [Stringification](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/v8c/templates/interface.cc.template?q=interface%5C.cc%5C.template&sq=package:%5Ecobalt$&dr#463) (a concept [defined by Web IDL](https://heycam.github.io/webidl/#idl-stringifiers)).
+*   [Initialization](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/v8c/templates/interface.cc.template?q=interface%5C.cc%5C.template&sq=package:%5Ecobalt$&dr#876).
+*   [Web IDL interface inheritance](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/v8c/templates/interface.cc.template?q=interface%5C.cc%5C.template&sq=package:%5Ecobalt$&dr#548).
+
+The details behind each of these responsibilities are discussed in the [Web IDL](https://heycam.github.io/webidl/) spec, which has opinions on how to map Web IDL defined concepts that you see in the IDL files, to precise language bindings behavior.  [The first section](https://heycam.github.io/webidl/#idl) discusses this mapping without a particular language in mind, however thankfully after that there is a [section about ECMAScript bindings](https://heycam.github.io/webidl/#ecmascript-binding) in particular.
+
+The majority of the template file is about translating what the spec says in the ECMAScript bindings section of that spec, and calling the appropriate native APIs given a particular interface context.  So for example, when we see
+
+
+```
+// document.idl
+// ...
+  HTMLCollection getElementsByTagName(DOMString localName);
+// ...
+```
+
+
+in an idl file, our IDL compiler will render the jinja template (relevant sections shown below)
+
+
+```
+// interface.cc.template
+// …
+{%- for operation in operations + static_operations %}
+void {{operation.idl_name}}{{overload.overload_index}}(
+    const v8::FunctionCallbackInfo<v8::Value>& info) {
+{{ function_implementation(overload) -}}
+}
+{% macro function_implementation(operation) %}
+  v8::Isolate* isolate = info.GetIsolate();
+{% if operation.is_static %}
+{{ static_function_prologue() }}
+// ...
+{% for operation in operations + static_operations %}
+v8::Local<v8::String> name = NewInternalString(isolate, "{{operation.idl_name}}");
+v8::Local<v8::FunctionTemplate> method_template = v8::FunctionTemplate::New(isolate,
+    {{operation.idl_name}}{{"Static" if operation.is_static else ""}}Method);
+method_template->RemovePrototype();
+method_template->SetLength({{operation.length}});
+{% if operation.is_static %}
+function_template->
+{% elif operation.is_unforgeable or is_global_interface %}
+instance_template->
+{% else %}
+prototype_template->
+{% endif %}
+    Set(name, method_template);
+```
+
+
+and produce the following native code
+
+
+```
+void getElementsByTagNameMethod(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) ||
+      !V8cDocument::GetTemplate(isolate)->HasInstance(object)) {
+    V8cExceptionState exception(isolate);
+    exception.SetSimpleException(script::kDoesNotImplementInterface);
+    return;
+  }
+    // The name of the property is the identifier.
+    v8::Local<v8::String> name = NewInternalString(
+        isolate,
+        "getElementsByTagName");
+    // ...
+```
+
+
+# script/
+
+script/ implements various utility functions, abstraction classes, and wrapper classes that are both used directly by Cobalt, and to support bindings.  The majority of these are either interfaces to abstract over important engine native APIs (such as forcing garbage collection, or getting heap statistics), or interfaces to allow Cobalt to interact with ECMAScript defined types that are implemented by the JavaScript engine, such as promises.
+
+[JavaScriptEngine](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/javascript_engine.h?type=cs&q=JavaScriptEngine&sq=package:%5Ecobalt$&g=0#36) is an abstract isolated instance of the JavaScript engine.  It corresponds directly to the types [JSRuntime](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/third_party/mozjs-45/js/src/vm/Runtime.h?type=cs&q=JSRuntime&sq=package:%5Ecobalt$&g=0#597) and [v8::Isolate](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/v8/include/v8.h?type=cs&q=file:v8+Isolate&sq=package:%5Ecobalt$&g=0#6746).  These types are about everything that has to do with a JavaScript *before* the global object gets involved, so things like the heap, and builtin functions.  As this class owns the JavaScript heap, Cobalt must go through it when Cobalt wants to interact with the JavaScript heap, for things such as [forcing garbage collection](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/javascript_engine.h?type=cs&q=JavaScriptEngine&sq=package:%5Ecobalt$&g=0#64) (which is used to lower memory footprint during suspend), [reporting extra memory usage implied by the engine](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/javascript_engine.h?type=cs&q=JavaScriptEngine&sq=package:%5Ecobalt$&g=0#69) (so for example, when a JavaScript object being alive means that xhr data that lives in native Cobalt buffers is kept alive), and [gathering information about the size of the heap](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/javascript_engine.h?type=cs&q=JavaScriptEngine&sq=package:%5Ecobalt$&g=0#78) (used in APIs such as [window.performance.memory](https://developer.mozilla.org/en-US/docs/Web/API/Window/performance)).  Additionally, having a JavaScriptEngine is a prerequisite for creating a GlobalEnvironment, which is required for JavaScript execution.
+
+[GlobalEnvironment](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/global_environment.h?type=cs&q=GlobalEnvironment&sq=package:%5Ecobalt$&g=0#38) is an abstract JavaScript execution context, which effectively means the [global object](https://www.ecma-international.org/ecma-262/6.0/#sec-global-object) itself, as well as things that are very closely related to the global object (such as script evaluation).  It corresponds to types [JSContext](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/third_party/mozjs-45/js/src/jscntxt.h?type=cs&q=%22struct+JSContext%22&sq=package:%5Ecobalt$&g=0#289) and [v8::Context](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/v8/include/v8.h?type=cs&q=file:v8+Context&sq=package:%5Ecobalt$&g=0#8380).  Also note that in the case of Cobalt, there is only one GlobalEnvironment per JavaScriptEngine, because we don't support features that would require two (such as iframes).  Cobalt will use this class when it wants to do things such as [evaluate scripts](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/global_environment.h?q=GlobalEnvironment&sq=package:%5Ecobalt$&dr=CSs#68), inspect execution state (such as [getting a stack trace](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/global_environment.h?q=GlobalEnvironment&sq=package:%5Ecobalt$&dr=CSs#76)), or [interact with garbage collection](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/global_environment.h?q=GlobalEnvironment&sq=package:%5Ecobalt$&dr=CSs#89).  Implementations of this class are also responsible for setting up the global environment
+
+Additionally, it contains interfaces for JavaScript (both ES6 and Web IDL) types that Cobalt DOM code needs to interact with, such as [array buffers](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/array_buffer.h?q=array_buffer%5C.h&sq=package:%5Ecobalt$&dr), [callback functions](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/callback_function.h?sq=package:%5Ecobalt$&dr&g=0), and [promises](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/promise.h?sq=package:%5Ecobalt$&dr&g=0).  One worthy of special attention is [ValueHandle](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/value_handle.h?sq=package:%5Ecobalt$&dr&g=0), which represents an opaque JavaScript value (that could be anything), which can be used when interactions with an object is not the goal, but rather just holding onto it, and then likely passing it to someone else.
+
+Each of these JavaScript value interface types when used by Cobalt must get held in a special wrapper type, called [ScriptValue](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/script_value.h?q=ScriptValue&sq=package:%5Ecobalt$&dr=CSs#50).  ScriptValue provides a common type to feed into additional ScriptValue wrapper types ([ScriptValue::Reference](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/script_value.h?q=ScriptValue&sq=package:%5Ecobalt$&dr=CSs#59) and [script::Handle](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/script_value.h?q=ScriptValue&sq=package:%5Ecobalt$&dr=CSs#144)), that manage the lifetime of the underlying JavaScript value held in the ScriptValue.  This is done because the JavaScript object itself is owned by the JavaScript engine, so management of its lifetime must be done through the native engine APIs, however Cobalt cannot access those directly.
+
+# script/$engine
+
+Then, we designate a specific area of code to be our engine specific implementation of the interfaces established in script.  We [commit to an engine at gyp time](https://cs.corp.google.com/cobalt/starboard/build/platform_configuration.py?type=cs&q=file:py+%27javascript_engine%27&sq=package:%5Ecobalt$&g=0#223), and then based on that, [select the appropriate set of files](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/engine.gyp?type=cs&q=file:cobalt+file:gyp+javascript_engine&sq=package:%5Ecobalt$&g=0#26).  This is the only area of Cobalt code (except for bindings/*/$engine, which is essentially more of the same stuff) that is allowed to include engine specific headers (files in v8/ and third_party/mozjs-45/).  Maintaining this abstraction has been useful throughout our multiple JavaScript engine migrations over the years.
+
+A large portion of script/$engine is filling in the types discussed in the previous section.  So [V8cEngine](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/v8c/v8c_engine.h?q=V8cEngine&sq=package:%5Ecobalt$&dr=CSs#31) implements JavaScriptEngine by wrapping a v8::Isolate, and [V8cGlobalEnvironment](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/v8c/v8c_global_environment.h?type=cs&q=V8cGlobalEnvironment&sq=package:%5Ecobalt$&g=0#44) implements GlobalEnvironment by wrapping a v8::Context.  Note that these files are actually quite a bit bigger than just being thin wrappers over the V8 types, as they have more work to do in addition to just implementing their script interfaces, such as [maintaining state necessary for bindings](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/v8c/v8c_global_environment.h?type=cs&q=V8cGlobalEnvironment&sq=package:%5Ecobalt$&g=0#175) (interface objects need to be owned somewhere), [serving as a bridge between the Isolate](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/v8c/v8c_global_environment.h?type=cs&q=V8cGlobalEnvironment&sq=package:%5Ecobalt$&g=0#49), and [dealing with garbage collection interaction](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/v8c/v8c_engine.h?q=V8cEngine&sq=package:%5Ecobalt$&dr=CSs#61) (the engine specific [script::Tracer](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/tracer.h?type=cs&q=script::Tracer&sq=package:%5Ecobalt$&g=0#54) is implemented near them).
+
+JavaScript value interface type implementations follow the pattern of creating a concrete [implementation that wraps an appropriate v8::Value](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/v8c/native_promise.h?q=native_promise&sq=package:%5Ecobalt$&dr=CSs#45).  They will also typically have a Create function if it makes sense to build them in Cobalt.  In the case where they don't have a Create function (such as ValueHandle), the only way to gain access to one in Cobalt is to receive it from bindings code.
+
+Another important area in this module are utility functions that exist solely for bindings.  In particular, in the [conversion helpers](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/v8c/conversion_helpers.h?q=conversion_helpers&sq=package:%5Ecobalt$&dr=CSs) are implemented here, which is a giant file that implements functions to convert back and forth between native Cobalt types and JavaScript values.  These conversion helper functions get called in the native callback implementation for the getters, setters, and functions that we saw at the beginning of this doc (so the stuff that would go inside of GetPointX).  Because these conversion helpers primarily exist for parts of bindings defined by Web IDL, they're on the more complex side (because Web IDL allows for many conversion details to be configurable, such as whether null objects are accepted, or whether integral types should be clamped or not), however they are also used throughout common script/ when it makes sense.
+
+Finally, another critical thing that takes place in script/$engine is what we call [WrapperPrivate](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/script/v8c/wrapper_private.h?type=cs&q=WrapperPrivate&sq=package:%5Ecobalt$&g=0#31) (in both SpiderMonkey and V8).  This is the special type that goes inside of the native only internal object field that was discussed in the beginning of this doc.  WrapperPrivate is a bit more complicated however, as it has to both bridge between Cobalt DOM garbage collection and the JavaScript engine's garbage collection for more details on this), and allow for Cobalt to possibly manipulate garbage collection from the JavaScript side as well (as in add JavaScript objects to the root set of reachable objects).
+
+# Testing
+
+Bindings test is tested in isolation via the bindings_test target.  Because bindings is the bridge from the JavaScript engine to the DOM, bindings test works by having an [entirely separate set of IDL](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/testing/testing.gyp?type=cs&sq=package:%5Ecobalt$&g=0#27) files that contain [minimal internal logic](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/testing/arbitrary_interface.h?q=arbitrary_interface&sq=package:%5Ecobalt$&dr=CSs#27), and are meant to [stress Web IDL features](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/bindings/testing/numeric_types_test_interface.idl?sq=package:%5Ecobalt$&dr=CSs&g=0).  This is accomplished by parameterizing what IDL files should get compiled at gyp time.  All other parts of the bindings build pipeline (such as the IDL compiler and jinja templates) are shared between bindings_test and cobalt entirely.  Note that bindings_test lives above the script/ interface, so no engine specific APIs can be used within the tests.
+
+Additionally, when it is convenient to implement a test entirely within JavaScript, certain script/ and bindings/ features are tested within layout_tests and web_platform_tests (see for example, [platform-object-user-properties-survive-gc.html](https://cobalt.googlesource.com/cobalt/+/2a8c847d785c1602f60915c8e0112e0aec6a15a5/src/cobalt/layout_tests/testdata/cobalt/platform-object-user-properties-survive-gc.html?type=cs&q=platform-object-user&sq=package:%5Ecobalt$&g=0#1)).  These serve as higher level, more end-to-end tests, that are good for testing more complex examples that also involve Cobalt's usage of script/.
+
diff --git a/src/cobalt/bindings/contexts.py b/src/cobalt/bindings/contexts.py
index 690189a..925eb78 100644
--- a/src/cobalt/bindings/contexts.py
+++ b/src/cobalt/bindings/contexts.py
@@ -52,6 +52,10 @@
   return isinstance(idl_type, IdlPromiseType)
 
 
+def is_array_buffer_or_view_type(idl_type):
+  return idl_type.is_array_buffer_or_view_type
+
+
 def idl_literal_to_cobalt_literal(idl_type, idl_literal):
   """Map IDL literal to the corresponding cobalt value."""
   if idl_literal.is_null and not idl_type.is_interface_type:
@@ -112,16 +116,17 @@
   Args:
     idl_type: An idl_types.IdlType object.
 
-  The Cobalt type for interfaces and callback functions are scoped_refptr, so
-  they can already be assigned a NULL value. Other types, such as primitives,
-  strings, and unions, need to be wrapped by base::optional<>, in which case
-  the IDL null value will map to base::nullopt_t.
+  The Cobalt type for interfaces and callback functions are scoped_refptr or
+  script::Handle, so they can already be assigned a NULL value. Other types,
+  such as primitives, strings, and unions, need to be wrapped by
+  base::optional<>, in which case the IDL null value will map to
+  base::nullopt_t.
   """
 
   # These never need base::optional<>
   if (idl_type.is_interface_type or idl_type.is_callback_function or
       idl_type.is_callback_interface or is_object_type(idl_type) or
-      is_any_type(idl_type)):
+      is_any_type(idl_type) or is_array_buffer_or_view_type(idl_type)):
     return False
 
   # We consider a union type to be nullable if either the entire union is
@@ -245,7 +250,15 @@
       else:
         flattened_types.append(member)
 
-    cobalt_types = [self.idl_type_to_cobalt_type(t) for t in flattened_types]
+    cobalt_types = []
+    for flattened_type in flattened_types:
+      cobalt_type = self.idl_type_to_cobalt_type(flattened_type)
+      # Some member types need to be wrapped with ScriptValue::Handle.
+      if is_any_type(flattened_type) or is_array_buffer_or_view_type(
+          flattened_type):
+        cobalt_type = '::cobalt::script::Handle<{}>'.format(cobalt_type)
+      cobalt_types.append(cobalt_type)
+
     return '::cobalt::script::UnionType%d<%s >' % (len(cobalt_types),
                                                    ', '.join(cobalt_types))
 
@@ -280,7 +293,8 @@
       cobalt_type = get_interface_name(idl_type)
     elif is_promise_type(idl_type):
       cobalt_type = '::cobalt::script::NativePromise'
-
+    elif is_array_buffer_or_view_type(idl_type):
+      cobalt_type = '::cobalt::script::{}'.format(idl_type.base_type)
     assert cobalt_type, 'Unsupported idl_type %s' % idl_type
 
     if cobalt_type_is_optional(idl_type):
@@ -307,9 +321,9 @@
     if (idl_type.is_callback_function or idl_type.is_object_type or
         idl_type.is_callback_interface):
       return base_type + '*'
-    if is_any_type(idl_type):
+    if is_any_type(idl_type) or is_array_buffer_or_view_type(idl_type):
       return 'const ::cobalt::script::ScriptValue<%s>*' % base_type
-    if idl_type.is_string_type or idl_type.is_interface_type:
+    elif idl_type.is_string_type or idl_type.is_interface_type:
       return 'const %s&' % base_type
     return base_type
 
@@ -459,9 +473,8 @@
 
   def attribute_context(self, interface, attribute, definitions):
     """Create template values for attribute bindings."""
-    cobalt_name = attribute.extended_attributes.get('ImplementedAs',
-                                                    convert_to_cobalt_name(
-                                                        attribute.name))
+    cobalt_name = attribute.extended_attributes.get(
+        'ImplementedAs', convert_to_cobalt_name(attribute.name))
     context = {
         'idl_name':
             attribute.name,
@@ -639,7 +652,8 @@
         'name':
             convert_to_cobalt_name(dictionary_member.name),
         'is_script_value':
-            is_any_type(dictionary_member.idl_type),
+            is_any_type(dictionary_member.idl_type)
+            or is_array_buffer_or_view_type(dictionary_member.idl_type),
         'idl_name':
             dictionary_member.name,
         'type':
diff --git a/src/cobalt/bindings/expression_generator.py b/src/cobalt/bindings/expression_generator.py
index 7bc2e28..f32a7b5 100644
--- a/src/cobalt/bindings/expression_generator.py
+++ b/src/cobalt/bindings/expression_generator.py
@@ -39,3 +39,7 @@
   @abc.abstractmethod
   def inherits_interface(self, interface_name, arg):
     pass
+
+  @abc.abstractmethod
+  def is_type(self, arg):
+    pass
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 78e7e1a..88e2fb1 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
@@ -23,8 +23,11 @@
 #include <string>
 
 #include "base/optional.h"
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/script_value.h"
 #include "cobalt/script/sequence.h"
+#include "cobalt/script/typed_arrays.h"
 #include "cobalt/script/value_handle.h"
 #include "cobalt/bindings/testing/test_dictionary.h"
 
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 5b2ce57..e81cf8e 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
@@ -23,8 +23,11 @@
 #include <string>
 
 #include "base/optional.h"
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/script_value.h"
 #include "cobalt/script/sequence.h"
+#include "cobalt/script/typed_arrays.h"
 #include "cobalt/script/value_handle.h"
 #include "cobalt/bindings/testing/test_dictionary.h"
 
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 195c255..5a12192 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -466,6 +470,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 b8dcd0c..9b8b439 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -414,6 +418,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 5440df3..266632c 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -565,6 +569,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 62edaad..15ea855 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -475,6 +479,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 5a2159e..fc59ecd 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -423,6 +427,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 717325e..48df13b 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -545,6 +549,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 d27a9aa..43011a7 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
@@ -35,10 +35,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -871,6 +875,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 93ed68d..856182c 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
@@ -35,10 +35,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -543,6 +547,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 6786eb6..26e8e17 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
@@ -40,10 +40,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -650,6 +654,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 4f0a731..00c559a 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -378,6 +382,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 be520b3..8b44cfc 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -319,6 +323,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 5dea92b..7fa1917 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -481,6 +485,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 c2704b8..80a70f0 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -387,6 +391,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 c6b64dd..3ee249e 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
@@ -35,10 +35,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -884,6 +888,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 f90a539..d04d3e5 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
@@ -35,10 +35,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -432,6 +436,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 bce080c..844499c 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
@@ -36,10 +36,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -631,6 +635,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 f3f9986..41abd04 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
@@ -40,10 +40,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -478,6 +482,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 ad7378f..ea0b20d 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -847,6 +851,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 2bf155e..82eee09 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
@@ -34,10 +34,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -493,6 +497,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 2853596..5f1ef4f 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -427,6 +431,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 55475f2..71b61aa 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -475,6 +479,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 a9f4c6a..3cfd303 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -541,6 +545,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 3d4bc35..bb07630 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
@@ -35,10 +35,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -535,6 +539,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 fd8827a..e99dafb 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -365,6 +369,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 0b3c64e..e4caa3f 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -704,6 +708,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 7267dd6..af5f9ba 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -443,6 +447,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 81cc7f8..6176c91 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -555,6 +559,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 5b256be..907e2f1 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -443,6 +447,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 07233d6..1c3ae2e 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -369,6 +373,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 f57483d..57a48f9 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -319,6 +323,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 7ec66d7..afd0b99 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -652,6 +656,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 6761bbb..5cc4199 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -1029,6 +1033,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 97e295f..a5f733f 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
@@ -35,10 +35,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -447,6 +451,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 183514f..b84a4f2 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -315,6 +319,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 582d177..719e6f9 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -270,6 +274,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 59de7cd..7da09c9 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
@@ -35,10 +35,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -1239,6 +1243,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 db32800..2d38beb 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -3463,6 +3467,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 6e6e15c..2f8d611 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
@@ -39,10 +39,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -699,6 +703,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 85259f0..d86323e 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
@@ -35,10 +35,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -1873,6 +1877,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 cd5df8a..55f261e 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -589,6 +593,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 70819d5..c6f871d 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
@@ -35,10 +35,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -506,6 +510,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 1c5fed2..63ee382 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
@@ -35,10 +35,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -1191,6 +1195,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 0cb7128..2b1c957 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
@@ -35,10 +35,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -627,6 +631,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 1aa7cec..e5e733c 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -375,6 +379,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 fce9bd1..7aca724 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -481,6 +485,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 0373f11..13ebc08 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -431,6 +435,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 f361b59..770637d 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
@@ -33,10 +33,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -415,6 +419,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
diff --git a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_test_dictionary.cc b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_test_dictionary.cc
index 8d3599b..04c1d91 100644
--- a/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_test_dictionary.cc
+++ b/src/cobalt/bindings/generated/mozjs45/testing/cobalt/bindings/testing/mozjs_test_dictionary.cc
@@ -336,7 +336,7 @@
     return;
   }
   if (!any_member_with_default.isUndefined()) {
-    TypeTraits<::cobalt::script::ValueHandle >::ConversionType converted_value;
+    TypeTraits<::cobalt::script::ValueHandle>::ConversionType converted_value;
     FromJSValue(context,
                 any_member_with_default,
                 kNoConversionFlags,
@@ -355,7 +355,7 @@
     return;
   }
   if (!any_member.isUndefined()) {
-    TypeTraits<::cobalt::script::ValueHandle >::ConversionType converted_value;
+    TypeTraits<::cobalt::script::ValueHandle>::ConversionType converted_value;
     FromJSValue(context,
                 any_member,
                 kNoConversionFlags,
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 59b9b49..df8487f 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
@@ -37,10 +37,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -747,6 +751,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
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 4507ed8..662830d 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
@@ -135,10 +135,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.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 b60f6c3..0ca401d 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
@@ -23,8 +23,11 @@
 #include <string>
 
 #include "base/optional.h"
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/script_value.h"
 #include "cobalt/script/sequence.h"
+#include "cobalt/script/typed_arrays.h"
 #include "cobalt/script/value_handle.h"
 #include "cobalt/bindings/testing/arbitrary_interface.h"
 
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 78e7e1a..88e2fb1 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
@@ -23,8 +23,11 @@
 #include <string>
 
 #include "base/optional.h"
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/script_value.h"
 #include "cobalt/script/sequence.h"
+#include "cobalt/script/typed_arrays.h"
 #include "cobalt/script/value_handle.h"
 #include "cobalt/bindings/testing/test_dictionary.h"
 
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 5b2ce57..e81cf8e 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
@@ -23,8 +23,11 @@
 #include <string>
 
 #include "base/optional.h"
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/script_value.h"
 #include "cobalt/script/sequence.h"
+#include "cobalt/script/typed_arrays.h"
 #include "cobalt/script/value_handle.h"
 #include "cobalt/bindings/testing/test_dictionary.h"
 
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 b60f6c3..0ca401d 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
@@ -23,8 +23,11 @@
 #include <string>
 
 #include "base/optional.h"
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/script_value.h"
 #include "cobalt/script/sequence.h"
+#include "cobalt/script/typed_arrays.h"
 #include "cobalt/script/value_handle.h"
 #include "cobalt/bindings/testing/arbitrary_interface.h"
 
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 b529fa5..abd6e10 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 9f59bcd..3daeb76 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 904b470..9758d12 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 9439609..0915ed5 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 5dc0a30..be9d04b 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 fdfd3e5..a6d0339 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 0cbf4e8..7ebab98 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
@@ -32,12 +32,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 d9a7bff..06107df 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
@@ -32,12 +32,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 eea832e..e9832d2 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
@@ -37,12 +37,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 47be197..13b8f96 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 a1621a5..974ac9e 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 e4d1e89..8346860 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 529f2b1..086313a 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 972fd8e..fd7234d 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
@@ -32,12 +32,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 bc4610d..547d1ba 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
@@ -32,12 +32,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 578780f..10e32cb 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
@@ -33,12 +33,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 763c975..912ae1e 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
@@ -37,12 +37,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 1fc563d..43780cb 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 dbf37ec..31295e1 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
@@ -31,12 +31,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 925043b..c578c83 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 ea6e41c..1e06d59 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 bb636bd..16f545d 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 7f8db74..e2cf70a 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
@@ -32,12 +32,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 b066935..11d8227 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 1070633..e633249 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 f102817..3c90911 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 ce204d7..f356c6c 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 c94f599..626eb7d 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 77bf07f..d0166b6 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 7587b51..62d4f50 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 c7449e4..d2b77ba 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 6e0b586..ed010c2 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 ff2343f..feee289 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
@@ -32,12 +32,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 98f95c6..4ccd2c0 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 dc8ff25..3336500 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 b469eef..23172c4 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
@@ -32,12 +32,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 4bb1e6d..2363ead 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 9d91f69..a06b469 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
@@ -36,12 +36,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 9ce6bff..30f835d 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
@@ -32,12 +32,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 29232f0..bed41bb 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 cbfc0dc..e7359a0 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
@@ -32,12 +32,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 ce167e9..88a78e6 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
@@ -32,12 +32,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 1eeccff..83fd2b7 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
@@ -32,12 +32,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 0191e97..187f787 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 2f85599..34c4e3e 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 3e88169..d34ecd5 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 8b2a210..ef94036 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
@@ -30,12 +30,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.h"
diff --git a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_test_dictionary.cc b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_test_dictionary.cc
index 67c412d..4eaa821 100644
--- a/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_test_dictionary.cc
+++ b/src/cobalt/bindings/generated/v8c/testing/cobalt/bindings/testing/v8c_test_dictionary.cc
@@ -389,7 +389,7 @@
     }
 
     if (!member_value->IsUndefined()) {
-      TypeTraits<::cobalt::script::ValueHandle >::ConversionType converted_value;
+      TypeTraits<::cobalt::script::ValueHandle>::ConversionType converted_value;
       FromJSValue(isolate,
                   member_value,
                   kNoConversionFlags,
@@ -409,7 +409,7 @@
     }
 
     if (!member_value->IsUndefined()) {
-      TypeTraits<::cobalt::script::ValueHandle >::ConversionType converted_value;
+      TypeTraits<::cobalt::script::ValueHandle>::ConversionType converted_value;
       FromJSValue(isolate,
                   member_value,
                   kNoConversionFlags,
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 48455d9..604213c 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
@@ -34,12 +34,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.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 9865651..354b6bc 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
@@ -132,12 +132,16 @@
 #include "v8c_gen_type_conversion.h"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.h"
diff --git a/src/cobalt/bindings/mozjs45/code_generator_mozjs45.py b/src/cobalt/bindings/mozjs45/code_generator_mozjs45.py
index fc850ea..53c9819 100644
--- a/src/cobalt/bindings/mozjs45/code_generator_mozjs45.py
+++ b/src/cobalt/bindings/mozjs45/code_generator_mozjs45.py
@@ -40,6 +40,10 @@
   def is_number(self, arg):
     return '%s.isNumber()' % arg
 
+  def is_type(self, interface_name, arg):
+    return ('{}.isObject() ? '
+            'JS_Is{}Object(object): false').format(arg, interface_name)
+
 
 class CodeGeneratorMozjs45(CodeGeneratorCobalt):
   """Code generator class for SpiderMonkey45 bindings."""
diff --git a/src/cobalt/bindings/mozjs45/templates/dictionary-conversion.cc.template b/src/cobalt/bindings/mozjs45/templates/dictionary-conversion.cc.template
index 490038c..93234b9 100644
--- a/src/cobalt/bindings/mozjs45/templates/dictionary-conversion.cc.template
+++ b/src/cobalt/bindings/mozjs45/templates/dictionary-conversion.cc.template
@@ -136,7 +136,7 @@
     }
     out_dictionary->set_{{member.name}}(converted_value);
   {% else %}
-    TypeTraits<::cobalt::script::ValueHandle >::ConversionType converted_value;
+    TypeTraits<{{member.type}}>::ConversionType converted_value;
     FromJSValue(context,
                 {{member.name}},
                 {{member.conversion_flags}},
diff --git a/src/cobalt/bindings/mozjs45/templates/interface.cc.template b/src/cobalt/bindings/mozjs45/templates/interface.cc.template
index 1b2fd72..5d957c3 100644
--- a/src/cobalt/bindings/mozjs45/templates/interface.cc.template
+++ b/src/cobalt/bindings/mozjs45/templates/interface.cc.template
@@ -35,10 +35,14 @@
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/mozjs-45/callback_function_conversion.h"
 #include "cobalt/script/mozjs-45/conversion_helpers.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer_view.h"
 #include "cobalt/script/mozjs-45/mozjs_callback_function.h"
+#include "cobalt/script/mozjs-45/mozjs_data_view.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_global_environment.h"
 #include "cobalt/script/mozjs-45/mozjs_property_enumerator.h"
+#include "cobalt/script/mozjs-45/mozjs_typed_arrays.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/mozjs_value_handle.h"
 #include "cobalt/script/mozjs-45/native_promise.h"
@@ -894,6 +898,7 @@
       MozjsGlobalEnvironment::GetFromContext(context)->global_object());
   DCHECK(global_object);
 
+  JSAutoCompartment auto_compartment(context, global_object);
   InterfaceData* interface_data = GetInterfaceData(context);
   JS::RootedObject prototype(context, GetPrototype(context, global_object));
   DCHECK(prototype);
diff --git a/src/cobalt/bindings/overload_context.py b/src/cobalt/bindings/overload_context.py
index 738725a..bb039ca 100644
--- a/src/cobalt/bindings/overload_context.py
+++ b/src/cobalt/bindings/overload_context.py
@@ -192,14 +192,41 @@
     base_type = idl_type.base_type if idl_type.is_nullable else idl_type
     yield partial(expression_generator.inherits_interface, base_type), method
 
-  # 8. Otherwise: if V is any kind of object except for a native Date object,
-  # a native RegExp object, and there is an entry in S that has one of the
-  # following types at position i of its type list,
-  # - an array type
-  # - a sequence type
-  # ...
-  # - a dictionary
-  #
+  # 7. Otherwise: if Type(V) is Object, V has an [[ArrayBuffer]] internal
+  # slot, and there is an entry in S that has one of the following types at
+  # position i of its type list,
+  # - ArrayBuffer
+  # - Object
+  # - A nullable version of either of the above types
+  # - An annotated type whose inner type is one of the above types
+  # - A union type, nullable union type, or annotated union type that has one
+  #   of the above types in its flattened member types
+  # 8. Otherwise: if Type(V) is Object, V has an [[DataView]] internal slot,
+  # and there is an entry in S that has one of the following types at position
+  # i of its type list,
+  # - DataView
+  # - Object
+  # - A nullable version of either of the above types
+  # - An annotated type whose inner type is one of the above types
+  # - A union type, nullable union type, or annotated union type that has one
+  #   of the above types in its flattened member types
+  # 9. Otherwise: if Type(V) is Object, V has an [[TypedArray]] internal slot,
+  # and there is an entry in S that has one of the following types at position
+  # i of its type list,
+  # - A typed array type whose name is equal to the value of V's
+  # [[TypedArrayName]] internal slot
+  # - Object
+  # - A nullable version of either of the above types
+  # - An annotated type whose inner type is one of the above types
+  # - A union type, nullable union type, or annotated union type that has one
+  #   of the above types in its flattened member types
+
+  for idl_type, method in ((idl_type, method)
+                           for idl_type, method in idl_types_methods
+                           if idl_type.is_array_buffer_or_view):
+    base_type = idl_type.base_type if idl_type.is_nullable else idl_type
+    yield partial(expression_generator.is_type, base_type), method
+
   # FIXME:
   # We don't strictly follow the algorithm here. The algorithm says "remove
   # all other entries" if there is "one entry" matching, but we yield all
@@ -208,9 +235,6 @@
   # interface I { ... }
   # (Need to check array types before objects because an array is an object)
   for idl_type, method in idl_types_methods:
-    if idl_type.native_array_element_type:
-      raise NotImplementedError('Array types not yet supported')
-  for idl_type, method in idl_types_methods:
     if idl_type.is_dictionary or idl_type.name == 'Dictionary':
       raise NotImplementedError('Dictionary types not yet supported.')
 
@@ -218,8 +242,8 @@
   # only needed if distinguishing between primitive types.)
   if len([idl_type.is_primitive_type for idl_type in idl_types]) > 1:
     # (Only needed if match in step 11, otherwise redundant.)
-    if any(idl_type.is_string_type or idl_type.is_enum
-           for idl_type in idl_types):
+    if any(
+        idl_type.is_string_type or idl_type.is_enum for idl_type in idl_types):
       # 10. Otherwise: if V is a Number value, and there is an entry in S
       # that has one of the following types at position i of its type
       # list,
diff --git a/src/cobalt/bindings/templates/dictionary.h.template b/src/cobalt/bindings/templates/dictionary.h.template
index 7587c81..cdaf3f1 100644
--- a/src/cobalt/bindings/templates/dictionary.h.template
+++ b/src/cobalt/bindings/templates/dictionary.h.template
@@ -42,8 +42,11 @@
 #include <string>
 
 #include "base/optional.h"
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/script_value.h"
 #include "cobalt/script/sequence.h"
+#include "cobalt/script/typed_arrays.h"
 #include "cobalt/script/value_handle.h"
 {% for include in includes %}
 #include "{{include}}"
diff --git a/src/cobalt/bindings/testing/array_buffers_test.cc b/src/cobalt/bindings/testing/array_buffers_test.cc
index 16c6999..9e58d28 100644
--- a/src/cobalt/bindings/testing/array_buffers_test.cc
+++ b/src/cobalt/bindings/testing/array_buffers_test.cc
@@ -59,23 +59,24 @@
   }
 
   {
-    script::PreallocatedArrayBufferData preallocated_data(256);
-    EXPECT_EQ(256, preallocated_data.byte_length());
-    for (int i = 0; i < preallocated_data.byte_length(); i++) {
-      reinterpret_cast<uint8_t*>(preallocated_data.data())[i] = i;
+    scoped_ptr<script::PreallocatedArrayBufferData> preallocated_data(
+        new script::PreallocatedArrayBufferData(256));
+    EXPECT_EQ(256, preallocated_data->byte_length());
+    for (int i = 0; i < preallocated_data->byte_length(); i++) {
+      reinterpret_cast<uint8_t*>(preallocated_data->data())[i] = i;
     }
 
-    void* data_pointer = preallocated_data.data();
+    void* data_pointer = preallocated_data->data();
 
     auto array_buffer =
-        script::ArrayBuffer::New(global_environment_, &preallocated_data);
+        script::ArrayBuffer::New(global_environment_, preallocated_data.Pass());
     EXPECT_EQ(256, array_buffer->ByteLength());
     EXPECT_EQ(data_pointer, array_buffer->Data());
     for (int i = 0; i < 256; i++) {
       EXPECT_EQ(i, reinterpret_cast<uint8_t*>(array_buffer->Data())[i]);
     }
 
-    EXPECT_EQ(nullptr, preallocated_data.data());
+    EXPECT_EQ(nullptr, preallocated_data.get());
   }
 }
 
diff --git a/src/cobalt/bindings/v8c/code_generator_v8c.py b/src/cobalt/bindings/v8c/code_generator_v8c.py
index c353d62..32f7212 100644
--- a/src/cobalt/bindings/v8c/code_generator_v8c.py
+++ b/src/cobalt/bindings/v8c/code_generator_v8c.py
@@ -39,6 +39,10 @@
   def is_number(self, arg):
     return '{}->IsNumber()'.format(arg)
 
+  def is_type(self, interface_name, arg):
+    return ('{}->IsObject() ? '
+            'object->Is{}(): false').format(arg, interface_name)
+
 
 class CodeGeneratorV8c(CodeGeneratorCobalt):
   """Code generator class for V8 bindings."""
diff --git a/src/cobalt/bindings/v8c/templates/dictionary-conversion.cc.template b/src/cobalt/bindings/v8c/templates/dictionary-conversion.cc.template
index 61fc652..1b1cb04 100644
--- a/src/cobalt/bindings/v8c/templates/dictionary-conversion.cc.template
+++ b/src/cobalt/bindings/v8c/templates/dictionary-conversion.cc.template
@@ -149,7 +149,7 @@
                   &converted_value);
       out_dictionary->set_{{member.name}}(converted_value);
   {% else %}
-      TypeTraits<::cobalt::script::ValueHandle >::ConversionType converted_value;
+      TypeTraits<{{member.type}}>::ConversionType converted_value;
       FromJSValue(isolate,
                   member_value,
                   {{member.conversion_flags}},
diff --git a/src/cobalt/bindings/v8c/templates/interface.cc.template b/src/cobalt/bindings/v8c/templates/interface.cc.template
index 2d94f1d..e90abc9 100644
--- a/src/cobalt/bindings/v8c/templates/interface.cc.template
+++ b/src/cobalt/bindings/v8c/templates/interface.cc.template
@@ -32,12 +32,16 @@
 #include "{{generated_conversion_include}}"
 
 #include "cobalt/script/callback_interface_traits.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/callback_function_conversion.h"
 #include "cobalt/script/v8c/conversion_helpers.h"
 #include "cobalt/script/v8c/entry_scope.h"
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/native_promise.h"
 #include "cobalt/script/v8c/type_traits.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_callback_function.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
 #include "cobalt/script/v8c/v8c_engine.h"
diff --git a/src/cobalt/browser/browser_bindings_gen.gyp b/src/cobalt/browser/browser_bindings_gen.gyp
index 75b1859..e50a31d 100644
--- a/src/cobalt/browser/browser_bindings_gen.gyp
+++ b/src/cobalt/browser/browser_bindings_gen.gyp
@@ -58,8 +58,6 @@
         '../debug/debug_script_runner.idl',
 
         '../dom/animation_event.idl',
-        '../dom/array_buffer.idl',
-        '../dom/array_buffer_view.idl',
         '../dom/attr.idl',
         '../dom/audio_track.idl',
         '../dom/audio_track_list.idl',
@@ -72,7 +70,6 @@
         '../dom/console.idl',
         '../dom/crypto.idl',
         '../dom/custom_event.idl',
-        '../dom/data_view.idl',
         '../dom/device_orientation_event.idl',
         '../dom/document.idl',
         '../dom/document_timeline.idl',
@@ -90,8 +87,6 @@
         '../dom/event.idl',
         '../dom/event_listener.idl',
         '../dom/event_target.idl',
-        '../dom/float32_array.idl',
-        '../dom/float64_array.idl',
         '../dom/focus_event.idl',
         '../dom/history.idl',
         '../dom/html_anchor_element.idl',
@@ -149,9 +144,6 @@
         '../dom/track_event.idl',
         '../dom/transition_event.idl',
         '../dom/ui_event.idl',
-        '../dom/uint16_array.idl',
-        '../dom/uint32_array.idl',
-        '../dom/uint8_array.idl',
         '../dom/url.idl',
         '../dom/video_playback_quality.idl',
         '../dom/video_track.idl',
@@ -184,6 +176,7 @@
         '../h5vcc/h5vcc_system.idl',
         '../h5vcc/h5vcc_trace_event.idl',
 
+        '../media_capture/blob_event.idl',
         '../media_capture/media_device_info.idl',
         '../media_capture/media_devices.idl',
         '../media_capture/media_recorder.idl',
@@ -259,6 +252,7 @@
         '../dom/source_buffer_append_mode.idl',
         '../dom/track_default_type.idl',
         '../dom/wheel_event_init.idl',
+        '../media_capture/blob_event_init.idl',
         '../media_capture/media_device_kind.idl',
         '../media_capture/media_recorder_options.idl',
         '../media_capture/recording_state.idl',
diff --git a/src/cobalt/browser/browser_module.h b/src/cobalt/browser/browser_module.h
index 22e3bed..25c358c 100644
--- a/src/cobalt/browser/browser_module.h
+++ b/src/cobalt/browser/browser_module.h
@@ -43,7 +43,6 @@
 #include "cobalt/browser/system_platform_error_handler.h"
 #include "cobalt/browser/url_handler.h"
 #include "cobalt/browser/web_module.h"
-#include "cobalt/dom/array_buffer.h"
 #include "cobalt/dom/input_event_init.h"
 #include "cobalt/dom/keyboard_event_init.h"
 #include "cobalt/dom/on_screen_keyboard_bridge.h"
@@ -59,6 +58,7 @@
 #include "cobalt/render_tree/resource_provider.h"
 #include "cobalt/render_tree/resource_provider_stub.h"
 #include "cobalt/renderer/renderer_module.h"
+#include "cobalt/script/array_buffer.h"
 #include "cobalt/storage/storage_manager.h"
 #include "cobalt/system_window/system_window.h"
 #include "cobalt/webdriver/session_driver.h"
diff --git a/src/cobalt/browser/debug_console.cc b/src/cobalt/browser/debug_console.cc
index 9409f44..4ee4b77 100644
--- a/src/cobalt/browser/debug_console.cc
+++ b/src/cobalt/browser/debug_console.cc
@@ -179,6 +179,10 @@
   web_module_options.csp_insecure_allowed_token =
       dom::CspDelegateFactory::GetInsecureAllowedToken();
 
+  // Since the debug console is intended to be overlaid on top of the main
+  // web module contents, make sure blending is enabled for its background.
+  web_module_options.clear_window_with_background_color = false;
+
   // Attach a DebugHub object to the "debugHub" Window attribute for this
   // web module so that JavaScript within this WebModule has access to DebugHub
   // functionality.
diff --git a/src/cobalt/browser/splash_screen.cc b/src/cobalt/browser/splash_screen.cc
index d712432..7298358 100644
--- a/src/cobalt/browser/splash_screen.cc
+++ b/src/cobalt/browser/splash_screen.cc
@@ -96,6 +96,10 @@
   web_module_options.on_before_unload_fired_but_not_handled =
       base::Bind(on_window_close, base::TimeDelta());
 
+  // Since the splash screen is intended to possibly fade in to the main web
+  // module contents, make sure blending is enabled for its background.
+  web_module_options.clear_window_with_background_color = false;
+
   DCHECK(url_to_pass);
   web_module_.reset(new WebModule(
       *url_to_pass, initial_application_state, render_tree_produced_callback_,
diff --git a/src/cobalt/browser/storage_upgrade_handler.cc b/src/cobalt/browser/storage_upgrade_handler.cc
index 9be2cda..08a4aee 100644
--- a/src/cobalt/browser/storage_upgrade_handler.cc
+++ b/src/cobalt/browser/storage_upgrade_handler.cc
@@ -37,8 +37,7 @@
 }  // namespace
 
 StorageUpgradeHandler::StorageUpgradeHandler(const GURL& url)
-    : default_local_storage_id_(
-          dom::StorageArea::GetLocalStorageIdForUrl(url)) {}
+    : default_local_storage_origin_(loader::Origin(url)) {}
 
 void StorageUpgradeHandler::OnUpgrade(storage::StorageManager* storage,
                                       const char* data, int size) {
@@ -67,7 +66,7 @@
       const storage::upgrade::UpgradeReader::LocalStorageEntry*
           local_storage_entry = upgrade_reader.GetLocalStorageEntry(i);
       DCHECK(local_storage_entry);
-      local_storage_database.Write(default_local_storage_id_,
+      local_storage_database.Write(default_local_storage_origin_,
                                    local_storage_entry->key,
                                    local_storage_entry->value);
     }
diff --git a/src/cobalt/browser/storage_upgrade_handler.h b/src/cobalt/browser/storage_upgrade_handler.h
index 8ddc67c..9ddfa48 100644
--- a/src/cobalt/browser/storage_upgrade_handler.h
+++ b/src/cobalt/browser/storage_upgrade_handler.h
@@ -30,12 +30,12 @@
   void OnUpgrade(storage::StorageManager* storage, const char* data,
                  int size) override;
 
-  const std::string& default_local_storage_id() const {
-    return default_local_storage_id_;
+  const loader::Origin& default_local_storage_origin() const {
+    return default_local_storage_origin_;
   }
 
  private:
-  std::string default_local_storage_id_;
+  loader::Origin default_local_storage_origin_;
 };
 
 }  // namespace browser
diff --git a/src/cobalt/browser/storage_upgrade_handler_test.cc b/src/cobalt/browser/storage_upgrade_handler_test.cc
index 303e0f8..a133284 100644
--- a/src/cobalt/browser/storage_upgrade_handler_test.cc
+++ b/src/cobalt/browser/storage_upgrade_handler_test.cc
@@ -25,6 +25,7 @@
 #include "cobalt/browser/storage_upgrade_handler.h"
 #include "cobalt/dom/local_storage_database.h"
 #include "cobalt/dom/storage_area.h"
+#include "cobalt/loader/origin.h"
 #include "cobalt/network/persistent_cookie_store.h"
 #include "cobalt/storage/savegame_fake.h"
 #include "cobalt/storage/storage_manager.h"
@@ -130,12 +131,12 @@
 }
 
 int GetNumLocalStorageEntries(storage::StorageManager* storage,
-                              const std::string& identifier) {
+                              const loader::Origin& origin) {
   dom::LocalStorageDatabase local_storage_database(storage);
   LocalStorageEntryWaiter waiter;
   local_storage_database.ReadAll(
-      identifier, base::Bind(&LocalStorageEntryWaiter::OnEntriesLoaded,
-                             base::Unretained(&waiter)));
+      origin, base::Bind(&LocalStorageEntryWaiter::OnEntriesLoaded,
+                         base::Unretained(&waiter)));
   EXPECT_EQ(true, waiter.TimedWait());
   return static_cast<int>(waiter.GetEntries()->size());
 }
@@ -159,7 +160,7 @@
   // Our storage should be empty at this point.
   EXPECT_EQ(GetNumCookies(&storage), 0);
   EXPECT_EQ(GetNumLocalStorageEntries(
-                &storage, upgrade_handler->default_local_storage_id()),
+                &storage, upgrade_handler->default_local_storage_origin()),
             0);
 
   upgrade_handler->OnUpgrade(&storage, file_contents.c_str(),
@@ -173,7 +174,7 @@
   // We should now have 2 cookies and 2 local storage entries.
   EXPECT_EQ(GetNumCookies(&storage), 2);
   EXPECT_EQ(GetNumLocalStorageEntries(
-                &storage, upgrade_handler->default_local_storage_id()),
+                &storage, upgrade_handler->default_local_storage_origin()),
             2);
 
   message_loop_.RunUntilIdle();
diff --git a/src/cobalt/browser/web_module.cc b/src/cobalt/browser/web_module.cc
index cd52dc8..d765925 100644
--- a/src/cobalt/browser/web_module.cc
+++ b/src/cobalt/browser/web_module.cc
@@ -682,7 +682,8 @@
       data.options.layout_trigger, data.dom_max_element_depth,
       data.layout_refresh_rate, data.network_module->preferred_language(),
       data.options.enable_image_animations,
-      web_module_stat_tracker_->layout_stat_tracker()));
+      web_module_stat_tracker_->layout_stat_tracker(),
+      data.options.clear_window_with_background_color));
   DCHECK(layout_manager_);
 
 #if defined(ENABLE_DEBUG_CONSOLE)
@@ -1290,7 +1291,8 @@
       video_playback_rate_multiplier(1.f),
       enable_image_animations(true),
       should_retain_remote_typeface_cache_on_suspend(false),
-      can_fetch_cache(false) {}
+      can_fetch_cache(false),
+      clear_window_with_background_color(true) {}
 
 WebModule::WebModule(
     const GURL& initial_url, base::ApplicationState initial_application_state,
diff --git a/src/cobalt/browser/web_module.h b/src/cobalt/browser/web_module.h
index a5fd30c..ed517d7 100644
--- a/src/cobalt/browser/web_module.h
+++ b/src/cobalt/browser/web_module.h
@@ -226,6 +226,12 @@
     // functionality in Cobalt.
     dom::ScreenshotManager::ProvideScreenshotFunctionCallback
         provide_screenshot_function;
+
+    // If true, the initial containing block's background color will be applied
+    // 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;
   };
 
   typedef layout::LayoutManager::LayoutResults LayoutResults;
diff --git a/src/cobalt/build/all.gyp b/src/cobalt/build/all.gyp
index cf79008..a631ee3 100644
--- a/src/cobalt/build/all.gyp
+++ b/src/cobalt/build/all.gyp
@@ -54,6 +54,7 @@
         '<(DEPTH)/cobalt/layout_tests/layout_tests.gyp:*',
         '<(DEPTH)/cobalt/loader/image/sandbox/sandbox.gyp:*',
         '<(DEPTH)/cobalt/loader/loader.gyp:*',
+        '<(DEPTH)/cobalt/loader/origin.gyp:*',
         '<(DEPTH)/cobalt/math/math.gyp:*',
         '<(DEPTH)/cobalt/media/sandbox/sandbox.gyp:*',
         '<(DEPTH)/cobalt/media_capture/media_capture.gyp:*',
diff --git a/src/cobalt/build/build.id b/src/cobalt/build/build.id
index 501b9b9..f00d114 100644
--- a/src/cobalt/build/build.id
+++ b/src/cobalt/build/build.id
@@ -1 +1 @@
-179149
\ No newline at end of file
+180626
\ No newline at end of file
diff --git a/src/cobalt/content/fonts/config/android/fonts.xml b/src/cobalt/content/fonts/config/android/fonts.xml
index 825146a..c9dafe1 100644
--- a/src/cobalt/content/fonts/config/android/fonts.xml
+++ b/src/cobalt/content/fonts/config/android/fonts.xml
@@ -468,7 +468,7 @@
         <font weight="400" style="normal">NanumGothic.ttf</font>
     </family>
     <family>
-        <font weight="400" style="normal">NotoColorEmoji.ttf</font>
+        <font weight="400" style="normal" disable_synthetic_bolding="true">NotoColorEmoji.ttf</font>
     </family>
     <family>
         <font weight="400" style="normal">NotoSansSymbols-Regular-Subsetted2.ttf</font>
diff --git a/src/cobalt/content/fonts/config/common/fonts.xml b/src/cobalt/content/fonts/config/common/fonts.xml
index bfa0cdf..9147f3d 100644
--- a/src/cobalt/content/fonts/config/common/fonts.xml
+++ b/src/cobalt/content/fonts/config/common/fonts.xml
@@ -438,7 +438,7 @@
         <font weight="400" style="normal" index="1">NotoSansCJK-Regular.ttc</font>
     </family>
     <family pages="0,32-33,35-39,41,43,48,50,496-502,505,3584,4068,4072">
-        <font weight="400" style="normal">NotoColorEmoji.ttf</font>
+        <font weight="400" style="normal" disable_synthetic_bolding="true">NotoColorEmoji.ttf</font>
     </family>
     <family pages="0,32-33,35-39,41,43,48,50,254,496-502,4068,4072">
         <font weight="400" style="normal">NotoEmoji-Regular.ttf</font>
diff --git a/src/cobalt/demos/content/media-element-demo/loop-playback.html b/src/cobalt/demos/content/media-element-demo/loop-playback.html
new file mode 100644
index 0000000..91b04c0
--- /dev/null
+++ b/src/cobalt/demos/content/media-element-demo/loop-playback.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>Loop Playback</title>
+  <style>
+    body {
+      background-color: rgb(255, 255, 255);
+      color: #0047ab;
+      font-size: 100px;
+    }
+    video {
+      transform: translateX(100px) rotate(3deg);
+    }
+  </style>
+</head>
+<body>
+  Loop Playback
+  <script type="text/javascript" src="loop-playback.js"></script>
+</body>
+</html>
diff --git a/src/cobalt/demos/content/media-element-demo/loop-playback.js b/src/cobalt/demos/content/media-element-demo/loop-playback.js
new file mode 100644
index 0000000..2dc7274
--- /dev/null
+++ b/src/cobalt/demos/content/media-element-demo/loop-playback.js
@@ -0,0 +1,127 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// The page simply plays an audio or a video stream in a loop, it can be used
+// in the following forms:
+//   loop-playback.html?url=video.mp4&type=progressive
+//   loop-playback.html?url=video.webm&type=video
+//   loop-playback.html?url=audio.mp4&type=audio
+// If the stream is adaptive, it has to be fit in memory as this demo will
+// download the whole stream at once.
+
+var video = null;
+var url = null;
+var type = null;
+
+function downloadAndAppend(source_buffer, callback) {
+  var xhr = new XMLHttpRequest;
+  xhr.open('GET', url, true);
+  xhr.responseType = 'arraybuffer';
+  xhr.addEventListener('load', function(e) {
+    var onupdateend = function() {
+      source_buffer.removeEventListener('updateend', onupdateend);
+      callback();
+    };
+    source_buffer.addEventListener('updateend', onupdateend);
+    source_buffer.appendBuffer(new Uint8Array(e.target.response));
+  });
+  xhr.send();
+}
+
+function createVideoElement() {
+  var video = document.createElement('video');
+  video.autoplay = true;
+  video.style.width = '1280px';
+  video.style.height = '720px';
+  document.body.appendChild(video);
+
+  return video;
+}
+
+function onVideoEnded() {
+  console.log('playback ended');
+  startNextVideo();
+}
+
+function startProgressiveVideo() {
+  video.src = '';
+  video.load();
+  video.src = url;
+  video.addEventListener('ended', onVideoEnded.bind());
+}
+
+function startAdaptiveVideo() {
+  video.src = '';
+  video.load();
+  var mediasource = new MediaSource;
+  mediasource.addEventListener('sourceopen', function () {
+    var source_buffer;
+    if (type == "audio") {
+      if (url.indexOf(".mp4") != -1) {
+        source_buffer = mediasource.addSourceBuffer('audio/mp4; codecs="mp4a.40.2"');
+      } else if (url.indexOf(".webm") != -1) {
+        source_buffer = mediasource.addSourceBuffer('audio/webm; codecs="opus"');
+      } else {
+        throw "unknown audio format " + url;
+      }
+    } else {
+      if (url.indexOf(".mp4") != -1) {
+        source_buffer = mediasource.addSourceBuffer('video/mp4; codecs="avc1.640028"');
+      } else if (url.indexOf(".webm") != -1) {
+        source_buffer = mediasource.addSourceBuffer('video/webm; codecs="vp9"');
+      } else {
+        throw "unknown video format " + url;
+      }
+    }
+    downloadAndAppend(source_buffer, function () {
+      mediasource.endOfStream();
+    });
+  })
+
+  video.src = window.URL.createObjectURL(mediasource);
+  video.addEventListener('ended', onVideoEnded);
+}
+
+function startNextVideo() {
+  if (type == "progressive") {
+    startProgressiveVideo();
+  } else {
+    startAdaptiveVideo();
+  }
+}
+
+function main() {
+  var get_parameters = window.location.search.substr(1).split('&');
+  for (var param of get_parameters) {
+    splitted = param.split('=');
+    if (splitted[0] == 'url') {
+      url = splitted[1];
+    } else if (splitted[0] == 'type') {
+      type = splitted[1];
+    }
+  }
+
+  if (!url) {
+    throw "url is not set.";
+  }
+
+  if (type != 'progressive' && type != 'audio' && type != 'video') {
+    throw "invalid type " + type;
+  }
+
+  video = createVideoElement();
+  startNextVideo();
+}
+
+main();
diff --git a/src/cobalt/demos/content/transparent-animated-webp-demo/bottleflip_loader.webp b/src/cobalt/demos/content/transparent-animated-webp-demo/bottleflip_loader.webp
new file mode 100644
index 0000000..f9fcb72
--- /dev/null
+++ b/src/cobalt/demos/content/transparent-animated-webp-demo/bottleflip_loader.webp
Binary files differ
diff --git a/src/cobalt/demos/content/transparent-animated-webp-demo/index.html b/src/cobalt/demos/content/transparent-animated-webp-demo/index.html
new file mode 100644
index 0000000..62d21d9
--- /dev/null
+++ b/src/cobalt/demos/content/transparent-animated-webp-demo/index.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<!--
+ | Demo to help test animated webp with transparent backgrounds.  Sets up
+ | two different animated webp images where one renders its frames using
+ | no blending when applying the new image over the existing one, and the
+ | other disposes to the background (which is alpha) as it runs through its
+ | frames.
+ -->
+<html>
+<head>
+<style>
+body {
+  background-color: white;
+}
+
+.layer {
+  position: absolute;
+  left: 0px;
+  top: 0px;
+}
+
+@keyframes background-anim {
+  from {
+    background-color: green;
+  }
+  to {
+    background-color: blue;
+  }
+}
+
+.background {
+  position: absolute;
+  left: 0px;
+  top: 0px;
+  width:100%;
+  height:100%;
+  background-color: green;
+  animation: background-anim 5s alternate-reverse infinite ease-in-out;
+}
+
+.image {
+  width: 300px;
+  height: 300px;
+  background-size: contain;
+}
+</style>
+</head>
+
+<body>
+  <div class="background"></div>
+
+  <div class="layer">
+    <!-- Image that clears each frame by overwriting the entire frame with a
+         new image that has blending disabled -->
+    <div class="image"
+         style="background-image: url(bottleflip_loader.webp);">
+    </div>
+    <!-- Image that disposes the previous frame's rectangle to the background
+         color (which contains alpha) after it finishes, requiring that the
+         background color fill be done with no blending. -->
+    <div class="image"
+         style="background-image: url(webp-animated-semitransparent4.webp);">
+    </div>
+  </div>
+</body>
+</html>
diff --git a/src/cobalt/demos/content/transparent-animated-webp-demo/webp-animated-semitransparent4.webp b/src/cobalt/demos/content/transparent-animated-webp-demo/webp-animated-semitransparent4.webp
new file mode 100644
index 0000000..714fa2c
--- /dev/null
+++ b/src/cobalt/demos/content/transparent-animated-webp-demo/webp-animated-semitransparent4.webp
Binary files differ
diff --git a/src/cobalt/dom/array_buffer.cc b/src/cobalt/dom/array_buffer.cc
deleted file mode 100644
index 2b0211a..0000000
--- a/src/cobalt/dom/array_buffer.cc
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "cobalt/dom/array_buffer.h"
-
-#include <algorithm>
-
-#include "base/logging.h"
-#include "cobalt/base/polymorphic_downcast.h"
-#include "cobalt/dom/dom_settings.h"
-#include "cobalt/script/javascript_engine.h"
-#include "nb/memory_scope.h"
-
-namespace cobalt {
-namespace dom {
-
-namespace {
-
-int ClampIndex(int index, int length) {
-  if (index < 0) {
-    index = length + index;
-  }
-  index = std::max(index, 0);
-  return std::min(index, length);
-}
-
-}  // namespace
-
-ArrayBuffer::Data::Data(size_t size) : data_(NULL), size_(0) {
-  Initialize(size);
-  if (data_) {
-    memset(data_, 0, size);
-  }
-}
-
-ArrayBuffer::Data::Data(const uint8* data, size_t size)
-    : data_(NULL), size_(0) {
-  Initialize(size);
-  DCHECK(data_);
-  memcpy(data_, data, size);
-}
-
-ArrayBuffer::Data::Data(scoped_array<uint8> data, size_t size)
-    : data_(data.release()), size_(size) {
-  DCHECK(data_);
-}
-
-ArrayBuffer::Data::~Data() { delete[] data_; }
-
-uint8* ArrayBuffer::Data::data() const {
-  return data_;
-}
-
-void ArrayBuffer::Data::Initialize(size_t size) {
-  TRACK_MEMORY_SCOPE("DOM");
-  data_ = new uint8[size];
-  size_ = size;
-}
-
-ArrayBuffer::ArrayBuffer(script::EnvironmentSettings* settings, uint32 length)
-    : data_(length) {
-  // TODO: Once we can have a reliable way to pass the
-  // EnvironmentSettings to HTMLMediaElement, we should make EnvironmentSettings
-  // mandatory for creating ArrayBuffer in non-testing code.
-  if (settings) {
-    DOMSettings* dom_settings =
-        base::polymorphic_downcast<dom::DOMSettings*>(settings);
-    javascript_engine_ = dom_settings->javascript_engine();
-    javascript_engine_->AdjustAmountOfExternalAllocatedMemory(
-        static_cast<int64_t>(data_.size()));
-  }
-}
-
-ArrayBuffer::ArrayBuffer(script::EnvironmentSettings* settings,
-                         const uint8* data, uint32 length)
-    : data_(data, length) {
-  // TODO: Make EnvironmentSettings mandatory for creating
-  // ArrayBuffer in non-testing code.
-  if (settings) {
-    DOMSettings* dom_settings =
-        base::polymorphic_downcast<dom::DOMSettings*>(settings);
-    javascript_engine_ = dom_settings->javascript_engine();
-    javascript_engine_->AdjustAmountOfExternalAllocatedMemory(
-        static_cast<int64_t>(data_.size()));
-  }
-}
-
-ArrayBuffer::ArrayBuffer(script::EnvironmentSettings* settings,
-                         scoped_array<uint8> data, uint32 length)
-    : data_(data.Pass(), length) {
-  // TODO: Make EnvironmentSettings mandatory for creating
-  // ArrayBuffer in non-testing code.
-  if (settings) {
-    DOMSettings* dom_settings =
-        base::polymorphic_downcast<dom::DOMSettings*>(settings);
-    javascript_engine_ = dom_settings->javascript_engine();
-    javascript_engine_->AdjustAmountOfExternalAllocatedMemory(
-        static_cast<int64_t>(data_.size()));
-  }
-}
-
-scoped_refptr<ArrayBuffer> ArrayBuffer::Slice(
-    script::EnvironmentSettings* settings, int start, int end) const {
-  TRACK_MEMORY_SCOPE("DOM");
-  int clamped_start;
-  int clamped_end;
-  ClampRange(start, end, static_cast<int>(byte_length()), &clamped_start,
-             &clamped_end);
-  DCHECK_GE(clamped_end, clamped_start);
-  size_t slice_size = static_cast<size_t>(clamped_end - clamped_start);
-  return new ArrayBuffer(settings, data() + clamped_start,
-                         static_cast<uint32>(slice_size));
-}
-
-void ArrayBuffer::ClampRange(int start, int end, int source_length,
-                             int* clamped_start, int* clamped_end) {
-  start = ClampIndex(start, source_length);
-  end = ClampIndex(end, source_length);
-
-  // Clamp the length of the new array to non-negative.
-  if (end - start < 0) {
-    end = start;
-  }
-  *clamped_start = start;
-  *clamped_end = end;
-}
-
-ArrayBuffer::~ArrayBuffer() {
-  if (javascript_engine_) {
-    javascript_engine_->AdjustAmountOfExternalAllocatedMemory(
-        -static_cast<int64_t>(data_.size()));
-  }
-}
-
-}  // namespace dom
-}  // namespace cobalt
diff --git a/src/cobalt/dom/array_buffer.h b/src/cobalt/dom/array_buffer.h
deleted file mode 100644
index 00db1f1..0000000
--- a/src/cobalt/dom/array_buffer.h
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef COBALT_DOM_ARRAY_BUFFER_H_
-#define COBALT_DOM_ARRAY_BUFFER_H_
-
-#include <vector>
-
-#include "base/memory/scoped_ptr.h"  // For scoped_array
-#include "cobalt/script/environment_settings.h"
-#include "cobalt/script/javascript_engine.h"
-#include "cobalt/script/wrappable.h"
-
-namespace cobalt {
-namespace dom {
-
-class ArrayBuffer : public script::Wrappable {
- public:
-  // This class manages the internal buffer of an ArrayBuffer.  It deals the
-  // fact that the buffer can be allocated from an Allocator or from the heap.
-  class Data {
-   public:
-    explicit Data(size_t size);
-    Data(const uint8* data, size_t size);
-    Data(scoped_array<uint8> data, size_t size);
-
-    ~Data();
-
-    uint8* data() const;
-    size_t size() const { return size_; }
-
-   private:
-    void Initialize(size_t size);
-
-    uint8* data_;
-    size_t size_;
-
-    DISALLOW_COPY_AND_ASSIGN(Data);
-  };
-
-  ArrayBuffer(script::EnvironmentSettings* settings, uint32 length);
-  ArrayBuffer(script::EnvironmentSettings* settings, const uint8* data,
-              uint32 length);
-  ArrayBuffer(script::EnvironmentSettings* settings, scoped_array<uint8> data,
-              uint32 length);
-
-  uint32 byte_length() const { return static_cast<uint32>(data_.size()); }
-  scoped_refptr<ArrayBuffer> Slice(script::EnvironmentSettings* settings,
-                                   int begin) const {
-    return Slice(settings, begin, static_cast<int>(byte_length()));
-  }
-  scoped_refptr<ArrayBuffer> Slice(script::EnvironmentSettings* settings,
-                                   int begin, int end) const;
-
-  uint8* data() { return data_.data(); }
-  const uint8* data() const { return data_.data(); }
-
-  // Utility function for restricting begin/end offsets to an appropriate
-  // range as defined by the spec. Negative start or end values refer
-  // to offsets from the end of the array rather than the beginning.
-  // If the length of the resulting range would be < 0, the length
-  // is clamped to 0.
-  static void ClampRange(int start, int end, int source_length,
-                         int* clamped_start, int* clamped_end);
-
-  DEFINE_WRAPPABLE_TYPE(ArrayBuffer);
-
- private:
-  ~ArrayBuffer();
-
-  Data data_;
-  script::JavaScriptEngine* javascript_engine_ = nullptr;
-
-  DISALLOW_COPY_AND_ASSIGN(ArrayBuffer);
-};
-
-}  // namespace dom
-}  // namespace cobalt
-
-#endif  // COBALT_DOM_ARRAY_BUFFER_H_
diff --git a/src/cobalt/dom/array_buffer.idl b/src/cobalt/dom/array_buffer.idl
deleted file mode 100644
index bc6ba2c..0000000
--- a/src/cobalt/dom/array_buffer.idl
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// https://www.khronos.org/registry/typedarray/specs/latest/#5
-
-[
-  Constructor(unsigned long length),
-  ConstructorCallWith=EnvironmentSettings
-]
-interface ArrayBuffer {
-  readonly attribute unsigned long byteLength;
-  [CallWith=EnvironmentSettings] ArrayBuffer slice(long begin, optional long end);
-
-  // TODO: Do we need to support this?
-  // static boolean isView(any value);
-};
diff --git a/src/cobalt/dom/array_buffer_view.cc b/src/cobalt/dom/array_buffer_view.cc
deleted file mode 100644
index 64fc461..0000000
--- a/src/cobalt/dom/array_buffer_view.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "cobalt/dom/array_buffer_view.h"
-
-namespace cobalt {
-namespace dom {
-
-const char* ArrayBufferView::kWrongByteOffsetMultipleErrorFormat =
-    "Byte offset should be a multiple of %d.";
-const char* ArrayBufferView::kWrongByteLengthMultipleErrorFormat =
-    "Byte length should be a multiple of %d.";
-
-ArrayBufferView::ArrayBufferView(const scoped_refptr<ArrayBuffer>& buffer)
-    : buffer_(buffer), byte_offset_(0), byte_length_(buffer->byte_length()) {}
-
-ArrayBufferView::ArrayBufferView(const scoped_refptr<ArrayBuffer>& buffer,
-                                 uint32 byte_offset, uint32 byte_length)
-    : buffer_(buffer), byte_offset_(byte_offset), byte_length_(byte_length) {}
-
-void* ArrayBufferView::base_address() { return buffer_->data() + byte_offset_; }
-
-const void* ArrayBufferView::base_address() const {
-  return buffer_->data() + byte_offset_;
-}
-
-void ArrayBufferView::TraceMembers(script::Tracer* tracer) {
-  tracer->Trace(buffer_);
-}
-
-ArrayBufferView::~ArrayBufferView() {}
-
-}  // namespace dom
-}  // namespace cobalt
diff --git a/src/cobalt/dom/array_buffer_view.h b/src/cobalt/dom/array_buffer_view.h
deleted file mode 100644
index 9e8a47f..0000000
--- a/src/cobalt/dom/array_buffer_view.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef COBALT_DOM_ARRAY_BUFFER_VIEW_H_
-#define COBALT_DOM_ARRAY_BUFFER_VIEW_H_
-
-#include <string>
-
-#include "cobalt/dom/array_buffer.h"
-#include "cobalt/script/wrappable.h"
-
-namespace cobalt {
-namespace dom {
-
-class ArrayBufferView : public script::Wrappable {
- public:
-  // Web API: ArrayBufferView
-  const scoped_refptr<ArrayBuffer>& buffer() { return buffer_; }
-  uint32 byte_offset() const { return byte_offset_; }
-  uint32 byte_length() const { return byte_length_; }
-
-  // Custom, not in any spec.
-  void* base_address();
-  const void* base_address() const;
-
-  DEFINE_WRAPPABLE_TYPE(ArrayBufferView);
-  void TraceMembers(script::Tracer* tracer) override;
-
- protected:
-  explicit ArrayBufferView(const scoped_refptr<ArrayBuffer>& buffer);
-  ArrayBufferView(const scoped_refptr<ArrayBuffer>& buffer, uint32 byte_offset,
-                  uint32 byte_length);
-  ~ArrayBufferView();
-
-  static const char* kWrongByteOffsetMultipleErrorFormat;
-  static const char* kWrongByteLengthMultipleErrorFormat;
-
- private:
-  scoped_refptr<ArrayBuffer> buffer_;
-  uint32 byte_offset_;
-  uint32 byte_length_;
-
-  DISALLOW_COPY_AND_ASSIGN(ArrayBufferView);
-};
-
-}  // namespace dom
-}  // namespace cobalt
-
-#endif  // COBALT_DOM_ARRAY_BUFFER_VIEW_H_
diff --git a/src/cobalt/dom/blob.cc b/src/cobalt/dom/blob.cc
index e448cf8..5c0eaf2 100644
--- a/src/cobalt/dom/blob.cc
+++ b/src/cobalt/dom/blob.cc
@@ -15,24 +15,26 @@
 #include "cobalt/dom/blob.h"
 
 #include "base/lazy_instance.h"
+#include "cobalt/base/polymorphic_downcast.h"
 #include "cobalt/dom/blob_property_bag.h"
+#include "cobalt/dom/dom_settings.h"
 
 namespace cobalt {
 namespace dom {
 
 namespace {
 
-const uint8* DataStart(const Blob::BlobPart& part) {
-  if (part.IsType<scoped_refptr<ArrayBuffer> >()) {
-    return part.AsType<scoped_refptr<ArrayBuffer> >()->data();
-  } else if (part.IsType<scoped_refptr<ArrayBufferView> >()) {
-    const scoped_refptr<ArrayBufferView>& view =
-        part.AsType<scoped_refptr<ArrayBufferView> >();
-    return view->buffer()->data() + view->byte_offset();
-  } else if (part.IsType<scoped_refptr<DataView> >()) {
-    const scoped_refptr<DataView>& view =
-        part.AsType<scoped_refptr<DataView> >();
-    return view->buffer()->data() + view->byte_offset();
+const void* DataStart(const Blob::BlobPart& part) {
+  if (part.IsType<script::Handle<script::ArrayBuffer> >()) {
+    return part.AsType<script::Handle<script::ArrayBuffer> >()->Data();
+  } else if (part.IsType<script::Handle<script::ArrayBufferView> >()) {
+    const script::Handle<script::ArrayBufferView>& view =
+        part.AsType<script::Handle<script::ArrayBufferView> >();
+    return view->RawData();
+  } else if (part.IsType<script::Handle<script::DataView> >()) {
+    const script::Handle<script::DataView>& view =
+        part.AsType<script::Handle<script::DataView> >();
+    return view->RawData();
   } else if (part.IsType<scoped_refptr<Blob> >()) {
     return part.AsType<scoped_refptr<Blob> >()->data();
   }
@@ -40,31 +42,52 @@
   return NULL;
 }
 
-uint64 DataLength(const Blob::BlobPart& part) {
-  if (part.IsType<scoped_refptr<ArrayBuffer> >()) {
-    return part.AsType<scoped_refptr<ArrayBuffer> >()->byte_length();
-  } else if (part.IsType<scoped_refptr<ArrayBufferView> >()) {
-    return part.AsType<scoped_refptr<ArrayBufferView> >()->byte_length();
-  } else if (part.IsType<scoped_refptr<DataView> >()) {
-    return part.AsType<scoped_refptr<DataView> >()->byte_length();
+size_t DataLength(const Blob::BlobPart& part) {
+  if (part.IsType<script::Handle<script::ArrayBuffer> >()) {
+    return part.AsType<script::Handle<script::ArrayBuffer> >()->ByteLength();
+  } else if (part.IsType<script::Handle<script::ArrayBufferView> >()) {
+    return part.AsType<script::Handle<script::ArrayBufferView> >()
+        ->ByteLength();
+  } else if (part.IsType<script::Handle<script::DataView> >()) {
+    return part.AsType<script::Handle<script::DataView> >()->ByteLength();
   } else if (part.IsType<scoped_refptr<Blob> >()) {
-    return part.AsType<scoped_refptr<Blob> >()->size();
+    return static_cast<size_t>(part.AsType<scoped_refptr<Blob> >()->size());
   }
 
   return 0;
 }
 
+size_t TotalDataLength(const script::Sequence<Blob::BlobPart>& blob_parts) {
+  size_t byte_length = 0;
+  for (script::Sequence<Blob::BlobPart>::size_type i = 0; i < blob_parts.size();
+       i++) {
+    byte_length += DataLength(blob_parts.at(i));
+  }
+
+  return byte_length;
+}
+
 base::LazyInstance<BlobPropertyBag> empty_blob_property_bag =
     LAZY_INSTANCE_INITIALIZER;
 
 }  // namespace
 
 Blob::Blob(script::EnvironmentSettings* settings,
-           const scoped_refptr<ArrayBuffer>& buffer) {
-  if (buffer) {
-    buffer_ = buffer->Slice(settings, 0);
-  } else {
-    buffer_ = new ArrayBuffer(settings, 0);
+           const script::Handle<script::ArrayBuffer>& buffer,
+           const BlobPropertyBag& options)
+    : buffer_reference_(
+          this, buffer.IsEmpty()
+                    ? script::ArrayBuffer::New(
+                          base::polymorphic_downcast<DOMSettings*>(settings)
+                              ->global_environment(),
+                          0)
+                    : script::ArrayBuffer::New(
+                          base::polymorphic_downcast<DOMSettings*>(settings)
+                              ->global_environment(),
+                          buffer->Data(), buffer->ByteLength())) {
+  DCHECK(settings);
+  if (options.has_type()) {
+    type_ = options.type();
   }
 }
 
@@ -74,28 +97,26 @@
 Blob::Blob(script::EnvironmentSettings* settings,
            const script::Sequence<BlobPart>& blob_parts,
            const BlobPropertyBag& options)
-    : buffer_(new ArrayBuffer(settings, 0)), type_(options.type()) {
-  size_t byte_length = 0;
-  for (script::Sequence<BlobPart>::size_type i = 0; i < blob_parts.size();
-       ++i) {
-    byte_length += DataLength(blob_parts.at(i));
-  }
-  buffer_ = new ArrayBuffer(settings, static_cast<uint32>(byte_length));
-
-  uint8* destination = buffer_->data();
+    : buffer_reference_(this,
+                        script::ArrayBuffer::New(
+                            base::polymorphic_downcast<DOMSettings*>(settings)
+                                ->global_environment(),
+                            TotalDataLength(blob_parts))),
+      type_(options.type()) {
+  DCHECK(settings);
+  uint8* destination = static_cast<uint8*>(buffer_reference_.value().Data());
   size_t offset = 0;
   for (script::Sequence<BlobPart>::size_type i = 0; i < blob_parts.size();
        ++i) {
-    const uint8* source = DataStart(blob_parts.at(i));
-    uint64 count = DataLength(blob_parts.at(i));
+    const uint8* source =
+        static_cast<const uint8*>(DataStart(blob_parts.at(i)));
+    size_t count = DataLength(blob_parts.at(i));
 
     std::copy(source, source + count, destination + offset);
     offset += count;
   }
 }
 
-void Blob::TraceMembers(script::Tracer* tracer) { tracer->Trace(buffer_); }
-
 const BlobPropertyBag& Blob::EmptyBlobPropertyBag() {
   return empty_blob_property_bag.Get();
 }
diff --git a/src/cobalt/dom/blob.h b/src/cobalt/dom/blob.h
index 577f898..5d4c2ae 100644
--- a/src/cobalt/dom/blob.h
+++ b/src/cobalt/dom/blob.h
@@ -19,10 +19,10 @@
 #include <string>
 #include <vector>
 
-#include "cobalt/dom/array_buffer.h"
-#include "cobalt/dom/array_buffer_view.h"
-#include "cobalt/dom/data_view.h"
 #include "cobalt/dom/url_registry.h"
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
+#include "cobalt/script/data_view.h"
 #include "cobalt/script/environment_settings.h"
 #include "cobalt/script/sequence.h"
 #include "cobalt/script/union_type.h"
@@ -44,29 +44,40 @@
 class Blob : public script::Wrappable {
  public:
   typedef UrlRegistry<Blob> Registry;
-  typedef script::UnionType4<
-      scoped_refptr<ArrayBuffer>, scoped_refptr<ArrayBufferView>,
-      scoped_refptr<DataView>, scoped_refptr<Blob> > BlobPart;
+  typedef script::UnionType4<script::Handle<script::ArrayBuffer>,
+                             script::Handle<script::ArrayBufferView>,
+                             script::Handle<script::DataView>,
+                             scoped_refptr<Blob> >
+      BlobPart;
 
+  // settings is non-nullable.
   Blob(script::EnvironmentSettings* settings,
-       const scoped_refptr<ArrayBuffer>& buffer = NULL);
+       const script::Handle<script::ArrayBuffer>& buffer =
+           script::Handle<script::ArrayBuffer>(),
+       const BlobPropertyBag& options = EmptyBlobPropertyBag());
 
+  // settings is non-nullable.
   Blob(script::EnvironmentSettings* settings,
        const script::Sequence<BlobPart>& blob_parts,
        const BlobPropertyBag& options = EmptyBlobPropertyBag());
 
-  const uint8* data() { return buffer_->data(); }
+  const uint8* data() {
+    return static_cast<uint8*>(buffer_reference_.value().Data());
+  }
 
-  uint64 size() const { return static_cast<uint64>(buffer_->byte_length()); }
+  uint64 size() const {
+    return static_cast<uint64>(buffer_reference_.value().ByteLength());
+  }
+
+  const std::string& type() const { return type_; }
 
   DEFINE_WRAPPABLE_TYPE(Blob);
-  void TraceMembers(script::Tracer* tracer) override;
 
  private:
   static const BlobPropertyBag& EmptyBlobPropertyBag();
 
-  scoped_refptr<ArrayBuffer> buffer_;
-  const std::string type_;
+  script::ScriptValue<script::ArrayBuffer>::Reference buffer_reference_;
+  std::string type_;
 
   DISALLOW_COPY_AND_ASSIGN(Blob);
 };
diff --git a/src/cobalt/dom/blob.idl b/src/cobalt/dom/blob.idl
index 1f495fe..e7c1d0a 100644
--- a/src/cobalt/dom/blob.idl
+++ b/src/cobalt/dom/blob.idl
@@ -22,6 +22,6 @@
 ]
 interface Blob {
   readonly attribute unsigned long long size;
-  // TODO: Expose type and use for blob fetching and decoding.
-  // readonly attribute DOMString type;
-};
\ No newline at end of file
+  // TODO: Use for blob fetching and decoding.
+  readonly attribute DOMString type;
+};
diff --git a/src/cobalt/dom/blob_test.cc b/src/cobalt/dom/blob_test.cc
index 8b0016e..4b22fb7 100644
--- a/src/cobalt/dom/blob_test.cc
+++ b/src/cobalt/dom/blob_test.cc
@@ -15,7 +15,9 @@
 #include <algorithm>
 
 #include "cobalt/dom/blob.h"
-#include "cobalt/dom/data_view.h"
+#include "cobalt/dom/dom_settings.h"
+#include "cobalt/dom/testing/stub_window.h"
+#include "cobalt/script/data_view.h"
 #include "cobalt/script/testing/mock_exception_state.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -24,22 +26,30 @@
 namespace {
 
 using script::testing::MockExceptionState;
-using testing::_;
-using testing::SaveArg;
-using testing::StrictMock;
+using ::testing::_;
+using ::testing::SaveArg;
+using ::testing::StrictMock;
 
 TEST(BlobTest, Constructors) {
-  scoped_refptr<Blob> blob_default_buffer = new Blob(NULL);
+  // Initialize JavaScriptEngine and its environment.
+  testing::StubWindow stub_window;
+  script::GlobalEnvironment* global_environment =
+      stub_window.global_environment();
+  script::EnvironmentSettings* environment_settings =
+      stub_window.environment_settings();
+
+  script::Handle<script::ArrayBuffer> array_buffer =
+      script::ArrayBuffer::New(global_environment, 5);
+  scoped_refptr<Blob> blob_default_buffer = new Blob(environment_settings);
 
   EXPECT_EQ(0, blob_default_buffer->size());
 
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer = new ArrayBuffer(NULL, 5);
-  scoped_refptr<DataView> data_view =
-      new DataView(array_buffer, &exception_state);
-  data_view->SetInt16(0, static_cast<int16>(0x0607), &exception_state);
-  data_view->SetInt16(3, static_cast<int16>(0x7BCD), &exception_state);
-  scoped_refptr<Blob> blob_with_buffer = new Blob(NULL, array_buffer);
+  script::Handle<script::DataView> data_view = script::DataView::New(
+      global_environment, array_buffer, 0, array_buffer->ByteLength());
+  uint8 test_data[] = {0x06, 0x07, 0x00, 0x7B, 0xCD};
+  SbMemoryCopy(data_view->RawData(), test_data, 5);
+  scoped_refptr<Blob> blob_with_buffer =
+      new Blob(environment_settings, array_buffer);
 
   ASSERT_EQ(5, blob_with_buffer->size());
   ASSERT_TRUE(blob_with_buffer->data());
@@ -50,13 +60,13 @@
   EXPECT_EQ(0x7B, blob_with_buffer->data()[3]);
   EXPECT_EQ(0xCD, blob_with_buffer->data()[4]);
 
-  scoped_refptr<DataView> data_view_mid_3 =
-      new DataView(array_buffer, 1, 3, &exception_state);
+  script::Handle<script::DataView> data_view_mid_3 =
+      script::DataView::New(global_environment, array_buffer, 1, 3);
   script::Sequence<Blob::BlobPart> parts;
   parts.push_back(Blob::BlobPart(blob_with_buffer));
   parts.push_back(Blob::BlobPart(data_view_mid_3));
   parts.push_back(Blob::BlobPart(array_buffer));
-  scoped_refptr<Blob> blob_with_parts = new Blob(NULL, parts);
+  scoped_refptr<Blob> blob_with_parts = new Blob(environment_settings, parts);
 
   ASSERT_EQ(13UL, blob_with_parts->size());
   ASSERT_TRUE(blob_with_parts->data());
@@ -70,20 +80,33 @@
 // Tests that further changes to a buffer from which a blob was constructed
 // no longer affect the blob's buffer, since it must be a separate copy of
 // its construction arguments.
-TEST(BlobTest, HasOwnBuffer) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer = new ArrayBuffer(NULL, 2);
-  scoped_refptr<DataView> data_view =
-      new DataView(array_buffer, &exception_state);
-  data_view->SetInt16(0, static_cast<int16>(0x0607), &exception_state);
 
-  scoped_refptr<Blob> blob_with_buffer = new Blob(NULL, array_buffer);
+TEST(BlobTest, HasOwnBuffer) {
+  // Initialize JavaScriptEngine and its environment.
+  testing::StubWindow stub_window;
+  script::GlobalEnvironment* global_environment =
+      stub_window.global_environment();
+  script::EnvironmentSettings* environment_settings =
+      stub_window.environment_settings();
+  StrictMock<MockExceptionState> exception_state;
+
+  script::Handle<script::ArrayBuffer> array_buffer =
+      script::ArrayBuffer::New(global_environment, 2);
+  script::Handle<script::DataView> data_view = script::DataView::New(
+      global_environment, array_buffer, 0, array_buffer->ByteLength());
+
+  uint8 test_data[2] = {0x06, 0x07};
+  SbMemoryCopy(data_view->RawData(), test_data, 2);
+
+  scoped_refptr<Blob> blob_with_buffer =
+      new Blob(environment_settings, array_buffer);
 
   ASSERT_EQ(2, blob_with_buffer->size());
   ASSERT_TRUE(blob_with_buffer->data());
-  EXPECT_NE(array_buffer->data(), blob_with_buffer->data());
+  EXPECT_NE(array_buffer->Data(), blob_with_buffer->data());
 
-  data_view->SetUint8(1, static_cast<uint8>(0xff), &exception_state);
+  uint8 test_data2[1] = {0xff};
+  memcpy(data_view->RawData(), test_data2, 1);
 
   EXPECT_EQ(0x6, blob_with_buffer->data()[0]);
   EXPECT_EQ(0x7, blob_with_buffer->data()[1]);
diff --git a/src/cobalt/dom/buffer_source.cc b/src/cobalt/dom/buffer_source.cc
index e94d6a1..2c4d518 100644
--- a/src/cobalt/dom/buffer_source.cc
+++ b/src/cobalt/dom/buffer_source.cc
@@ -15,8 +15,6 @@
 #include "cobalt/dom/buffer_source.h"
 
 #include "base/logging.h"
-#include "cobalt/dom/array_buffer.h"
-#include "cobalt/dom/array_buffer_view.h"
 
 namespace cobalt {
 namespace dom {
@@ -26,16 +24,19 @@
   DCHECK(buffer);
   DCHECK(buffer_size);
 
-  if (buffer_source.IsType<scoped_refptr<ArrayBufferView> >()) {
-    scoped_refptr<ArrayBufferView> array_buffer_view =
-        buffer_source.AsType<scoped_refptr<ArrayBufferView> >();
-    *buffer = static_cast<const uint8*>(array_buffer_view->base_address());
-    *buffer_size = array_buffer_view->byte_length();
-  } else if (buffer_source.IsType<scoped_refptr<ArrayBuffer> >()) {
-    scoped_refptr<ArrayBuffer> array_buffer =
-        buffer_source.AsType<scoped_refptr<ArrayBuffer> >();
-    *buffer = array_buffer->data();
-    *buffer_size = array_buffer->byte_length();
+  if (buffer_source.IsType<script::Handle<script::ArrayBufferView> >()) {
+    script::Handle<script::ArrayBufferView> array_buffer_view =
+        buffer_source.AsType<script::Handle<script::ArrayBufferView> >();
+    *buffer = static_cast<const uint8*>(array_buffer_view->RawData());
+    DCHECK_LT(array_buffer_view->ByteLength(),
+              static_cast<const size_t>(INT_MAX));
+    *buffer_size = static_cast<int>(array_buffer_view->ByteLength());
+  } else if (buffer_source.IsType<script::Handle<script::ArrayBuffer> >()) {
+    script::Handle<script::ArrayBuffer> array_buffer =
+        buffer_source.AsType<script::Handle<script::ArrayBuffer> >();
+    *buffer = static_cast<const uint8*>(array_buffer->Data());
+    DCHECK_LT(array_buffer->ByteLength(), static_cast<const size_t>(INT_MAX));
+    *buffer_size = static_cast<int>(array_buffer->ByteLength());
   } else {
     NOTREACHED();
     *buffer = NULL;
diff --git a/src/cobalt/dom/buffer_source.h b/src/cobalt/dom/buffer_source.h
index cb8e6a5..99327d0 100644
--- a/src/cobalt/dom/buffer_source.h
+++ b/src/cobalt/dom/buffer_source.h
@@ -15,16 +15,16 @@
 #ifndef COBALT_DOM_BUFFER_SOURCE_H_
 #define COBALT_DOM_BUFFER_SOURCE_H_
 
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/union_type.h"
 
 namespace cobalt {
 namespace dom {
 
-class ArrayBuffer;
-class ArrayBufferView;
-
-typedef script::UnionType2<scoped_refptr<ArrayBufferView>,
-                           scoped_refptr<ArrayBuffer> > BufferSource;
+typedef script::UnionType2<script::Handle<script::ArrayBufferView>,
+                           script::Handle<script::ArrayBuffer> >
+    BufferSource;
 
 void GetBufferAndSize(const BufferSource& buffer_source, const uint8** buffer,
                       int* buffer_size);
diff --git a/src/cobalt/dom/crypto.cc b/src/cobalt/dom/crypto.cc
index fd31655..8c2e8f0 100644
--- a/src/cobalt/dom/crypto.cc
+++ b/src/cobalt/dom/crypto.cc
@@ -22,26 +22,26 @@
 
 // https://www.w3.org/TR/WebCryptoAPI/#dfn-Crypto-method-getRandomValues
 // static
-scoped_refptr<ArrayBufferView> Crypto::GetRandomValues(
-    const scoped_refptr<ArrayBufferView>& array,
+script::Handle<script::ArrayBufferView> Crypto::GetRandomValues(
+    const script::Handle<script::ArrayBufferView>& array,
     script::ExceptionState* exception_state) {
   // If the length of the array in bytes exceeds the following constant,
   // getRandomValues() should raise QuotaExceedErr instead of filling the array
   // with random values.
   uint32 kMaxArrayLengthInBytes = 65536;
-  if (!array) {
+  if (array.IsEmpty()) {
     // TODO: Also throw exception if element type of the array is
     // not one of the integer types.
     DOMException::Raise(DOMException::kTypeMismatchErr, exception_state);
     // Return value should be ignored.
-    return NULL;
+    return script::Handle<script::ArrayBufferView>();
   }
-  if (array->byte_length() > kMaxArrayLengthInBytes) {
+  if (array->ByteLength() > kMaxArrayLengthInBytes) {
     DOMException::Raise(DOMException::kQuotaExceededErr, exception_state);
     // Return value should be ignored.
-    return NULL;
+    return script::Handle<script::ArrayBufferView>();
   }
-  ::crypto::RandBytes(array->base_address(), array->byte_length());
+  ::crypto::RandBytes(array->RawData(), array->ByteLength());
   return array;
 }
 
diff --git a/src/cobalt/dom/crypto.h b/src/cobalt/dom/crypto.h
index 605652b..d79c0e0 100644
--- a/src/cobalt/dom/crypto.h
+++ b/src/cobalt/dom/crypto.h
@@ -15,7 +15,7 @@
 #ifndef COBALT_DOM_CRYPTO_H_
 #define COBALT_DOM_CRYPTO_H_
 
-#include "cobalt/dom/array_buffer_view.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/exception_state.h"
 #include "cobalt/script/wrappable.h"
 
@@ -32,8 +32,8 @@
  public:
   // Web API:Crypto
   //
-  static scoped_refptr<dom::ArrayBufferView> GetRandomValues(
-      const scoped_refptr<dom::ArrayBufferView>& array,
+  static script::Handle<script::ArrayBufferView> GetRandomValues(
+      const script::Handle<script::ArrayBufferView>& array,
       script::ExceptionState* exception_state);
 
   DEFINE_WRAPPABLE_TYPE(Crypto);
diff --git a/src/cobalt/dom/crypto_test.cc b/src/cobalt/dom/crypto_test.cc
index 568e9a1..3b360c3 100644
--- a/src/cobalt/dom/crypto_test.cc
+++ b/src/cobalt/dom/crypto_test.cc
@@ -15,11 +15,14 @@
 #include "cobalt/dom/crypto.h"
 
 #include "cobalt/base/polymorphic_downcast.h"
-#include "cobalt/dom/array_buffer_view.h"
 #include "cobalt/dom/dom_exception.h"
-#include "cobalt/dom/uint8_array.h"
+#include "cobalt/dom/dom_settings.h"
+#include "cobalt/script/array_buffer_view.h"
+#include "cobalt/script/global_environment.h"
+#include "cobalt/script/javascript_engine.h"
 #include "cobalt/script/script_exception.h"
 #include "cobalt/script/testing/mock_exception_state.h"
+#include "cobalt/script/typed_arrays.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace cobalt {
@@ -35,30 +38,46 @@
 
 TEST(CryptoTest, GetRandomValues) {
   StrictMock<MockExceptionState> exception_state;
-
-  scoped_refptr<Uint8Array> array1 = new Uint8Array(NULL, 16, &exception_state);
-  scoped_refptr<Uint8Array> array2 = new Uint8Array(NULL, 16, &exception_state);
-  for (uint32 i = 0; i < array1->length(); ++i) {
-    DCHECK_EQ(0, array1->Get(i));
+  scoped_ptr<script::JavaScriptEngine> javascript_engine =
+      script::JavaScriptEngine::CreateEngine();
+  scoped_refptr<script::GlobalEnvironment> global_environment =
+      javascript_engine->CreateGlobalEnvironment();
+  global_environment->CreateGlobalObject();
+  script::Handle<script::Uint8Array> array1 =
+      script::Uint8Array::New(global_environment, 16);
+  script::Handle<script::Uint8Array> array2 =
+      script::Uint8Array::New(global_environment, 16);
+  auto* array1_data = static_cast<uint8*>(array1->RawData());
+  for (uint32 i = 0; i < array1->Length(); ++i) {
+    DCHECK_EQ(0, array1_data[i]);
   }
-  for (uint32 i = 0; i < array2->length(); ++i) {
-    DCHECK_EQ(0, array2->Get(i));
+  auto* array2_data = static_cast<uint8*>(array2->RawData());
+  for (uint32 i = 0; i < array2->Length(); ++i) {
+    DCHECK_EQ(0, array2_data[i]);
   }
 
   scoped_refptr<Crypto> crypto = new Crypto;
-  scoped_refptr<ArrayBufferView> result =
-      crypto->GetRandomValues(array1, &exception_state);
-  EXPECT_EQ(array1, result);
 
-  result = crypto->GetRandomValues(array2, &exception_state);
-  EXPECT_EQ(array2, result);
+  script::Handle<script::ArrayBufferView> casted_array1 =
+      script::ArrayBufferView::New(global_environment, *array1);
+
+  script::Handle<script::ArrayBufferView> result =
+      crypto->GetRandomValues(casted_array1, &exception_state);
+  EXPECT_TRUE(
+      casted_array1.GetScriptValue()->EqualTo(*(result.GetScriptValue())));
+
+  script::Handle<script::ArrayBufferView> casted_array2 =
+      script::ArrayBufferView::New(global_environment, *array2);
+  result = crypto->GetRandomValues(casted_array2, &exception_state);
+  EXPECT_TRUE(
+      casted_array2.GetScriptValue()->EqualTo(*(result.GetScriptValue())));
 
   // This check is theoretically flaky as the two random sequences could be
   // the same.  But the probability is extremely low and we do want to catch
   // the case when the two sequences are the same.
   bool all_equal = true;
-  for (uint32 i = 0; i < array1->length(); ++i) {
-    if (array1->Get(i) != array2->Get(i)) {
+  for (uint32 i = 0; i < array1->Length(); ++i) {
+    if (array1_data[i] != array2_data[i]) {
       all_equal = false;
       break;
     }
@@ -71,13 +90,19 @@
   scoped_refptr<Crypto> crypto = new Crypto;
   StrictMock<MockExceptionState> exception_state;
   scoped_refptr<script::ScriptException> exception;
+  scoped_ptr<script::JavaScriptEngine> javascript_engine =
+      script::JavaScriptEngine::CreateEngine();
+  scoped_refptr<script::GlobalEnvironment> global_environment =
+      javascript_engine->CreateGlobalEnvironment();
+  global_environment->CreateGlobalObject();
 
   EXPECT_CALL(exception_state, SetException(_))
       .WillOnce(SaveArg<0>(&exception));
 
-  scoped_refptr<ArrayBufferView> result =
-      crypto->GetRandomValues(NULL, &exception_state);
-  EXPECT_FALSE(result);
+  script::Handle<script::ArrayBufferView> empty_handle;
+  script::Handle<script::ArrayBufferView> result =
+      crypto->GetRandomValues(empty_handle, &exception_state);
+  EXPECT_TRUE(result.IsEmpty());
   ASSERT_TRUE(exception);
   EXPECT_EQ(DOMException::kTypeMismatchErr,
             base::polymorphic_downcast<DOMException*>(exception.get())->code());
@@ -88,25 +113,35 @@
   // QuotaExceededErr.
   scoped_refptr<Crypto> crypto = new Crypto;
   StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<Uint8Array> array65537 =
-      new Uint8Array(NULL, 65537, &exception_state);
+  scoped_ptr<script::JavaScriptEngine> javascript_engine =
+      script::JavaScriptEngine::CreateEngine();
+  scoped_refptr<script::GlobalEnvironment> global_environment =
+      javascript_engine->CreateGlobalEnvironment();
+  global_environment->CreateGlobalObject();
+  script::Handle<script::Uint8Array> array65537 =
+      script::Uint8Array::New(global_environment, 65537);
   scoped_refptr<script::ScriptException> exception;
 
   EXPECT_CALL(exception_state, SetException(_))
       .WillOnce(SaveArg<0>(&exception));
 
-  scoped_refptr<ArrayBufferView> result =
-      crypto->GetRandomValues(array65537, &exception_state);
-  EXPECT_FALSE(result);
+  script::Handle<script::ArrayBufferView> casted_array65537 =
+      script::ArrayBufferView::New(global_environment, *array65537);
+  script::Handle<script::ArrayBufferView> result =
+      crypto->GetRandomValues(casted_array65537, &exception_state);
+  EXPECT_TRUE(result.IsEmpty());
   ASSERT_TRUE(exception);
   EXPECT_EQ(DOMException::kQuotaExceededErr,
             base::polymorphic_downcast<DOMException*>(exception.get())->code());
 
   // Also ensure that we can work with array whose length is exactly 65536.
-  scoped_refptr<Uint8Array> array65536 =
-      new Uint8Array(NULL, 65536, &exception_state);
-  result = crypto->GetRandomValues(array65536, &exception_state);
-  EXPECT_EQ(array65536, result);
+  script::Handle<script::Uint8Array> array65536 =
+      script::Uint8Array::New(global_environment, 65536);
+  script::Handle<script::ArrayBufferView> casted_array65536 =
+      script::ArrayBufferView::New(global_environment, *array65536);
+  result = crypto->GetRandomValues(casted_array65536, &exception_state);
+  EXPECT_TRUE(
+      casted_array65536.GetScriptValue()->EqualTo(*(result.GetScriptValue())));
 }
 
 }  // namespace dom
diff --git a/src/cobalt/dom/data_view.cc b/src/cobalt/dom/data_view.cc
deleted file mode 100644
index ff65632..0000000
--- a/src/cobalt/dom/data_view.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "cobalt/dom/data_view.h"
-
-namespace cobalt {
-namespace dom {
-
-DataView::DataView(const scoped_refptr<ArrayBuffer>& buffer,
-                   script::ExceptionState* exception_state)
-    : buffer_(buffer),
-      byte_offset_(0),
-      byte_length_(buffer ? buffer->byte_length() : 0) {
-  if (!buffer) {
-    exception_state->SetSimpleException(script::kNotAnArrayBuffer);
-  }
-}
-
-DataView::DataView(const scoped_refptr<ArrayBuffer>& buffer, uint32 byte_offset,
-                   script::ExceptionState* exception_state)
-    : buffer_(buffer),
-      byte_offset_(byte_offset),
-      byte_length_(buffer ? buffer->byte_length() - byte_offset : 0) {
-  if (!buffer) {
-    exception_state->SetSimpleException(script::kNotAnArrayBuffer);
-  } else if (byte_offset_ > buffer_->byte_length()) {
-    exception_state->SetSimpleException(script::kOutsideBounds);
-  }
-}
-
-DataView::DataView(const scoped_refptr<ArrayBuffer>& buffer, uint32 byte_offset,
-                   uint32 byte_length, script::ExceptionState* exception_state)
-    : buffer_(buffer), byte_offset_(byte_offset), byte_length_(byte_length) {
-  if (!buffer) {
-    exception_state->SetSimpleException(script::kNotAnArrayBuffer);
-  } else if (byte_offset_ > buffer_->byte_length()) {
-    exception_state->SetSimpleException(script::kOutsideBounds);
-  } else if (byte_offset_ + byte_length_ > buffer_->byte_length()) {
-    exception_state->SetSimpleException(script::kInvalidLength);
-  }
-}
-
-void DataView::TraceMembers(script::Tracer* tracer) { tracer->Trace(buffer_); }
-
-}  // namespace dom
-}  // namespace cobalt
diff --git a/src/cobalt/dom/data_view.h b/src/cobalt/dom/data_view.h
deleted file mode 100644
index 102970a..0000000
--- a/src/cobalt/dom/data_view.h
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef COBALT_DOM_DATA_VIEW_H_
-#define COBALT_DOM_DATA_VIEW_H_
-
-#include <algorithm>
-#include <iterator>
-
-#include "build/build_config.h"
-#include "cobalt/dom/array_buffer.h"
-#include "cobalt/script/exception_state.h"
-#include "cobalt/script/wrappable.h"
-
-namespace cobalt {
-namespace dom {
-
-// DataView is used to access the underlying ArrayBuffer with support of common
-// types and endianness.
-//   https://www.khronos.org/registry/typedarray/specs/latest/#8
-class DataView : public script::Wrappable {
- public:
-  // Web API: DataView
-  //
-  DataView(const scoped_refptr<ArrayBuffer>& buffer,
-           script::ExceptionState* exception_state);
-  DataView(const scoped_refptr<ArrayBuffer>& buffer, uint32 byte_offset,
-           script::ExceptionState* exception_state);
-  DataView(const scoped_refptr<ArrayBuffer>& buffer, uint32 byte_offset,
-           uint32 byte_length, script::ExceptionState* exception_state);
-
-// C++ macro to generate accessor for each supported types.
-#define DATA_VIEW_ACCESSOR_FOR_EACH(MacroOp)                                \
-  MacroOp(Int8, int8) MacroOp(Uint8, uint8) MacroOp(Int16, int16)           \
-      MacroOp(Uint16, uint16) MacroOp(Int32, int32) MacroOp(Uint32, uint32) \
-      MacroOp(Float32, float) MacroOp(Float64, double)
-
-// The following macro generates the accessors for each types listed above.
-// According to the spec, For getter without an endianness parameter it is
-// default to big endian.  Note that it may generate extra accessors for
-// int8/uint8 which has an 'little_endian' parameter, this is redundant but
-// should work as int8/uint8 behalf the same when accessed in any endian mode.
-#define DEFINE_DATA_VIEW_ACCESSOR(DomType, CppType)                          \
-  CppType Get##DomType(uint32 byte_offset,                                   \
-                       script::ExceptionState* exception_state) const {      \
-    return Get##DomType(byte_offset, false, exception_state);                \
-  }                                                                          \
-  CppType Get##DomType(uint32 byte_offset, bool little_endian,               \
-                       script::ExceptionState* exception_state) const {      \
-    return GetElement<CppType>(byte_offset, little_endian, exception_state); \
-  }                                                                          \
-  void Set##DomType(uint32 byte_offset, CppType value,                       \
-                    script::ExceptionState* exception_state) {               \
-    Set##DomType(byte_offset, value, false, exception_state);                \
-  }                                                                          \
-  void Set##DomType(uint32 byte_offset, CppType value, bool little_endian,   \
-                    script::ExceptionState* exception_state) {               \
-    SetElement<CppType>(byte_offset, value, little_endian, exception_state); \
-  }
-
-  DATA_VIEW_ACCESSOR_FOR_EACH(DEFINE_DATA_VIEW_ACCESSOR)
-#undef DEFINE_DATA_VIEW_ACCESSOR
-
-  // Web API: ArrayBufferView (implements)
-  //
-  const scoped_refptr<ArrayBuffer>& buffer() { return buffer_; }
-  uint32 byte_offset() const { return byte_offset_; }
-  uint32 byte_length() const { return byte_length_; }
-
-  DEFINE_WRAPPABLE_TYPE(DataView);
-  void TraceMembers(script::Tracer* tracer) override;
-
- private:
-  static void CopyBytes(const uint8* src, size_t size, bool little_endian,
-                        uint8* dest) {
-#if defined(ARCH_CPU_LITTLE_ENDIAN)
-    bool need_reverse = !little_endian;
-#else   // defined(ARCH_CPU_LITTLE_ENDIAN)
-    bool need_reverse = little_endian;
-#endif  // defined(ARCH_CPU_LITTLE_ENDIAN)
-    if (need_reverse) {
-#if defined(COMPILER_MSVC)
-      std::reverse_copy(src, src + size,
-                        stdext::checked_array_iterator<uint8*>(dest, size));
-#else  // defined(COMPILER_MSVC)
-      std::reverse_copy(src, src + size, dest);
-#endif  // defined(COMPILER_MSVC)
-    } else {
-      memcpy(dest, src, size);
-    }
-  }
-
-  template <typename ElementType>
-  ElementType GetElement(uint32 byte_offset, bool little_endian,
-                         script::ExceptionState* exception_state) const {
-    if (byte_offset + sizeof(ElementType) > byte_length_) {
-      exception_state->SetSimpleException(script::kOutsideBounds);
-      // The return value will be ignored.
-      return ElementType();
-    }
-    ElementType value;
-    CopyBytes(buffer_->data() + byte_offset_ + byte_offset, sizeof(value),
-              little_endian, reinterpret_cast<uint8*>(&value));
-    return value;
-  }
-
-  template <typename ElementType>
-  void SetElement(uint32 byte_offset, ElementType value, bool little_endian,
-                  script::ExceptionState* exception_state) {
-    if (byte_offset + sizeof(ElementType) > byte_length_) {
-      exception_state->SetSimpleException(script::kOutsideBounds);
-      return;
-    }
-    CopyBytes(reinterpret_cast<uint8*>(&value), sizeof(value), little_endian,
-              buffer_->data() + byte_offset_ + byte_offset);
-  }
-
-  const scoped_refptr<ArrayBuffer> buffer_;
-  const uint32 byte_offset_;
-  const uint32 byte_length_;
-
-  DISALLOW_COPY_AND_ASSIGN(DataView);
-};
-
-}  // namespace dom
-}  // namespace cobalt
-
-#endif  // COBALT_DOM_DATA_VIEW_H_
diff --git a/src/cobalt/dom/data_view.idl b/src/cobalt/dom/data_view.idl
deleted file mode 100644
index 9be562e..0000000
--- a/src/cobalt/dom/data_view.idl
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// https://www.khronos.org/registry/typedarray/specs/latest/#8
-
-[
-  Constructor(ArrayBuffer buffer, optional unsigned long byteOffset,
-              optional unsigned long byteLength),
-  RaisesException=Constructor
-]
-interface DataView {
-  [RaisesException] byte getInt8(unsigned long byteOffset);
-  [RaisesException] octet getUint8(unsigned long byteOffset);
-  [RaisesException] short getInt16(unsigned long byteOffset,
-                                   optional boolean littleEndian);
-  [RaisesException] unsigned short getUint16(unsigned long byteOffset,
-                                             optional boolean littleEndian);
-  [RaisesException] long getInt32(unsigned long byteOffset,
-                                  optional boolean littleEndian);
-  [RaisesException] unsigned long getUint32(unsigned long byteOffset,
-                                            optional boolean littleEndian);
-  [RaisesException] float getFloat32(unsigned long byteOffset,
-                                     optional boolean littleEndian);
-  [RaisesException] double getFloat64(unsigned long byteOffset,
-                                      optional boolean littleEndian);
-
-  [RaisesException] void setInt8(unsigned long byteOffset, byte value);
-  [RaisesException] void setUint8(unsigned long byteOffset, octet value);
-  [RaisesException] void setInt16(unsigned long byteOffset, short value,
-                                  optional boolean littleEndian);
-  [RaisesException] void setUint16(unsigned long byteOffset,
-                                   unsigned short value,
-                                   optional boolean littleEndian);
-  [RaisesException] void setInt32(unsigned long byteOffset, long value,
-                                  optional boolean littleEndian);
-  [RaisesException] void setUint32(unsigned long byteOffset,
-                                   unsigned long value,
-                                   optional boolean littleEndian);
-  [RaisesException] void setFloat32(unsigned long byteOffset, float value,
-                                    optional boolean littleEndian);
-  [RaisesException] void setFloat64(unsigned long byteOffset, double value,
-                                    optional boolean littleEndian);
-};
-
-DataView implements ArrayBufferView;
diff --git a/src/cobalt/dom/data_view_test.cc b/src/cobalt/dom/data_view_test.cc
deleted file mode 100644
index d32bdcf..0000000
--- a/src/cobalt/dom/data_view_test.cc
+++ /dev/null
@@ -1,292 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "cobalt/dom/data_view.h"
-
-#include <algorithm>
-
-#include "cobalt/script/testing/mock_exception_state.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace cobalt {
-namespace dom {
-namespace {
-
-using script::testing::MockExceptionState;
-using testing::_;
-using testing::SaveArg;
-using testing::StrictMock;
-
-TEST(DataViewTest, Constructors) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer = new ArrayBuffer(NULL, 10);
-
-  scoped_refptr<DataView> data_view =
-      new DataView(array_buffer, &exception_state);
-  EXPECT_EQ(array_buffer, data_view->buffer());
-  EXPECT_EQ(0, data_view->byte_offset());
-  EXPECT_EQ(array_buffer->byte_length(), data_view->byte_length());
-
-  data_view = new DataView(array_buffer, 1, &exception_state);
-  EXPECT_EQ(array_buffer, data_view->buffer());
-  EXPECT_EQ(1, data_view->byte_offset());
-  EXPECT_EQ(array_buffer->byte_length(),
-            data_view->byte_offset() + data_view->byte_length());
-
-  data_view = new DataView(array_buffer, 1, 5, &exception_state);
-  EXPECT_EQ(array_buffer, data_view->buffer());
-  EXPECT_EQ(1, data_view->byte_offset());
-  EXPECT_EQ(5, data_view->byte_length());
-}
-
-// DataView whose byte_length is 0 is allowed.
-TEST(DataViewTest, ConstructingEmptyDataView) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer = new ArrayBuffer(NULL, 0);
-
-  scoped_refptr<DataView> data_view =
-      new DataView(array_buffer, &exception_state);
-  EXPECT_EQ(0, data_view->byte_length());
-
-  data_view = new DataView(array_buffer, 0, &exception_state);
-  EXPECT_EQ(0, data_view->byte_length());
-
-  data_view = new DataView(array_buffer, 0, 0, &exception_state);
-  EXPECT_EQ(0, data_view->byte_length());
-}
-
-TEST(DataViewTest, ExceptionInConstructors) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer = new ArrayBuffer(NULL, 10);
-
-  EXPECT_CALL(exception_state, SetSimpleExceptionVA(script::kTypeError, _, _));
-  scoped_refptr<DataView> data_view = new DataView(NULL, &exception_state);
-
-  EXPECT_CALL(exception_state, SetSimpleExceptionVA(script::kRangeError, _, _));
-  data_view = new DataView(array_buffer, array_buffer->byte_length() + 1,
-                           &exception_state);
-
-  EXPECT_CALL(exception_state, SetSimpleExceptionVA(script::kRangeError, _, _));
-  data_view = new DataView(array_buffer, 0, array_buffer->byte_length() + 1,
-                           &exception_state);
-}
-
-TEST(DataViewTest, Getters) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer = new ArrayBuffer(NULL, 13);
-  scoped_refptr<DataView> data_view =
-      new DataView(array_buffer, &exception_state);
-
-// For test of each type, we write 0 to the data that is going to be read and
-// 0xff to the data that won't be read.  So all values we read out will be 0.
-#define DEFINE_DATA_VIEW_GETTER_TEST(DomType, CppType)                        \
-  {                                                                           \
-    memset(array_buffer->data(), 0, sizeof(CppType));                         \
-    memset(array_buffer->data() + sizeof(CppType), 0xff,                      \
-           array_buffer->byte_length() - sizeof(CppType));                    \
-    CppType value = data_view->Get##DomType(0, &exception_state);             \
-    EXPECT_EQ(0, value);                                                      \
-                                                                              \
-    memset(array_buffer->data(), 0xff,                                        \
-           array_buffer->byte_length() - sizeof(CppType));                    \
-    memset(                                                                   \
-        array_buffer->data() + array_buffer->byte_length() - sizeof(CppType), \
-        0, sizeof(CppType));                                                  \
-    value = data_view->Get##DomType(                                          \
-        array_buffer->byte_length() - sizeof(CppType), &exception_state);     \
-    EXPECT_EQ(0, value);                                                      \
-  }
-  DATA_VIEW_ACCESSOR_FOR_EACH(DEFINE_DATA_VIEW_GETTER_TEST)
-#undef DEFINE_DATA_VIEW_GETTER_TEST
-}
-
-TEST(DataViewTest, GettersWithException) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer = new ArrayBuffer(NULL, 13);
-  scoped_refptr<DataView> data_view =
-      new DataView(array_buffer, &exception_state);
-
-#define DEFINE_DATA_VIEW_GETTER_WITH_EXCEPTION_TEST(DomType, CppType)          \
-  {                                                                            \
-    EXPECT_CALL(exception_state,                                               \
-                SetSimpleExceptionVA(script::kRangeError, _, _));              \
-    data_view->Get##DomType(array_buffer->byte_length() - sizeof(CppType) + 1, \
-                            &exception_state);                                 \
-  }
-  DATA_VIEW_ACCESSOR_FOR_EACH(DEFINE_DATA_VIEW_GETTER_WITH_EXCEPTION_TEST)
-#undef DEFINE_DATA_VIEW_GETTER_WITH_EXCEPTION_TEST
-}
-
-TEST(DataViewTest, GettersWithOffset) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer = new ArrayBuffer(NULL, 13);
-  scoped_refptr<DataView> data_view =
-      new DataView(array_buffer, 3, &exception_state);
-
-// For test of each type, we write 0 to the data that is going to be read and
-// 0xff to the data that won't be read.  So all values we read out will be 0.
-#define DEFINE_DATA_VIEW_GETTER_WITH_OFFSET_TEST(DomType, CppType)   \
-  {                                                                  \
-    memset(array_buffer->data(), 0xff, array_buffer->byte_length()); \
-    memset(array_buffer->data() + data_view->byte_offset(), 0x0,     \
-           sizeof(CppType));                                         \
-    CppType value = data_view->Get##DomType(0, &exception_state);    \
-    EXPECT_EQ(0, value);                                             \
-  }
-  DATA_VIEW_ACCESSOR_FOR_EACH(DEFINE_DATA_VIEW_GETTER_WITH_OFFSET_TEST)
-#undef DEFINE_DATA_VIEW_GETTER_WITH_OFFSET_TEST
-}
-
-TEST(DataViewTest, Setters) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer = new ArrayBuffer(NULL, 13);
-  scoped_refptr<DataView> data_view =
-      new DataView(array_buffer, &exception_state);
-
-// For test of each type, we fill the array_buffer to 0xff and then set the
-// value of the particular index to 0.  Then we read it out to verify that it
-// is indeed 0.
-#define DEFINE_DATA_VIEW_SETTER_TEST(DomType, CppType)                        \
-  {                                                                           \
-    memset(array_buffer->data(), 0xff, array_buffer->byte_length());          \
-    data_view->Set##DomType(0, 0, &exception_state);                          \
-    CppType value = data_view->Get##DomType(0, &exception_state);             \
-    EXPECT_EQ(0, value);                                                      \
-                                                                              \
-    memset(array_buffer->data(), 0xff, array_buffer->byte_length());          \
-    data_view->Set##DomType(array_buffer->byte_length() - sizeof(CppType), 0, \
-                            &exception_state);                                \
-    value = data_view->Get##DomType(                                          \
-        array_buffer->byte_length() - sizeof(CppType), &exception_state);     \
-    EXPECT_EQ(0, value);                                                      \
-  }
-  DATA_VIEW_ACCESSOR_FOR_EACH(DEFINE_DATA_VIEW_SETTER_TEST)
-#undef DEFINE_DATA_VIEW_SETTER_TEST
-}
-
-TEST(DataViewTest, SettersWithException) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer = new ArrayBuffer(NULL, 13);
-  scoped_refptr<DataView> data_view =
-      new DataView(array_buffer, &exception_state);
-
-#define DEFINE_DATA_VIEW_SETTER_WITH_EXCEPTION_TEST(DomType, CppType)          \
-  {                                                                            \
-    EXPECT_CALL(exception_state,                                               \
-                SetSimpleExceptionVA(script::kRangeError, _, _));              \
-    data_view->Set##DomType(array_buffer->byte_length() - sizeof(CppType) + 1, \
-                            0, &exception_state);                              \
-  }
-  DATA_VIEW_ACCESSOR_FOR_EACH(DEFINE_DATA_VIEW_SETTER_WITH_EXCEPTION_TEST)
-#undef DEFINE_DATA_VIEW_SETTER_WITH_EXCEPTION_TEST
-}
-
-TEST(DataViewTest, SettersWithOffset) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer = new ArrayBuffer(NULL, 13);
-  scoped_refptr<DataView> data_view =
-      new DataView(array_buffer, 3, &exception_state);
-
-// For test of each type, we fill the array_buffer to 0xff and then set the
-// value at the particular index to 0.  Then we read it out to verify that it
-// is indeed 0.
-#define DEFINE_DATA_VIEW_SETTER_WITH_OFFSET_TEST(DomType, CppType)   \
-  {                                                                  \
-    memset(array_buffer->data(), 0xff, array_buffer->byte_length()); \
-    data_view->Set##DomType(0, 0, &exception_state);                 \
-    CppType value = data_view->Get##DomType(0, &exception_state);    \
-    EXPECT_EQ(0, value);                                             \
-  }
-  DATA_VIEW_ACCESSOR_FOR_EACH(DEFINE_DATA_VIEW_SETTER_WITH_OFFSET_TEST)
-#undef DEFINE_DATA_VIEW_SETTER_WITH_OFFSET_TEST
-}
-
-TEST(DataViewTest, GetterSetterEndianness) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer = new ArrayBuffer(NULL, 13);
-  scoped_refptr<DataView> data_view =
-      new DataView(array_buffer, 3, &exception_state);
-
-// For test of each type, we set the value at the particular index to 1.  Then
-// we read it out to verify that it is indeed 1.  This assumes that the memory
-// layout of 1 of any type in little endian is reversed to its memory layout
-// in big endian.  Note that when the endianness flag is true, it means little
-// endian, and when endianess is not set, it is default to big endian.
-#define DEFINE_DATA_VIEW_GETTER_SETTER_ENDIANNESS_TEST(DomType, CppType) \
-  {                                                                      \
-    data_view->Set##DomType(0, 1, true, &exception_state);               \
-    CppType value = data_view->Get##DomType(0, true, &exception_state);  \
-    EXPECT_EQ(1, value);                                                 \
-                                                                         \
-    data_view->Set##DomType(0, 1, &exception_state);                     \
-    value = data_view->Get##DomType(0, false, &exception_state);         \
-    EXPECT_EQ(1, value);                                                 \
-                                                                         \
-    data_view->Set##DomType(0, 1, false, &exception_state);              \
-    value = data_view->Get##DomType(0, &exception_state);                \
-    EXPECT_EQ(1, value);                                                 \
-                                                                         \
-    data_view->Set##DomType(0, 1, false, &exception_state);              \
-    value = data_view->Get##DomType(0, false, &exception_state);         \
-    EXPECT_EQ(1, value);                                                 \
-                                                                         \
-    data_view->Set##DomType(0, 1, true, &exception_state);               \
-    value = data_view->Get##DomType(0, false, &exception_state);         \
-    std::reverse(reinterpret_cast<uint8*>(&value),                       \
-                 reinterpret_cast<uint8*>(&value) + sizeof(value));      \
-    EXPECT_EQ(1, value);                                                 \
-                                                                         \
-    data_view->Set##DomType(0, 1, false, &exception_state);              \
-    value = data_view->Get##DomType(0, true, &exception_state);          \
-    std::reverse(reinterpret_cast<uint8*>(&value),                       \
-                 reinterpret_cast<uint8*>(&value) + sizeof(value));      \
-    EXPECT_EQ(1, value);                                                 \
-  }
-  DATA_VIEW_ACCESSOR_FOR_EACH(DEFINE_DATA_VIEW_GETTER_SETTER_ENDIANNESS_TEST)
-#undef DEFINE_DATA_VIEW_GETTER_SETTER_ENDIANNESS_TEST
-}
-
-TEST(DataViewTest, PlatformEndianness) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer = new ArrayBuffer(NULL, 13);
-  scoped_refptr<DataView> data_view =
-      new DataView(array_buffer, 3, &exception_state);
-
-#if defined(ARCH_CPU_LITTLE_ENDIAN)
-  const bool kCpuIsLittleEndian = true;
-#else  // defined(ARCH_CPU_LITTLE_ENDIAN)
-  const bool kCpuIsLittleEndian = false;
-#endif  // defined(ARCH_CPU_LITTLE_ENDIAN)
-
-// For test of each type, we write 0x00, 0x01, ... to the array_buffer and
-// verify the read out value with platform endianness taking into account.
-#define DEFINE_DATA_VIEW_PLATFORM_ENDIANNESS_TEST(DomType, CppType)       \
-  {                                                                       \
-    for (uint32 i = 0; i < sizeof(CppType); ++i) {                        \
-      array_buffer->data()[data_view->byte_offset() + i] =                \
-          static_cast<uint8>(i);                                          \
-    }                                                                     \
-    CppType value =                                                       \
-        data_view->Get##DomType(0, kCpuIsLittleEndian, &exception_state); \
-    EXPECT_EQ(0, memcmp(reinterpret_cast<uint8*>(&value),                 \
-                        array_buffer->data() + data_view->byte_offset(),  \
-                        sizeof(value)));                                  \
-  }
-  DATA_VIEW_ACCESSOR_FOR_EACH(DEFINE_DATA_VIEW_PLATFORM_ENDIANNESS_TEST)
-#undef DEFINE_DATA_VIEW_PLATFORM_ENDIANNESS_TEST
-}
-
-}  // namespace
-}  // namespace dom
-}  // namespace cobalt
diff --git a/src/cobalt/dom/dom.gyp b/src/cobalt/dom/dom.gyp
index 4f0154c..b7ff788 100644
--- a/src/cobalt/dom/dom.gyp
+++ b/src/cobalt/dom/dom.gyp
@@ -24,10 +24,6 @@
         'animation_event.h',
         'animation_frame_request_callback_list.cc',
         'animation_frame_request_callback_list.h',
-        'array_buffer.cc',
-        'array_buffer.h',
-        'array_buffer_view.cc',
-        'array_buffer_view.h',
         'attr.cc',
         'attr.h',
         'audio_track.h',
@@ -67,8 +63,6 @@
         'css_transitions_adapter.cc',
         'css_transitions_adapter.h',
         'custom_event.h',
-        'data_view.cc',
-        'data_view.h',
         'device_orientation_event.cc',
         'device_orientation_event.h',
         'device_orientation_event_init.h',
@@ -107,8 +101,6 @@
         'event_queue.h',
         'event_target.cc',
         'event_target.h',
-        'float32_array.h',
-        'float64_array.h',
         'focus_event.cc',
         'focus_event.h',
         'focus_event_init.h',
@@ -271,13 +263,11 @@
         'track_default_list.h',
         'track_event.h',
         'transition_event.h',
-        'typed_array.h',
         'ui_event.cc',
         'ui_event.h',
         'ui_event_init.h',
         'ui_event_with_key_state.cc',
         'ui_event_with_key_state.h',
-        'uint8_array.h',
         'url.cc',
         'url.h',
         'url_registry.h',
diff --git a/src/cobalt/dom/dom_settings.h b/src/cobalt/dom/dom_settings.h
index e2e0932..11f0a45 100644
--- a/src/cobalt/dom/dom_settings.h
+++ b/src/cobalt/dom/dom_settings.h
@@ -17,7 +17,6 @@
 
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "cobalt/dom/array_buffer.h"
 #include "cobalt/dom/blob.h"
 #include "cobalt/dom/mutation_observer_task_manager.h"
 #include "cobalt/dom/url_registry.h"
diff --git a/src/cobalt/dom/dom_test.gyp b/src/cobalt/dom/dom_test.gyp
index 5ab6948..df2c6fa 100644
--- a/src/cobalt/dom/dom_test.gyp
+++ b/src/cobalt/dom/dom_test.gyp
@@ -29,7 +29,6 @@
         'crypto_test.cc',
         'csp_delegate_test.cc',
         'custom_event_test.cc',
-        'data_view_test.cc',
         'document_test.cc',
         'document_type_test.cc',
         'dom_implementation_test.cc',
@@ -42,8 +41,6 @@
         'event_queue_test.cc',
         'event_target_test.cc',
         'event_test.cc',
-        'float32_array_test.cc',
-        'float64_array_test.cc',
         'font_cache_test.cc',
         'html_element_factory_test.cc',
         'html_element_test.cc',
@@ -65,7 +62,6 @@
         'storage_area_test.cc',
         'text_test.cc',
         'time_ranges_test.cc',
-        'typed_array_test.cc',
         'url_utils_test.cc',
         'window_test.cc',
         'xml_document_test.cc',
diff --git a/src/cobalt/dom/eme/media_encrypted_event.cc b/src/cobalt/dom/eme/media_encrypted_event.cc
index 6d18b45..128d8a5 100644
--- a/src/cobalt/dom/eme/media_encrypted_event.cc
+++ b/src/cobalt/dom/eme/media_encrypted_event.cc
@@ -28,13 +28,12 @@
 MediaEncryptedEvent::MediaEncryptedEvent(
     const std::string& type, const MediaEncryptedEventInit& event_init_dict)
     : Event(base::Token(type), kNotBubbles, kNotCancelable),
-      init_data_type_(event_init_dict.init_data_type()),
-      init_data_(event_init_dict.init_data()) {}
-
-void MediaEncryptedEvent::TraceMembers(script::Tracer* tracer) {
-  Event::TraceMembers(tracer);
-
-  tracer->Trace(init_data_);
+      init_data_type_(event_init_dict.init_data_type()) {
+  if (event_init_dict.init_data() && !event_init_dict.init_data()->IsNull()) {
+    init_data_reference_.reset(
+        new script::ScriptValue<script::ArrayBuffer>::Reference(
+            this, *event_init_dict.init_data()));
+  }
 }
 
 }  // namespace eme
diff --git a/src/cobalt/dom/eme/media_encrypted_event.h b/src/cobalt/dom/eme/media_encrypted_event.h
index ada3098..18489f1 100644
--- a/src/cobalt/dom/eme/media_encrypted_event.h
+++ b/src/cobalt/dom/eme/media_encrypted_event.h
@@ -18,9 +18,9 @@
 #include <string>
 
 #include "base/memory/ref_counted.h"
-#include "cobalt/dom/array_buffer.h"
 #include "cobalt/dom/eme/media_encrypted_event_init.h"
 #include "cobalt/dom/event.h"
+#include "cobalt/script/array_buffer.h"
 #include "cobalt/script/wrappable.h"
 
 namespace cobalt {
@@ -39,14 +39,19 @@
                       const MediaEncryptedEventInit& event_init_dict);
 
   const std::string& init_data_type() const { return init_data_type_; }
-  const scoped_refptr<ArrayBuffer>& init_data() const { return init_data_; }
+  script::Handle<script::ArrayBuffer> init_data() const {
+    if (!init_data_reference_) {
+      return script::Handle<script::ArrayBuffer>();
+    }
+    return script::Handle<script::ArrayBuffer>(*init_data_reference_);
+  }
 
   DEFINE_WRAPPABLE_TYPE(MediaEncryptedEvent);
-  void TraceMembers(script::Tracer* tracer) override;
 
  private:
   std::string init_data_type_;
-  scoped_refptr<ArrayBuffer> init_data_;
+  scoped_ptr<script::ScriptValue<script::ArrayBuffer>::Reference>
+      init_data_reference_;
 };
 
 }  // namespace eme
diff --git a/src/cobalt/dom/eme/media_key_message_event.cc b/src/cobalt/dom/eme/media_key_message_event.cc
index e79e36a..04f8c55 100644
--- a/src/cobalt/dom/eme/media_key_message_event.cc
+++ b/src/cobalt/dom/eme/media_key_message_event.cc
@@ -26,13 +26,7 @@
     const std::string& type, const MediaKeyMessageEventInit& event_init_dict)
     : Event(base::Token(type), kNotBubbles, kNotCancelable),
       message_type_(event_init_dict.message_type()),
-      message_(event_init_dict.message()) {}
-
-void MediaKeyMessageEvent::TraceMembers(script::Tracer* tracer) {
-  Event::TraceMembers(tracer);
-
-  tracer->Trace(message_);
-}
+      message_reference_(this, *event_init_dict.message()) {}
 
 }  // namespace eme
 }  // namespace dom
diff --git a/src/cobalt/dom/eme/media_key_message_event.h b/src/cobalt/dom/eme/media_key_message_event.h
index 5003033..e722af9 100644
--- a/src/cobalt/dom/eme/media_key_message_event.h
+++ b/src/cobalt/dom/eme/media_key_message_event.h
@@ -18,10 +18,10 @@
 #include <string>
 
 #include "base/memory/ref_counted.h"
-#include "cobalt/dom/array_buffer.h"
 #include "cobalt/dom/eme/media_key_message_event_init.h"
 #include "cobalt/dom/eme/media_key_message_type.h"
 #include "cobalt/dom/event.h"
+#include "cobalt/script/array_buffer.h"
 #include "cobalt/script/wrappable.h"
 
 namespace cobalt {
@@ -39,14 +39,15 @@
                        const MediaKeyMessageEventInit& event_init_dict);
 
   MediaKeyMessageType message_type() const { return message_type_; }
-  const scoped_refptr<ArrayBuffer>& message() const { return message_; }
+  script::Handle<script::ArrayBuffer> message() const {
+    return script::Handle<script::ArrayBuffer>(message_reference_);
+  }
 
   DEFINE_WRAPPABLE_TYPE(MediaKeyMessageEvent);
-  void TraceMembers(script::Tracer* tracer) override;
 
  private:
   MediaKeyMessageType message_type_;
-  scoped_refptr<ArrayBuffer> message_;
+  script::ScriptValue<script::ArrayBuffer>::Reference message_reference_;
 };
 
 }  // namespace eme
diff --git a/src/cobalt/dom/eme/media_key_session.cc b/src/cobalt/dom/eme/media_key_session.cc
index ad995c3..869380f 100644
--- a/src/cobalt/dom/eme/media_key_session.cc
+++ b/src/cobalt/dom/eme/media_key_session.cc
@@ -16,13 +16,15 @@
 
 #include <type_traits>
 
-#include "cobalt/dom/array_buffer.h"
-#include "cobalt/dom/array_buffer_view.h"
+#include "base/polymorphic_downcast.h"
 #include "cobalt/dom/dom_exception.h"
+#include "cobalt/dom/dom_settings.h"
 #include "cobalt/dom/eme/eme_helpers.h"
 #include "cobalt/dom/eme/media_key_message_event.h"
 #include "cobalt/dom/eme/media_key_message_event_init.h"
 #include "cobalt/dom/eme/media_keys.h"
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/script_value_factory.h"
 
 namespace cobalt {
@@ -98,7 +100,8 @@
 // See
 // https://www.w3.org/TR/encrypted-media/#dom-mediakeysession-generaterequest.
 script::Handle<script::Promise<void>> MediaKeySession::GenerateRequest(
-    const std::string& init_data_type, const BufferSource& init_data) {
+    script::EnvironmentSettings* settings, const std::string& init_data_type,
+    const BufferSource& init_data) {
   script::Handle<script::Promise<void>> promise =
       script_value_factory_->CreateBasicPromise<void>();
 
@@ -137,7 +140,7 @@
   drm_system_session_->GenerateUpdateRequest(
       init_data_type, init_data_buffer, init_data_buffer_size,
       base::Bind(&MediaKeySession::OnSessionUpdateRequestGenerated,
-                 base::AsWeakPtr(this),
+                 base::AsWeakPtr(this), settings,
                  base::Owned(new VoidPromiseValue::Reference(this, promise))),
       base::Bind(&MediaKeySession::OnSessionUpdateRequestDidNotGenerate,
                  base::AsWeakPtr(this),
@@ -233,9 +236,15 @@
 // See
 // https://www.w3.org/TR/encrypted-media/#dom-mediakeysession-generaterequest.
 void MediaKeySession::OnSessionUpdateRequestGenerated(
+    script::EnvironmentSettings* settings,
     VoidPromiseValue::Reference* promise_reference,
     SbDrmSessionRequestType type, scoped_array<uint8> message,
     int message_size) {
+  DCHECK(settings);
+  DOMSettings* dom_settings =
+      base::polymorphic_downcast<DOMSettings*>(settings);
+  auto* global_environment = dom_settings->global_environment();
+  DCHECK(global_environment);
   MediaKeyMessageEventInit media_key_message_event_init;
   // 10.9.4. If a license request for the requested license type can be
   //         generated based on the sanitized init data:
@@ -247,7 +256,8 @@
   //           a license request request for the requested license type can be
   //           generated based on the sanitized init data.
   media_key_message_event_init.set_message(
-      new ArrayBuffer(NULL, message.Pass(), message_size));
+      script::ArrayBuffer::New(global_environment, message.get(), message_size)
+          .GetScriptValue());
   // 10.9.4.2. Let message type reflect the type of message, either
   //           "license-request" or "individualization-request".
   //
diff --git a/src/cobalt/dom/eme/media_key_session.h b/src/cobalt/dom/eme/media_key_session.h
index 4a026a3..89df1dd 100644
--- a/src/cobalt/dom/eme/media_key_session.h
+++ b/src/cobalt/dom/eme/media_key_session.h
@@ -26,6 +26,7 @@
 #include "cobalt/dom/event_queue.h"
 #include "cobalt/dom/event_target.h"
 #include "cobalt/media/base/drm_system.h"
+#include "cobalt/script/environment_settings.h"
 #include "cobalt/script/promise.h"
 #include "cobalt/script/script_value_factory.h"
 #include "starboard/drm.h"
@@ -58,7 +59,8 @@
   const EventListenerScriptValue* onmessage() const;
   void set_onmessage(const EventListenerScriptValue& event_listener);
   script::Handle<script::Promise<void>> GenerateRequest(
-      const std::string& init_data_type, const BufferSource& init_data);
+      script::EnvironmentSettings* settings, const std::string& init_data_type,
+      const BufferSource& init_data);
   script::Handle<script::Promise<void>> Update(const BufferSource& response);
   script::Handle<script::Promise<void>> Close();
 
@@ -69,6 +71,7 @@
   ~MediaKeySession() override;
 
   void OnSessionUpdateRequestGenerated(
+      script::EnvironmentSettings* settings,
       VoidPromiseValue::Reference* promise_reference,
       SbDrmSessionRequestType type, scoped_array<uint8> message,
       int message_size);
diff --git a/src/cobalt/dom/eme/media_key_session.idl b/src/cobalt/dom/eme/media_key_session.idl
index 8e6ac14..2fac371 100644
--- a/src/cobalt/dom/eme/media_key_session.idl
+++ b/src/cobalt/dom/eme/media_key_session.idl
@@ -22,8 +22,7 @@
   readonly attribute MediaKeyStatusMap keyStatuses;
   attribute EventHandler onkeystatuseschange;
   attribute EventHandler onmessage;
-  Promise<void> generateRequest(DOMString initDataType,
-                                BufferSource initData);
+  [CallWith=EnvironmentSettings] Promise<void> generateRequest(DOMString initDataType, BufferSource initData);
   // TODO: Trivially implement persistent sessions.
   // Promise<boolean> load(DOMString sessionId);
   Promise<void> update(BufferSource response);
diff --git a/src/cobalt/dom/eme/media_key_status_map.cc b/src/cobalt/dom/eme/media_key_status_map.cc
index a950197..8234e6a 100644
--- a/src/cobalt/dom/eme/media_key_status_map.cc
+++ b/src/cobalt/dom/eme/media_key_status_map.cc
@@ -15,8 +15,10 @@
 #include "cobalt/dom/eme/media_key_status_map.h"
 
 #include "base/logging.h"
-#include "cobalt/dom/array_buffer.h"
-#include "cobalt/dom/array_buffer_view.h"
+#include "base/polymorphic_downcast.h"
+#include "cobalt/dom/dom_settings.h"
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
 
 namespace cobalt {
 namespace dom {
@@ -56,10 +58,14 @@
   return "internal-error";
 }
 
-BufferSource ConvertStringToBufferSource(const std::string& str) {
-  scoped_refptr<ArrayBuffer> array_buffer =
-      new ArrayBuffer(NULL, reinterpret_cast<const uint8*>(str.c_str()),
-                      static_cast<uint32>(str.size()));
+BufferSource ConvertStringToBufferSource(script::EnvironmentSettings* settings,
+                                         const std::string& str) {
+  DCHECK(settings);
+  DOMSettings* dom_settings =
+      base::polymorphic_downcast<dom::DOMSettings*>(settings);
+  DCHECK(dom_settings->global_environment());
+  script::Handle<script::ArrayBuffer> array_buffer = script::ArrayBuffer::New(
+      dom_settings->global_environment(), str.data(), str.size());
   return BufferSource(array_buffer);
 }
 
@@ -72,12 +78,14 @@
   key_statuses_[key_id] = key_status;
 }
 
-void MediaKeyStatusMap::ForEach(const ForEachCallbackArg& callback) {
+void MediaKeyStatusMap::ForEach(script::EnvironmentSettings* settings,
+                                const ForEachCallbackArg& callback) {
   ForEachCallbackArg::Reference reference(this, callback);
 
   for (auto& key_status : key_statuses_) {
-    reference.value().Run(ConvertKeyStatusToString(key_status.second),
-                          ConvertStringToBufferSource(key_status.first), this);
+    reference.value().Run(
+        ConvertKeyStatusToString(key_status.second),
+        ConvertStringToBufferSource(settings, key_status.first), this);
   }
 }
 
diff --git a/src/cobalt/dom/eme/media_key_status_map.h b/src/cobalt/dom/eme/media_key_status_map.h
index 812ad90..3be97f5 100644
--- a/src/cobalt/dom/eme/media_key_status_map.h
+++ b/src/cobalt/dom/eme/media_key_status_map.h
@@ -22,6 +22,7 @@
 #include "cobalt/dom/buffer_source.h"
 #include "cobalt/dom/eme/media_key_status.h"
 #include "cobalt/script/callback_function.h"
+#include "cobalt/script/environment_settings.h"
 #include "cobalt/script/script_value.h"
 #include "cobalt/script/wrappable.h"
 
@@ -64,7 +65,8 @@
     return key_statuses_.find(key_id_copy) != key_statuses_.end();
   }
 
-  void ForEach(const ForEachCallbackArg& callback);
+  void ForEach(script::EnvironmentSettings* settings,
+               const ForEachCallbackArg& callback);
 
   DEFINE_WRAPPABLE_TYPE(MediaKeyStatusMap);
 
diff --git a/src/cobalt/dom/eme/media_key_status_map.idl b/src/cobalt/dom/eme/media_key_status_map.idl
index 58a963f..4c3a338 100644
--- a/src/cobalt/dom/eme/media_key_status_map.idl
+++ b/src/cobalt/dom/eme/media_key_status_map.idl
@@ -19,7 +19,7 @@
   readonly attribute unsigned long size;
   boolean has(BufferSource keyId);
   any get(BufferSource keyId);
-  void forEach(ForEachCallback callback);
+  [CallWith=EnvironmentSettings] void forEach(ForEachCallback callback);
 };
 
 callback ForEachCallback = void (DOMString status, BufferSource key, MediaKeyStatusMap map);
diff --git a/src/cobalt/dom/float32_array.h b/src/cobalt/dom/float32_array.h
deleted file mode 100644
index 3798586..0000000
--- a/src/cobalt/dom/float32_array.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef COBALT_DOM_FLOAT32_ARRAY_H_
-#define COBALT_DOM_FLOAT32_ARRAY_H_
-
-#include "cobalt/dom/typed_array.h"
-
-namespace cobalt {
-namespace dom {
-
-DEFINE_TYPED_ARRAY(Float32Array, float);
-
-}  // namespace dom
-}  // namespace cobalt
-
-#endif  // COBALT_DOM_FLOAT32_ARRAY_H_
diff --git a/src/cobalt/dom/float32_array.idl b/src/cobalt/dom/float32_array.idl
deleted file mode 100644
index 0039ec1..0000000
--- a/src/cobalt/dom/float32_array.idl
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// https://www.khronos.org/registry/typedarray/specs/latest/#7
-
-[
-  Constructor(unsigned long length),
-  Constructor(Float32Array array),
-  Constructor(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length),
-  ConstructorCallWith=EnvironmentSettings,
-  RaisesException=Constructor
-]
-interface Float32Array : ArrayBufferView {
-  const unsigned long BYTES_PER_ELEMENT = 4;
-
-  readonly attribute unsigned long length;
-
-  getter unrestricted float get(unsigned long index);
-  setter void set(unsigned long index, unrestricted float value);
-
-  // Return a new Float32Array that is a view on top of this one.
-  // Contains this[start]..this[end]. end defaults to length if unspecified.
-  [CallWith=EnvironmentSettings] Float32Array subarray(long start, optional long end);
-};
diff --git a/src/cobalt/dom/float32_array_test.cc b/src/cobalt/dom/float32_array_test.cc
deleted file mode 100644
index ad75544..0000000
--- a/src/cobalt/dom/float32_array_test.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "cobalt/dom/float32_array.h"
-
-#include <limits>
-
-#include "cobalt/script/testing/mock_exception_state.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-// Note that most of the basic functionalities are already tested inside
-// typed_array_test.cc This file only includes tests that are very specific to
-// Float32Array.
-
-namespace cobalt {
-namespace dom {
-namespace {
-
-using script::testing::MockExceptionState;
-using testing::StrictMock;
-
-// Sanity check that we can actually store float values and get them back.
-TEST(Float32Array, SetGetFloat) {
-  static const uint32 kLength = 5;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<Float32Array> array =
-      new Float32Array(NULL, kLength, &exception_state);
-  float values[kLength];
-
-  // Use an array to keep the values to avoid any floating point inaccuracy.
-  for (uint32 i = 0; i < kLength; ++i) {
-    values[i] = static_cast<float>(i) / 10.f;
-    array->Set(i, values[i]);
-  }
-
-  for (uint32 i = 0; i < kLength; ++i) {
-    EXPECT_EQ(values[i], array->Get(i));
-  }
-}
-
-// The Float32Array supports float values like Infinity and NaN.
-TEST(Float32Array, UnrestrictedFloatValues) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<Float32Array> array =
-      new Float32Array(NULL, 1, &exception_state);
-
-  array->Set(0, std::numeric_limits<float>::infinity());
-  EXPECT_EQ(std::numeric_limits<float>::infinity(), array->Get(0));
-
-  array->Set(0, -std::numeric_limits<float>::infinity());
-  EXPECT_EQ(-std::numeric_limits<float>::infinity(), array->Get(0));
-
-  array->Set(0, std::numeric_limits<float>::quiet_NaN());
-  // std::isnan() is not available in C++98.  So we compare it against itself
-  // to check if it is a NaN as NaN == NaN returns false.
-  EXPECT_FALSE(array->Get(0) == array->Get(0));
-}
-
-}  // namespace
-}  // namespace dom
-}  // namespace cobalt
diff --git a/src/cobalt/dom/float64_array.h b/src/cobalt/dom/float64_array.h
deleted file mode 100644
index 3a1dfc3..0000000
--- a/src/cobalt/dom/float64_array.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef COBALT_DOM_FLOAT64_ARRAY_H_
-#define COBALT_DOM_FLOAT64_ARRAY_H_
-
-#include "cobalt/dom/typed_array.h"
-
-namespace cobalt {
-namespace dom {
-
-DEFINE_TYPED_ARRAY(Float64Array, double);
-
-}  // namespace dom
-}  // namespace cobalt
-
-#endif  // COBALT_DOM_FLOAT64_ARRAY_H_
diff --git a/src/cobalt/dom/float64_array.idl b/src/cobalt/dom/float64_array.idl
deleted file mode 100644
index 324a920..0000000
--- a/src/cobalt/dom/float64_array.idl
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// https://www.khronos.org/registry/typedarray/specs/latest/#7
-
-[
-  Constructor(unsigned long length),
-  Constructor(Float64Array array),
-  Constructor(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length),
-  ConstructorCallWith=EnvironmentSettings,
-  RaisesException=Constructor
-]
-interface Float64Array : ArrayBufferView {
-  const unsigned long BYTES_PER_ELEMENT = 8;
-
-  readonly attribute unsigned long length;
-
-  getter unrestricted double get(unsigned long index);
-  setter void set(unsigned long index, unrestricted double value);
-
-  // Return a new Float64Array that is a view on top of this one.
-  // Contains this[start]..this[end]. end defaults to length if unspecified.
-  [CallWith=EnvironmentSettings] Float64Array subarray(long start, optional long end);
-};
diff --git a/src/cobalt/dom/float64_array_test.cc b/src/cobalt/dom/float64_array_test.cc
deleted file mode 100644
index 2a2bcfe..0000000
--- a/src/cobalt/dom/float64_array_test.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "cobalt/dom/float64_array.h"
-
-#include <limits>
-
-#include "cobalt/script/testing/mock_exception_state.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-// Note that most of the basic functionalities are already tested inside
-// typed_array_test.cc This file only includes tests that are very specific to
-// Float64Array.
-
-namespace cobalt {
-namespace dom {
-namespace {
-
-using script::testing::MockExceptionState;
-using testing::StrictMock;
-
-// Sanity check that we can actually store double values and get them back.
-TEST(Float64Array, SetGetDouble) {
-  static const uint32 kLength = 5;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<Float64Array> array =
-      new Float64Array(NULL, kLength, &exception_state);
-  double values[kLength];
-
-  // Use an array to keep the values to avoid any floating point inaccuracy.
-  for (uint32 i = 0; i < kLength; ++i) {
-    values[i] = static_cast<double>(i) / 10.;
-    array->Set(i, values[i]);
-  }
-
-  for (uint32 i = 0; i < kLength; ++i) {
-    EXPECT_EQ(values[i], array->Get(i));
-  }
-}
-
-// The Float64Array supports double values like Infinity and NaN.
-TEST(Float64Array, UnrestrictedDoubleValues) {
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<Float64Array> array =
-      new Float64Array(NULL, 1, &exception_state);
-
-  array->Set(0, std::numeric_limits<double>::infinity());
-  EXPECT_EQ(std::numeric_limits<double>::infinity(), array->Get(0));
-
-  array->Set(0, -std::numeric_limits<double>::infinity());
-  EXPECT_EQ(-std::numeric_limits<double>::infinity(), array->Get(0));
-
-  array->Set(0, std::numeric_limits<double>::quiet_NaN());
-  // std::isnan() is not available in C++98.  So we compare it against itself
-  // to check if it is a NaN as NaN == NaN returns false.
-  EXPECT_FALSE(array->Get(0) == array->Get(0));
-}
-
-}  // namespace
-}  // namespace dom
-}  // namespace cobalt
diff --git a/src/cobalt/dom/html_media_element.cc b/src/cobalt/dom/html_media_element.cc
index b7b404f..0474f42 100644
--- a/src/cobalt/dom/html_media_element.cc
+++ b/src/cobalt/dom/html_media_element.cc
@@ -382,7 +382,7 @@
 
 void HTMLMediaElement::GenerateKeyRequest(
     const std::string& key_system,
-    const base::optional<scoped_refptr<Uint8Array> >& init_data,
+    const script::Handle<script::Uint8Array>& init_data,
     script::ExceptionState* exception_state) {
   MLOG() << key_system;
   // https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1b/encrypted-media/encrypted-media.html#dom-generatekeyrequest
@@ -403,10 +403,10 @@
   // The rest is handled by WebMediaPlayer::GenerateKeyRequest().
   WebMediaPlayer::MediaKeyException exception;
 
-  if (init_data) {
-    scoped_refptr<const Uint8Array> const_init_data = init_data.value();
-    exception = player_->GenerateKeyRequest(key_system, const_init_data->data(),
-                                            const_init_data->length());
+  if (!init_data.IsEmpty()) {
+    exception =
+        player_->GenerateKeyRequest(key_system, init_data->Data(),
+                                    static_cast<unsigned>(init_data->Length()));
   } else {
     exception = player_->GenerateKeyRequest(key_system, NULL, 0);
   }
@@ -418,21 +418,22 @@
 }
 
 void HTMLMediaElement::AddKey(
-    const std::string& key_system, const scoped_refptr<const Uint8Array>& key,
-    const base::optional<scoped_refptr<Uint8Array> >& init_data,
+    const std::string& key_system,
+    const script::Handle<script::Uint8Array>& key,
+    const script::Handle<script::Uint8Array>& init_data,
     const base::optional<std::string>& session_id,
     script::ExceptionState* exception_state) {
   MLOG() << key_system;
   // https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1b/encrypted-media/encrypted-media.html#dom-addkey
   // 1. If the first or second argument is null, throw a SYNTAX_ERR.
-  if (key_system.empty() || !key) {
+  if (key_system.empty() || key.IsEmpty()) {
     MLOG() << "syntax error";
     DOMException::Raise(DOMException::kSyntaxErr, exception_state);
     return;
   }
 
   // 2. If the second argument is an empty array, throw a TYPE_MISMATCH_ERR.
-  if (!key->length()) {
+  if (!key->Length()) {
     MLOG() << "type mismatch error";
     DOMException::Raise(DOMException::kTypeMismatchErr, exception_state);
     return;
@@ -448,13 +449,14 @@
   // The rest is handled by WebMediaPlayer::AddKey().
   WebMediaPlayer::MediaKeyException exception;
 
-  if (init_data) {
-    scoped_refptr<const Uint8Array> const_init_data = init_data.value();
+  if (!init_data.IsEmpty()) {
     exception = player_->AddKey(
-        key_system, key->data(), key->length(), const_init_data->data(),
-        const_init_data->length(), session_id.value_or(""));
+        key_system, key->Data(), static_cast<unsigned>(key->Length()),
+        init_data->Data(), static_cast<unsigned>(init_data->Length()),
+        session_id.value_or(""));
   } else {
-    exception = player_->AddKey(key_system, key->data(), key->length(), NULL, 0,
+    exception = player_->AddKey(key_system, key->Data(),
+                                static_cast<unsigned>(key->Length()), NULL, 0,
                                 session_id.value_or(""));
   }
 
@@ -1869,8 +1871,12 @@
                    node_document()->location()->GetOriginAsObject())) {
     media_encrypted_event_init.set_init_data_type(
         ToInitDataTypeString(init_data_type));
+    auto* global_environment =
+        html_element_context()->script_runner()->GetGlobalEnvironment();
     media_encrypted_event_init.set_init_data(
-        new ArrayBuffer(NULL, init_data, init_data_length));
+        script::ArrayBuffer::New(global_environment, init_data,
+                                 init_data_length)
+            .GetScriptValue());
   }
   event_queue_.Enqueue(
       new eme::MediaEncryptedEvent("encrypted", media_encrypted_event_init));
@@ -1920,9 +1926,12 @@
                                   unsigned int message_length,
                                   const std::string& default_url) {
   MLOG() << key_system;
-  event_queue_.Enqueue(new MediaKeyMessageEvent(
-      key_system, session_id,
-      new Uint8Array(NULL, message, message_length, NULL), default_url));
+  auto* global_environment =
+      html_element_context()->script_runner()->GetGlobalEnvironment();
+  script::Handle<script::Uint8Array> array_copy =
+      script::Uint8Array::New(global_environment, message, message_length);
+  event_queue_.Enqueue(new MediaKeyMessageEvent(key_system, session_id,
+                                                array_copy, default_url));
 }
 
 void HTMLMediaElement::KeyNeeded(const std::string& key_system,
@@ -1930,9 +1939,12 @@
                                  const unsigned char* init_data,
                                  unsigned int init_data_length) {
   MLOG() << key_system;
-  event_queue_.Enqueue(new MediaKeyNeededEvent(
-      key_system, session_id,
-      new Uint8Array(NULL, init_data, init_data_length, NULL)));
+  auto* global_environment =
+      html_element_context()->script_runner()->GetGlobalEnvironment();
+  script::Handle<script::Uint8Array> array_copy =
+      script::Uint8Array::New(global_environment, init_data, init_data_length);
+  event_queue_.Enqueue(
+      new MediaKeyNeededEvent(key_system, session_id, array_copy));
 }
 
 #endif  // defined(COBALT_MEDIA_SOURCE_2016)
diff --git a/src/cobalt/dom/html_media_element.h b/src/cobalt/dom/html_media_element.h
index feff279..4fb9d9b 100644
--- a/src/cobalt/dom/html_media_element.h
+++ b/src/cobalt/dom/html_media_element.h
@@ -26,9 +26,9 @@
 #include "cobalt/dom/html_element.h"
 #include "cobalt/dom/media_error.h"
 #include "cobalt/dom/time_ranges.h"
-#include "cobalt/dom/uint8_array.h"
 #include "cobalt/loader/image/image_cache.h"
 #include "cobalt/script/exception_state.h"
+#include "cobalt/script/typed_arrays.h"
 #include "googleurl/src/gurl.h"
 #if defined(COBALT_MEDIA_SOURCE_2016)
 #include "cobalt/dom/eme/media_keys.h"
@@ -98,13 +98,12 @@
   script::Handle<script::Promise<void>> SetMediaKeys(
       const scoped_refptr<eme::MediaKeys>& media_keys);
 #else   // defined(COBALT_MEDIA_SOURCE_2016)
-  void GenerateKeyRequest(
-      const std::string& key_system,
-      const base::optional<scoped_refptr<Uint8Array> >& init_data,
-      script::ExceptionState* exception_state);
+  void GenerateKeyRequest(const std::string& key_system,
+                          const script::Handle<script::Uint8Array>& init_data,
+                          script::ExceptionState* exception_state);
   void AddKey(const std::string& key_system,
-              const scoped_refptr<const Uint8Array>& key,
-              const base::optional<scoped_refptr<Uint8Array> >& init_data,
+              const script::Handle<script::Uint8Array>& key,
+              const script::Handle<script::Uint8Array>& init_data,
               const base::optional<std::string>& session_id,
               script::ExceptionState* exception_state);
   void CancelKeyRequest(const std::string& key_system,
diff --git a/src/cobalt/dom/int16_array.h b/src/cobalt/dom/int16_array.h
deleted file mode 100644
index 354aece..0000000
--- a/src/cobalt/dom/int16_array.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2016 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef COBALT_DOM_INT16_ARRAY_H_
-#define COBALT_DOM_INT16_ARRAY_H_
-
-#include "cobalt/dom/typed_array.h"
-
-namespace cobalt {
-namespace dom {
-
-DEFINE_TYPED_ARRAY(Int16Array, int16);
-
-}  // namespace dom
-}  // namespace cobalt
-
-#endif  // COBALT_DOM_INT16_ARRAY_H_
diff --git a/src/cobalt/dom/int16_array.idl b/src/cobalt/dom/int16_array.idl
deleted file mode 100644
index a0d8626..0000000
--- a/src/cobalt/dom/int16_array.idl
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2016 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// https://www.khronos.org/registry/typedarray/specs/latest/#7
-[
-  Constructor(unsigned long length),
-  Constructor(Int16Array array),
-  Constructor(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length),
-  ConstructorCallWith=EnvironmentSettings,
-  RaisesException=Constructor
-]
-interface Int16Array : ArrayBufferView {
-  const unsigned long BYTES_PER_ELEMENT = 2;
-
-  readonly attribute unsigned long length;
-
-  getter short get(unsigned long index);
-  setter void set(unsigned long index, short value);
-
-  // TODO: When arrays or sequences are supported, support them here.
-  // void set(sequence<long> array, optional unsigned long offset);
-
-  // Copy items into this array from source, starting at this[offset].
-  [RaisesException] void set(Int16Array source, optional unsigned long offset);
-
-  // Return a new Int16Array that is a view on top of this one.
-  // Contains this[start]..this[end]. end defaults to length if unspecified.
-  [CallWith=EnvironmentSettings] Int16Array subarray(long start, optional long end);
-};
diff --git a/src/cobalt/dom/local_storage_database.cc b/src/cobalt/dom/local_storage_database.cc
index e573e81..d39dfeb 100644
--- a/src/cobalt/dom/local_storage_database.cc
+++ b/src/cobalt/dom/local_storage_database.cc
@@ -17,6 +17,7 @@
 #include "base/debug/trace_event.h"
 #include "cobalt/dom/storage_area.h"
 #include "cobalt/storage/storage_manager.h"
+#include "cobalt/storage/store/memory_store.h"
 #include "nb/memory_scope.h"
 
 namespace cobalt {
@@ -30,7 +31,7 @@
 }
 
 void LocalStorageReadValues(
-    const std::string& id,
+    const loader::Origin& origin,
     const LocalStorageDatabase::ReadCompletionCallback& callback,
     const storage::MemoryStore& memory_store) {
   LOG(INFO) << "LocalStorageReadValues";
@@ -38,27 +39,27 @@
 
   scoped_ptr<storage::MemoryStore::LocalStorageMap> values(
       new storage::MemoryStore::LocalStorageMap);
-  memory_store.ReadAllLocalStorage(id, values.get());
+  memory_store.ReadAllLocalStorage(origin, values.get());
   callback.Run(values.Pass());
 }
 
-void LocalStorageWrite(const std::string& id, const std::string& key,
+void LocalStorageWrite(const loader::Origin& origin, const std::string& key,
                        const std::string& value,
                        storage::MemoryStore* memory_store) {
   TRACK_MEMORY_SCOPE("Storage");
-  memory_store->WriteToLocalStorage(id, key, value);
+  memory_store->WriteToLocalStorage(origin, key, value);
 }
 
-void LocalStorageDelete(const std::string& id, const std::string& key,
+void LocalStorageDelete(const loader::Origin& origin, const std::string& key,
                         storage::MemoryStore* memory_store) {
   TRACK_MEMORY_SCOPE("Storage");
-  memory_store->DeleteFromLocalStorage(id, key);
+  memory_store->DeleteFromLocalStorage(origin, key);
 }
 
-void LocalStorageClear(const std::string& id,
+void LocalStorageClear(const loader::Origin& origin,
                        storage::MemoryStore* memory_store) {
   TRACK_MEMORY_SCOPE("Storage");
-  memory_store->ClearLocalStorage(id);
+  memory_store->ClearLocalStorage(origin);
 }
 }  // namespace
 
@@ -74,32 +75,33 @@
   }
 }
 
-void LocalStorageDatabase::ReadAll(const std::string& id,
+void LocalStorageDatabase::ReadAll(const loader::Origin& origin,
                                    const ReadCompletionCallback& callback) {
   TRACK_MEMORY_SCOPE("Storage");
   Init();
   storage_->WithReadOnlyMemoryStore(
-      base::Bind(&LocalStorageReadValues, id, callback));
+      base::Bind(&LocalStorageReadValues, origin, callback));
 }
 
-void LocalStorageDatabase::Write(const std::string& id, const std::string& key,
+void LocalStorageDatabase::Write(const loader::Origin& origin,
+                                 const std::string& key,
                                  const std::string& value) {
   TRACK_MEMORY_SCOPE("Storage");
   Init();
-  storage_->WithMemoryStore(base::Bind(&LocalStorageWrite, id, key, value));
+  storage_->WithMemoryStore(base::Bind(&LocalStorageWrite, origin, key, value));
 }
 
-void LocalStorageDatabase::Delete(const std::string& id,
+void LocalStorageDatabase::Delete(const loader::Origin& origin,
                                   const std::string& key) {
   TRACK_MEMORY_SCOPE("Storage");
   Init();
-  storage_->WithMemoryStore(base::Bind(&LocalStorageDelete, id, key));
+  storage_->WithMemoryStore(base::Bind(&LocalStorageDelete, origin, key));
 }
 
-void LocalStorageDatabase::Clear(const std::string& id) {
+void LocalStorageDatabase::Clear(const loader::Origin& origin) {
   TRACK_MEMORY_SCOPE("Storage");
   Init();
-  storage_->WithMemoryStore(base::Bind(&LocalStorageClear, id));
+  storage_->WithMemoryStore(base::Bind(&LocalStorageClear, origin));
 }
 
 void LocalStorageDatabase::Flush(const base::Closure& callback) {
diff --git a/src/cobalt/dom/local_storage_database.h b/src/cobalt/dom/local_storage_database.h
index 9a7c431..f28605d 100644
--- a/src/cobalt/dom/local_storage_database.h
+++ b/src/cobalt/dom/local_storage_database.h
@@ -19,6 +19,7 @@
 
 #include "base/callback.h"
 #include "cobalt/dom/storage_area.h"
+#include "cobalt/loader/origin.h"
 
 namespace cobalt {
 namespace storage {
@@ -27,11 +28,7 @@
 
 namespace dom {
 
-// Interacts with the StorageManager to read and write from the LocalStorage
-// table in the app's SQLite database.
-// The LocalStorageTable is made up of rows with three columns:
-// id, key, and value. The id is an origin identifier. Each StorageArea
-// has an id generated from the Window's origin.
+// Interacts with the StorageManager to read and write from the LocalStorage.
 class LocalStorageDatabase {
  public:
   typedef base::Callback<void(scoped_ptr<StorageArea::StorageMap>)>
@@ -39,15 +36,16 @@
 
   explicit LocalStorageDatabase(storage::StorageManager* storage);
 
-  // Load the LocalStorage SQL table from the Storage Manager, and extract
+  // Load the LocalStorage from the Storage Manager, and extract
   // all key/values for the given origin. Calls callback and transfers ownership
   // of the hash map.
-  void ReadAll(const std::string& id, const ReadCompletionCallback& callback);
+  void ReadAll(const loader::Origin& origin,
+               const ReadCompletionCallback& callback);
 
-  void Write(const std::string& id, const std::string& key,
+  void Write(const loader::Origin& origin, const std::string& key,
              const std::string& value);
-  void Delete(const std::string& id, const std::string& key);
-  void Clear(const std::string& id);
+  void Delete(const loader::Origin& origin, const std::string& key);
+  void Clear(const loader::Origin& origin);
   void Flush(const base::Closure& callback);
 
  private:
diff --git a/src/cobalt/dom/local_storage_database_test.cc b/src/cobalt/dom/local_storage_database_test.cc
index fd5a9c3..ef234eb 100644
--- a/src/cobalt/dom/local_storage_database_test.cc
+++ b/src/cobalt/dom/local_storage_database_test.cc
@@ -90,7 +90,7 @@
  protected:
   LocalStorageDatabaseTest()
       : message_loop_(MessageLoop::TYPE_DEFAULT),
-        host_("https://www.example.com") {
+        origin_(GURL("https://www.example.com")) {
     scoped_ptr<storage::StorageManager::UpgradeHandler> upgrade_handler(
         new DummyUpgradeHandler());
     storage::StorageManager::Options options;
@@ -109,7 +109,7 @@
   }
 
   MessageLoop message_loop_;
-  std::string host_;
+  loader::Origin origin_;
   scoped_ptr<storage::StorageManager> storage_manager_;
   scoped_ptr<LocalStorageDatabase> db_;
 };
@@ -118,7 +118,7 @@
 TEST_F(LocalStorageDatabaseTest, EmptyRead) {
   StorageArea::StorageMap empty;
   Reader reader;
-  db_->ReadAll(host_,
+  db_->ReadAll(origin_,
                base::Bind(&Reader::OnReadAll, base::Unretained(&reader)));
   message_loop_.RunUntilIdle();
   EXPECT_TRUE(reader.TimedWait());
@@ -132,7 +132,7 @@
 
   for (StorageArea::StorageMap::const_iterator it = test_vals.begin();
        it != test_vals.end(); ++it) {
-    db_->Write(host_, it->first, it->second);
+    db_->Write(origin_, it->first, it->second);
   }
 
   FlushWaiter waiter;
@@ -142,7 +142,7 @@
   // Ensure a Flush persists the data.
   db_.reset(new LocalStorageDatabase(storage_manager_.get()));
   Reader reader;
-  db_->ReadAll(host_,
+  db_->ReadAll(origin_,
                base::Bind(&Reader::OnReadAll, base::Unretained(&reader)));
   message_loop_.RunUntilIdle();
   EXPECT_TRUE(reader.TimedWait());
@@ -156,14 +156,14 @@
 
   for (StorageArea::StorageMap::const_iterator it = test_vals.begin();
        it != test_vals.end(); ++it) {
-    db_->Write(host_, it->first, it->second);
+    db_->Write(origin_, it->first, it->second);
   }
 
-  db_->Delete(host_, "key0");
+  db_->Delete(origin_, "key0");
   StorageArea::StorageMap expected_vals;
   expected_vals["key1"] = "value1";
   Reader reader;
-  db_->ReadAll(host_,
+  db_->ReadAll(origin_,
                base::Bind(&Reader::OnReadAll, base::Unretained(&reader)));
   message_loop_.RunUntilIdle();
   EXPECT_TRUE(reader.TimedWait());
@@ -177,12 +177,12 @@
 
   for (StorageArea::StorageMap::const_iterator it = test_vals.begin();
        it != test_vals.end(); ++it) {
-    db_->Write(host_, it->first, it->second);
+    db_->Write(origin_, it->first, it->second);
   }
-  db_->Clear(host_);
+  db_->Clear(origin_);
   StorageArea::StorageMap expected_vals;
   Reader reader;
-  db_->ReadAll(host_,
+  db_->ReadAll(origin_,
                base::Bind(&Reader::OnReadAll, base::Unretained(&reader)));
   message_loop_.RunUntilIdle();
   EXPECT_TRUE(reader.TimedWait());
diff --git a/src/cobalt/dom/media_key_message_event.cc b/src/cobalt/dom/media_key_message_event.cc
index 60a074c..d48b0e9 100644
--- a/src/cobalt/dom/media_key_message_event.cc
+++ b/src/cobalt/dom/media_key_message_event.cc
@@ -21,12 +21,13 @@
 
 MediaKeyMessageEvent::MediaKeyMessageEvent(
     const std::string& key_system, const std::string& session_id,
-    const scoped_refptr<Uint8Array>& message, const std::string& default_url)
+    const script::Handle<script::Uint8Array>& message,
+    const std::string& default_url)
     : Event(base::Tokens::keymessage(), kNotBubbles, kNotCancelable),
       key_system_(key_system),
       session_id_(session_id),
       default_url_(default_url),
-      message_(message) {}
+      message_reference_(this, message) {}
 
 }  // namespace dom
 }  // namespace cobalt
diff --git a/src/cobalt/dom/media_key_message_event.h b/src/cobalt/dom/media_key_message_event.h
index 86643bb..f134936 100644
--- a/src/cobalt/dom/media_key_message_event.h
+++ b/src/cobalt/dom/media_key_message_event.h
@@ -19,7 +19,7 @@
 
 #include "base/memory/ref_counted.h"
 #include "cobalt/dom/event.h"
-#include "cobalt/dom/uint8_array.h"
+#include "cobalt/script/typed_arrays.h"
 #include "cobalt/script/wrappable.h"
 
 namespace cobalt {
@@ -32,12 +32,14 @@
  public:
   MediaKeyMessageEvent(const std::string& key_system,
                        const std::string& session_id,
-                       const scoped_refptr<Uint8Array>& message,
+                       const script::Handle<script::Uint8Array>& message,
                        const std::string& default_url);
 
   const std::string& key_system() const { return key_system_; }
   const std::string& session_id() const { return session_id_; }
-  const scoped_refptr<Uint8Array>& message() const { return message_; }
+  const script::Handle<script::Uint8Array> message() const {
+    return script::Handle<script::Uint8Array>(message_reference_);
+  }
   const std::string& default_url() const { return default_url_; }
 
   DEFINE_WRAPPABLE_TYPE(MediaKeyMessageEvent);
@@ -46,7 +48,7 @@
   std::string key_system_;
   std::string session_id_;
   std::string default_url_;
-  scoped_refptr<Uint8Array> message_;
+  script::ScriptValue<script::Uint8Array>::Reference message_reference_;
 };
 
 }  // namespace dom
diff --git a/src/cobalt/dom/media_key_needed_event.cc b/src/cobalt/dom/media_key_needed_event.cc
index f6bd484..0580fa7 100644
--- a/src/cobalt/dom/media_key_needed_event.cc
+++ b/src/cobalt/dom/media_key_needed_event.cc
@@ -21,11 +21,11 @@
 
 MediaKeyNeededEvent::MediaKeyNeededEvent(
     const std::string& key_system, const std::string& session_id,
-    const scoped_refptr<Uint8Array>& init_data)
+    const script::Handle<script::Uint8Array>& init_data)
     : Event(base::Tokens::needkey(), kNotBubbles, kNotCancelable),
       key_system_(key_system),
       session_id_(session_id),
-      init_data_(init_data) {}
+      init_data_reference_(this, init_data) {}
 
 }  // namespace dom
 }  // namespace cobalt
diff --git a/src/cobalt/dom/media_key_needed_event.h b/src/cobalt/dom/media_key_needed_event.h
index 4207bbd..99238a7 100644
--- a/src/cobalt/dom/media_key_needed_event.h
+++ b/src/cobalt/dom/media_key_needed_event.h
@@ -19,7 +19,7 @@
 
 #include "base/memory/ref_counted.h"
 #include "cobalt/dom/event.h"
-#include "cobalt/dom/uint8_array.h"
+#include "cobalt/script/typed_arrays.h"
 #include "cobalt/script/wrappable.h"
 
 namespace cobalt {
@@ -32,18 +32,20 @@
  public:
   MediaKeyNeededEvent(const std::string& key_system,
                       const std::string& session_id,
-                      const scoped_refptr<Uint8Array>& init_data);
+                      const script::Handle<script::Uint8Array>& init_data);
 
   const std::string& key_system() const { return key_system_; }
   const std::string& session_id() const { return session_id_; }
-  const scoped_refptr<Uint8Array>& init_data() const { return init_data_; }
+  script::Handle<script::Uint8Array> init_data() const {
+    return script::Handle<script::Uint8Array>(init_data_reference_);
+  }
 
   DEFINE_WRAPPABLE_TYPE(MediaKeyNeededEvent);
 
  private:
   std::string key_system_;
   std::string session_id_;
-  scoped_refptr<Uint8Array> init_data_;
+  script::ScriptValue<script::Uint8Array>::Reference init_data_reference_;
 };
 
 }  // namespace dom
diff --git a/src/cobalt/dom/media_source/source_buffer.cc b/src/cobalt/dom/media_source/source_buffer.cc
index eecc333..5f7c5bc 100644
--- a/src/cobalt/dom/media_source/source_buffer.cc
+++ b/src/cobalt/dom/media_source/source_buffer.cc
@@ -220,16 +220,17 @@
   append_window_end_ = end;
 }
 
-void SourceBuffer::AppendBuffer(const scoped_refptr<ArrayBuffer>& data,
+void SourceBuffer::AppendBuffer(const script::Handle<script::ArrayBuffer>& data,
                                 script::ExceptionState* exception_state) {
-  AppendBufferInternal(static_cast<const unsigned char*>(data->data()),
-                       data->byte_length(), exception_state);
+  AppendBufferInternal(static_cast<const unsigned char*>(data->Data()),
+                       data->ByteLength(), exception_state);
 }
 
-void SourceBuffer::AppendBuffer(const scoped_refptr<ArrayBufferView>& data,
-                                script::ExceptionState* exception_state) {
-  AppendBufferInternal(static_cast<const unsigned char*>(data->base_address()),
-                       data->byte_length(), exception_state);
+void SourceBuffer::AppendBuffer(
+    const script::Handle<script::ArrayBufferView>& data,
+    script::ExceptionState* exception_state) {
+  AppendBufferInternal(static_cast<const unsigned char*>(data->RawData()),
+                       data->ByteLength(), exception_state);
 }
 
 void SourceBuffer::Abort(script::ExceptionState* exception_state) {
@@ -404,7 +405,7 @@
 }
 
 void SourceBuffer::AppendBufferInternal(
-    const unsigned char* data, uint32 size,
+    const unsigned char* data, size_t size,
     script::ExceptionState* exception_state) {
   if (!PrepareAppend(size, exception_state)) {
     return;
diff --git a/src/cobalt/dom/media_source/source_buffer.h b/src/cobalt/dom/media_source/source_buffer.h
index 381fd1b..5b340bf 100644
--- a/src/cobalt/dom/media_source/source_buffer.h
+++ b/src/cobalt/dom/media_source/source_buffer.h
@@ -54,8 +54,6 @@
 #include "base/optional.h"
 #include "base/timer.h"
 #include "cobalt/base/token.h"
-#include "cobalt/dom/array_buffer.h"
-#include "cobalt/dom/array_buffer_view.h"
 #include "cobalt/dom/audio_track_list.h"
 #include "cobalt/dom/event_queue.h"
 #include "cobalt/dom/event_target.h"
@@ -65,6 +63,8 @@
 #include "cobalt/dom/video_track_list.h"
 #include "cobalt/media/base/media_tracks.h"
 #include "cobalt/media/filters/chunk_demuxer.h"
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/exception_state.h"
 
 namespace cobalt {
@@ -113,9 +113,9 @@
   }
   void set_append_window_end(double start,
                              script::ExceptionState* exception_state);
-  void AppendBuffer(const scoped_refptr<ArrayBuffer>& data,
+  void AppendBuffer(const script::Handle<script::ArrayBuffer>& data,
                     script::ExceptionState* exception_state);
-  void AppendBuffer(const scoped_refptr<ArrayBufferView>& data,
+  void AppendBuffer(const script::Handle<script::ArrayBufferView>& data,
                     script::ExceptionState* exception_state);
   void Abort(script::ExceptionState* exception_state);
   void Remove(double start, double end,
@@ -144,7 +144,7 @@
   bool PrepareAppend(size_t new_data_size,
                      script::ExceptionState* exception_state);
   bool EvictCodedFrames(size_t new_data_size);
-  void AppendBufferInternal(const unsigned char* data, uint32 size,
+  void AppendBufferInternal(const unsigned char* data, size_t size,
                             script::ExceptionState* exception_state);
   void OnAppendTimer();
   void AppendError();
diff --git a/src/cobalt/dom/message_event.cc b/src/cobalt/dom/message_event.cc
index bcf33b7..a460780 100644
--- a/src/cobalt/dom/message_event.cc
+++ b/src/cobalt/dom/message_event.cc
@@ -18,6 +18,8 @@
 #include <string>
 
 #include "base/basictypes.h"
+#include "cobalt/base/polymorphic_downcast.h"
+#include "cobalt/dom/dom_settings.h"
 #include "starboard/string.h"
 
 namespace {
@@ -60,10 +62,13 @@
     data_length = data_->size();
   }
 
-  scoped_refptr<dom::ArrayBuffer> response_buffer;
+  auto* global_environment =
+      base::polymorphic_downcast<DOMSettings*>(settings_)->global_environment();
+  script::Handle<script::ArrayBuffer> response_buffer;
   if (response_type_ != kText) {
-    response_buffer = new dom::ArrayBuffer(
-        settings_, reinterpret_cast<const uint8*>(data_pointer), data_length);
+    auto buffer_copy =
+        script::ArrayBuffer::New(global_environment, data_pointer, data_length);
+    response_buffer = std::move(buffer_copy);
   }
 
   switch (response_type_) {
diff --git a/src/cobalt/dom/message_event.h b/src/cobalt/dom/message_event.h
index 075afb1..f7c5fcf 100644
--- a/src/cobalt/dom/message_event.h
+++ b/src/cobalt/dom/message_event.h
@@ -21,9 +21,9 @@
 #include "base/memory/ref_counted.h"
 #include "base/string_piece.h"
 #include "cobalt/base/token.h"
-#include "cobalt/dom/array_buffer.h"
 #include "cobalt/dom/blob.h"
 #include "cobalt/dom/event.h"
+#include "cobalt/script/array_buffer.h"
 #include "cobalt/script/union_type.h"
 #include "cobalt/script/wrappable.h"
 #include "net/base/io_buffer.h"
@@ -34,7 +34,8 @@
 class MessageEvent : public dom::Event {
  public:
   typedef script::UnionType3<std::string, scoped_refptr<dom::Blob>,
-                             scoped_refptr<dom::ArrayBuffer> > ResponseType;
+                             script::Handle<script::ArrayBuffer> >
+      ResponseType;
   // These response codes are ordered in the likelyhood of being used.
   // Keeping them in expected order will help make code faster.
   enum ResponseTypeCode { kText, kBlob, kArrayBuffer, kResponseTypeCodeMax };
diff --git a/src/cobalt/dom/screenshot.cc b/src/cobalt/dom/screenshot.cc
index 8449198..3a56634 100644
--- a/src/cobalt/dom/screenshot.cc
+++ b/src/cobalt/dom/screenshot.cc
@@ -20,9 +20,9 @@
 namespace cobalt {
 namespace dom {
 
-Screenshot::Screenshot(scoped_refptr<ArrayBuffer> pixel_data)
-    : pixel_data_(pixel_data) {
-  DCHECK(pixel_data);
+Screenshot::Screenshot(const script::Handle<script::ArrayBuffer>& pixel_data)
+    : pixel_data_reference_(this, pixel_data) {
+  DCHECK(!pixel_data.IsEmpty());
 }
 
 }  // namespace dom
diff --git a/src/cobalt/dom/screenshot.h b/src/cobalt/dom/screenshot.h
index 6989521..b577877 100644
--- a/src/cobalt/dom/screenshot.h
+++ b/src/cobalt/dom/screenshot.h
@@ -17,7 +17,7 @@
 
 #include <string>
 
-#include "cobalt/dom/array_buffer.h"
+#include "cobalt/script/array_buffer.h"
 #include "cobalt/script/wrappable.h"
 
 namespace cobalt {
@@ -25,15 +25,17 @@
 
 class Screenshot : public script::Wrappable {
  public:
-  explicit Screenshot(scoped_refptr<ArrayBuffer> pixel_data);
+  explicit Screenshot(const script::Handle<script::ArrayBuffer>& pixel_data);
 
   // Readonly Attributes.
-  const scoped_refptr<ArrayBuffer>& buffer() const { return pixel_data_; }
+  script::Handle<script::ArrayBuffer> buffer() const {
+    return script::Handle<script::ArrayBuffer>(pixel_data_reference_);
+  }
 
   DEFINE_WRAPPABLE_TYPE(Screenshot);
 
  private:
-  scoped_refptr<ArrayBuffer> pixel_data_;
+  script::ScriptValue<script::ArrayBuffer>::Reference pixel_data_reference_;
 
   Screenshot(const Screenshot&) = delete;
   Screenshot& operator=(const Screenshot&) = delete;
diff --git a/src/cobalt/dom/screenshot_manager.cc b/src/cobalt/dom/screenshot_manager.cc
index a95f63c..dd71f65 100644
--- a/src/cobalt/dom/screenshot_manager.cc
+++ b/src/cobalt/dom/screenshot_manager.cc
@@ -15,9 +15,9 @@
 #include "cobalt/dom/screenshot_manager.h"
 
 #include "base/time.h"
-#include "cobalt/dom/array_buffer.h"
 #include "cobalt/dom/screenshot.h"
 #include "cobalt/render_tree/node.h"
+#include "cobalt/script/array_buffer.h"
 
 #include "cobalt/render_tree/resource_provider_stub.h"
 
@@ -87,8 +87,7 @@
     scoped_refptr<loader::image::EncodedStaticImage> encoded_image_data =
         CompressRGBAImage(desired_format, image_data.get(), image_dimensions);
 
-    int encoded_size =
-        static_cast<int>(encoded_image_data->GetEstimatedSizeInBytes());
+    size_t encoded_size = encoded_image_data->GetEstimatedSizeInBytes();
 
     if (encoded_image_data->GetEstimatedSizeInBytes() > kint32max) {
       NOTREACHED();
@@ -96,9 +95,11 @@
       break;
     }
     DLOG(INFO) << "Filling data in for the screenshot.";
-    scoped_refptr<ArrayBuffer> pixel_data =
-        new ArrayBuffer(environment_settings_, encoded_image_data->GetMemory(),
-                        static_cast<int>(encoded_size));
+    DOMSettings* dom_settings =
+        base::polymorphic_downcast<dom::DOMSettings*>(environment_settings_);
+    script::Handle<script::ArrayBuffer> pixel_data =
+        script::ArrayBuffer::New(dom_settings->global_environment(),
+                                 encoded_image_data->GetMemory(), encoded_size);
     scoped_refptr<script::Wrappable> promise_result =
         new dom::Screenshot(pixel_data);
     promise.Resolve(promise_result);
diff --git a/src/cobalt/dom/screenshot_manager.h b/src/cobalt/dom/screenshot_manager.h
index 4eea129..66c3860 100644
--- a/src/cobalt/dom/screenshot_manager.h
+++ b/src/cobalt/dom/screenshot_manager.h
@@ -19,10 +19,10 @@
 
 #include "base/memory/ref_counted.h"
 #include "base/threading/thread_checker.h"
+#include "cobalt/dom/dom_settings.h"
 #include "cobalt/loader/image/image.h"
 #include "cobalt/loader/image/image_encoder.h"
 #include "cobalt/render_tree/node.h"
-#include "cobalt/script/environment_settings.h"
 #include "cobalt/script/promise.h"
 #include "cobalt/script/script_value.h"
 #include "cobalt/script/script_value_factory.h"
diff --git a/src/cobalt/dom/source_buffer.cc b/src/cobalt/dom/source_buffer.cc
index 8266328..42de9db 100644
--- a/src/cobalt/dom/source_buffer.cc
+++ b/src/cobalt/dom/source_buffer.cc
@@ -62,14 +62,14 @@
   }
 }
 
-void SourceBuffer::Append(const scoped_refptr<const Uint8Array>& data,
+void SourceBuffer::Append(const script::Handle<script::Uint8Array>& data,
                           script::ExceptionState* exception_state) {
   if (!media_source_) {
     DOMException::Raise(DOMException::kInvalidStateErr, exception_state);
   }
 
-  if (data->length()) {
-    media_source_->Append(this, data->data(), static_cast<int>(data->length()),
+  if (!data.IsEmpty() && data->Length()) {
+    media_source_->Append(this, data->Data(), static_cast<int>(data->Length()),
                           exception_state);
   }
 }
diff --git a/src/cobalt/dom/source_buffer.h b/src/cobalt/dom/source_buffer.h
index c399828..253df3e 100644
--- a/src/cobalt/dom/source_buffer.h
+++ b/src/cobalt/dom/source_buffer.h
@@ -25,8 +25,8 @@
 #include "base/memory/ref_counted.h"
 #include "cobalt/dom/event_target.h"
 #include "cobalt/dom/time_ranges.h"
-#include "cobalt/dom/uint8_array.h"
 #include "cobalt/script/exception_state.h"
+#include "cobalt/script/typed_arrays.h"
 #include "cobalt/script/wrappable.h"
 
 namespace cobalt {
@@ -54,7 +54,7 @@
   double timestamp_offset(script::ExceptionState* exception_state) const;
   void set_timestamp_offset(double offset,
                             script::ExceptionState* exception_state);
-  void Append(const scoped_refptr<const Uint8Array>& data,
+  void Append(const script::Handle<script::Uint8Array>& data,
               script::ExceptionState* exception_state);
   void Abort(script::ExceptionState* exception_state);
 
diff --git a/src/cobalt/dom/storage_area.cc b/src/cobalt/dom/storage_area.cc
index 2e8abcd..439b113 100644
--- a/src/cobalt/dom/storage_area.cc
+++ b/src/cobalt/dom/storage_area.cc
@@ -18,35 +18,11 @@
 #include "base/stringprintf.h"
 #include "cobalt/dom/local_storage_database.h"
 #include "cobalt/dom/storage.h"
+#include "cobalt/storage/store/memory_store.h"
 
 namespace cobalt {
 namespace dom {
 
-namespace {
-const char kLocalStorageSuffix[] = ".localstorage";
-const char kSessionStorageSuffix[] = ".sessionstorage";
-
-std::string OriginToDatabaseIdentifier(const GURL& url) {
-  // For compatibility with existing saved data, this tries to behave the same
-  // as WebCore's SecurityOrigin::databaseIdentifier().
-  // e.g. https://www.youtube.com/tv should be converted to
-  // https_www.youtube.com_0
-
-  // NOTE: WebCore passes the encoded host through FileSystem's
-  // encodeForFilename(). We assume our host will be well-formed.
-  std::string encoded_host = url.HostNoBrackets();
-  int port = url.IntPort();
-  if (port == -1) {
-    // A default/unspecified port in googleurl is -1, but Steel used KURL
-    // from WebCore where a default port is 0. Convert to 0 for compatibility.
-    port = 0;
-  }
-
-  return base::StringPrintf("%s_%s_%d", url.scheme().c_str(),
-                            encoded_host.c_str(), port);
-}
-}  // namespace
-
 StorageArea::StorageArea(Storage* storage_node, LocalStorageDatabase* db)
     : read_event_(true, false),
       storage_node_(storage_node),
@@ -107,7 +83,7 @@
   (*storage_map_)[key] = value;
   storage_node_->DispatchEvent(key, old_value, value);
   if (db_interface_) {
-    db_interface_->Write(identifier_, key, value);
+    db_interface_->Write(origin_, key, value);
   }
 }
 
@@ -127,7 +103,7 @@
   storage_map_->erase(it);
   storage_node_->DispatchEvent(key, old_value, base::nullopt);
   if (db_interface_) {
-    db_interface_->Delete(identifier_, key);
+    db_interface_->Delete(origin_, key);
   }
 }
 
@@ -138,7 +114,7 @@
   size_bytes_ = 0;
   storage_node_->DispatchEvent(base::nullopt, base::nullopt, base::nullopt);
   if (db_interface_) {
-    db_interface_->Clear(identifier_);
+    db_interface_->Clear(origin_);
   }
 }
 
@@ -152,20 +128,17 @@
     return;
   }
 
-  identifier_ = OriginToDatabaseIdentifier(storage_node_->origin());
+  origin_ = loader::Origin(storage_node_->origin());
 
   if (db_interface_) {
     // LocalStorage path. We read our StorageMap from the database.
     // Do a one-time read from the database for what's currently in
     // LocalStorage.
-    identifier_ += kLocalStorageSuffix;
-    db_interface_->ReadAll(
-        identifier_,
-        base::Bind(&StorageArea::OnInitComplete, base::Unretained(this)));
+    db_interface_->ReadAll(origin_, base::Bind(&StorageArea::OnInitComplete,
+                                               base::Unretained(this)));
     read_event_.Wait();
   } else {
     // SessionStorage. Create a new, empty StorageMap.
-    identifier_ += kSessionStorageSuffix;
     storage_map_.reset(new StorageMap);
   }
   initialized_ = true;
@@ -176,10 +149,5 @@
   read_event_.Signal();
 }
 
-// static
-std::string StorageArea::GetLocalStorageIdForUrl(const GURL& url) {
-  return OriginToDatabaseIdentifier(url.GetOrigin()) + kLocalStorageSuffix;
-}
-
 }  // namespace dom
 }  // namespace cobalt
diff --git a/src/cobalt/dom/storage_area.h b/src/cobalt/dom/storage_area.h
index c5594aa..3a8d468 100644
--- a/src/cobalt/dom/storage_area.h
+++ b/src/cobalt/dom/storage_area.h
@@ -21,6 +21,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/optional.h"
 #include "base/synchronization/waitable_event.h"
+#include "cobalt/loader/origin.h"
 #include "googleurl/src/gurl.h"
 
 namespace cobalt {
@@ -51,9 +52,7 @@
   bool key_exists(const std::string& key_name);
   int size_bytes() const { return size_bytes_; }
   Storage* storage_node() const { return storage_node_; }
-  const std::string& identifier() const { return identifier_; }
-
-  static std::string GetLocalStorageIdForUrl(const GURL& url);
+  const loader::Origin& origin() const { return origin_; }
 
  private:
   void Init();
@@ -61,7 +60,7 @@
 
   scoped_ptr<StorageMap> storage_map_;
 
-  std::string identifier_;
+  loader::Origin origin_;
   base::WaitableEvent read_event_;
   Storage* storage_node_;
   int size_bytes_;
diff --git a/src/cobalt/dom/storage_area_test.cc b/src/cobalt/dom/storage_area_test.cc
index 028ef04..d541425 100644
--- a/src/cobalt/dom/storage_area_test.cc
+++ b/src/cobalt/dom/storage_area_test.cc
@@ -18,6 +18,7 @@
 #include <vector>
 
 #include "cobalt/dom/storage.h"
+#include "cobalt/storage/store/memory_store.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -56,8 +57,8 @@
 TEST(StorageAreaTest, Identifier) {
   scoped_refptr<MockStorage> mock_storage(new MockStorage());
   EXPECT_EQ(0, mock_storage->length());
-  EXPECT_EQ("https_www.example.com_0.sessionstorage",
-            mock_storage->area_->identifier());
+  loader::Origin origin(GURL("https://www.example.com"));
+  EXPECT_EQ(origin, mock_storage->area_->origin());
 }
 
 TEST(StorageAreaTest, SetItem) {
diff --git a/src/cobalt/dom/testing/stub_window.h b/src/cobalt/dom/testing/stub_window.h
index 6eb3913..62d87bc 100644
--- a/src/cobalt/dom/testing/stub_window.h
+++ b/src/cobalt/dom/testing/stub_window.h
@@ -22,6 +22,7 @@
 #include "base/message_loop.h"
 #include "base/threading/platform_thread.h"
 #include "cobalt/css_parser/parser.h"
+#include "cobalt/dom/dom_settings.h"
 #include "cobalt/dom/local_storage_database.h"
 #include "cobalt/dom/window.h"
 #include "cobalt/dom_parser/parser.h"
@@ -42,8 +43,7 @@
  public:
   explicit StubWindow(
       scoped_ptr<script::EnvironmentSettings> environment_settings =
-          scoped_ptr<script::EnvironmentSettings>(
-              new script::EnvironmentSettings))
+          scoped_ptr<script::EnvironmentSettings>())
       : message_loop_(MessageLoop::TYPE_DEFAULT),
         css_parser_(css_parser::Parser::Create()),
         dom_parser_(new dom_parser::Parser(base::Bind(&StubErrorCallback))),
@@ -52,8 +52,7 @@
             fetcher_factory_.get(), NULL, base::kThreadPriority_Default)),
         local_storage_database_(NULL),
         url_("about:blank"),
-        dom_stat_tracker_(new dom::DomStatTracker("StubWindow")),
-        environment_settings_(environment_settings.Pass()) {
+        dom_stat_tracker_(new dom::DomStatTracker("StubWindow")) {
     engine_ = script::JavaScriptEngine::CreateEngine();
     global_environment_ = engine_->CreateGlobalEnvironment();
     window_ = new dom::Window(
@@ -71,6 +70,13 @@
         dom::Window::OnStartDispatchEventCallback(),
         dom::Window::OnStopDispatchEventCallback(),
         dom::ScreenshotManager::ProvideScreenshotFunctionCallback(), NULL);
+    environment_settings_ =
+        environment_settings.get()
+            ? environment_settings.Pass()
+            : scoped_ptr<script::EnvironmentSettings>(
+                  new DOMSettings(0, NULL, NULL, window_, NULL, NULL, NULL,
+                                  engine_.get(), global_environment(), NULL));
+    window_->SetEnvironmentSettings(environment_settings_.get());
     global_environment_->CreateGlobalObject(window_,
                                             environment_settings_.get());
   }
diff --git a/src/cobalt/dom/typed_array.h b/src/cobalt/dom/typed_array.h
deleted file mode 100644
index fdf9d97..0000000
--- a/src/cobalt/dom/typed_array.h
+++ /dev/null
@@ -1,238 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef COBALT_DOM_TYPED_ARRAY_H_
-#define COBALT_DOM_TYPED_ARRAY_H_
-
-#include "base/logging.h"
-#include "base/stringprintf.h"
-#include "cobalt/dom/array_buffer_view.h"
-#include "cobalt/script/environment_settings.h"
-#include "cobalt/script/exception_state.h"
-
-#if defined(STARBOARD)
-#include "starboard/memory.h"
-#endif
-
-namespace cobalt {
-namespace dom {
-
-// TypedArray serves as the base of all array interfaces defined in
-// https://www.khronos.org/registry/typedarray/specs/latest/#7
-// An array interfaces should inherit from TypedArray<ElementType>, for
-// example, Uint8Array should inherit from TypedArray<uint8>.  A macro
-// named DEFINE_TYPED_ARRAY is provided at the end of this file for
-// convenience.
-template <typename ElementType>
-class TypedArray : public ArrayBufferView {
- public:
-  enum { kBytesPerElement = sizeof(ElementType) };
-
-  // Create a new TypedArray of the specified length.  Each element is
-  // initialized to 0 inside the ctor of ArrayBuffer.
-  TypedArray(script::EnvironmentSettings* settings, uint32 length)
-      : ArrayBufferView(new ArrayBuffer(settings, length * kBytesPerElement)) {}
-
-  // Create a new TypedArray of the specified length and initialize it with the
-  // given data.
-  TypedArray(script::EnvironmentSettings* settings, const ElementType* data,
-             uint32 length)
-      : ArrayBufferView(new ArrayBuffer(settings, length * kBytesPerElement)) {
-    DCHECK_EQ(this->length(), length);
-    SbMemoryCopy(this->data(), data, length * kBytesPerElement);
-  }
-
-  // Creates a new TypedArray and copies the elements of 'other' into this.
-  TypedArray(script::EnvironmentSettings* settings,
-             const scoped_refptr<TypedArray>& other)
-      : ArrayBufferView(other->buffer()->Slice(settings, 0)) {}
-
-  // TODO: Support constructors from Array types.
-  // i.e. uint8[], float[], etc.
-
-  // Create a view on top of the specified buffer.
-  // Offset starts at byte_offset, length is byte_length.
-  // This refers to the same underlying data as buffer.
-  TypedArray(const scoped_refptr<ArrayBuffer>& buffer,
-             script::ExceptionState* exception_state)
-      : ArrayBufferView(buffer) {
-    if (buffer->byte_length() % kBytesPerElement != 0) {
-      exception_state->SetSimpleException(script::kRangeError,
-                                          kWrongByteLengthMultipleErrorFormat,
-                                          kBytesPerElement);
-    }
-  }
-
-  TypedArray(const scoped_refptr<ArrayBuffer>& buffer, uint32 byte_offset,
-             script::ExceptionState* exception_state)
-      : ArrayBufferView(buffer, byte_offset,
-                        buffer->byte_length() - byte_offset) {
-    if (this->byte_offset() % kBytesPerElement != 0) {
-      exception_state->SetSimpleException(script::kRangeError,
-                                          kWrongByteOffsetMultipleErrorFormat,
-                                          kBytesPerElement);
-    } else if (buffer->byte_length() % kBytesPerElement != 0) {
-      exception_state->SetSimpleException(script::kRangeError,
-                                          kWrongByteLengthMultipleErrorFormat,
-                                          kBytesPerElement);
-    }
-  }
-
-  TypedArray(const scoped_refptr<ArrayBuffer>& buffer, uint32 byte_offset,
-             uint32 length, script::ExceptionState* exception_state)
-      : ArrayBufferView(buffer, byte_offset, length * kBytesPerElement) {
-    if (this->byte_offset() % kBytesPerElement != 0) {
-      exception_state->SetSimpleException(script::kRangeError,
-                                          kWrongByteOffsetMultipleErrorFormat,
-                                          kBytesPerElement);
-    } else if (byte_offset + length * kBytesPerElement >
-               buffer->byte_length()) {
-      exception_state->SetSimpleException(script::kInvalidLength);
-    }
-  }
-
-  // Create a new TypedArray that is a view into this existing array.
-  template <typename SubarrayType>
-  scoped_refptr<SubarrayType> SubarrayImpl(
-      script::EnvironmentSettings* settings, int start, int end) {
-    const int cur_length = static_cast<int>(length());
-    int clamped_start;
-    int clamped_end;
-    ArrayBuffer::ClampRange(start, end, cur_length, &clamped_start,
-                            &clamped_end);
-    return new SubarrayType(
-        settings, buffer(),
-        static_cast<uint32>(byte_offset() + clamped_start * kBytesPerElement),
-        static_cast<uint32>(clamped_end - clamped_start), NULL);
-  }
-
-  // Copy items from 'source' into this array. This array must already be at
-  // least as large as 'source'.
-  void Set(const scoped_refptr<TypedArray>& source, uint32 offset,
-           script::ExceptionState* exception_state) {
-    if (offset >= length() || length() - offset < source->length()) {
-      exception_state->SetSimpleException(script::kInvalidLength);
-      return;
-    }
-    uint32 source_offset = 0;
-    while (source_offset < source->length()) {
-      SbMemoryCopy(data() + offset, source->data() + source_offset,
-             sizeof(ElementType));
-      ++offset;
-      ++source_offset;
-    }
-  }
-
-  void Set(const scoped_refptr<TypedArray>& source,
-           script::ExceptionState* exception_state) {
-    Set(source, 0, exception_state);
-  }
-
-  // Write a single element of the array.
-  void Set(uint32 index, ElementType val) {
-    if (index < length()) {
-      SbMemoryCopy(data() + index, &val, sizeof(ElementType));
-    }
-  }
-
-  ElementType Get(uint32 index) const {
-    if (index < length()) {
-      ElementType val;
-      SbMemoryCopy(&val, data() + index, sizeof(ElementType));
-      return val;
-    } else {
-      // TODO: an out of bounds index should return undefined.
-      DLOG(ERROR) << "index " << index << " out of range " << length();
-      return 0;
-    }
-  }
-
-  uint32 length() const { return byte_length() / kBytesPerElement; }
-
-  const ElementType* data() const {
-    return reinterpret_cast<const ElementType*>(base_address());
-  }
-  ElementType* data() { return reinterpret_cast<ElementType*>(base_address()); }
-
-  DEFINE_WRAPPABLE_TYPE(TypedArray);
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(TypedArray);
-};
-
-}  // namespace dom
-}  // namespace cobalt
-
-// This macro is necessary as every SubarrayType should define its own wrappable
-// type.
-// Example usage:
-//   DEFINE_TYPED_ARRAY(Uint8Array, uint8);
-//   DEFINE_TYPED_ARRAY(Float32Array, float);
-#define DEFINE_TYPED_ARRAY(SubarrayType, ElementType)                          \
-  class SubarrayType : public TypedArray<ElementType> {                        \
-   public:                                                                     \
-    SubarrayType(script::EnvironmentSettings* settings, uint32 length,         \
-                 script::ExceptionState* exception_state)                      \
-        : TypedArray<ElementType>(settings, length) {                          \
-      UNREFERENCED_PARAMETER(exception_state);                                 \
-    }                                                                          \
-    SubarrayType(script::EnvironmentSettings* settings,                        \
-                 const ElementType* data, uint32 length,                       \
-                 script::ExceptionState* exception_state)                      \
-        : TypedArray<ElementType>(settings, data, length) {                    \
-      UNREFERENCED_PARAMETER(exception_state);                                 \
-    }                                                                          \
-    SubarrayType(script::EnvironmentSettings* settings,                        \
-                 const scoped_refptr<SubarrayType>& other,                     \
-                 script::ExceptionState* exception_state)                      \
-        : TypedArray<ElementType>(settings, other.get()) {                     \
-      UNREFERENCED_PARAMETER(exception_state);                                 \
-    }                                                                          \
-    SubarrayType(script::EnvironmentSettings* settings,                        \
-                 const scoped_refptr<ArrayBuffer>& buffer,                     \
-                 script::ExceptionState* exception_state)                      \
-        : TypedArray<ElementType>(buffer.get(), exception_state) {             \
-      UNREFERENCED_PARAMETER(settings);                                        \
-    }                                                                          \
-    SubarrayType(script::EnvironmentSettings* settings,                        \
-                 const scoped_refptr<ArrayBuffer>& buffer, uint32 byte_offset, \
-                 script::ExceptionState* exception_state)                      \
-        : TypedArray<ElementType>(buffer, byte_offset, exception_state) {      \
-      UNREFERENCED_PARAMETER(settings);                                        \
-    }                                                                          \
-    SubarrayType(script::EnvironmentSettings* settings,                        \
-                 const scoped_refptr<ArrayBuffer>& buffer, uint32 byte_offset, \
-                 uint32 byte_length, script::ExceptionState* exception_state)  \
-        : TypedArray<ElementType>(buffer, byte_offset, byte_length,            \
-                                  exception_state) {                           \
-      UNREFERENCED_PARAMETER(settings);                                        \
-    }                                                                          \
-                                                                               \
-    scoped_refptr<SubarrayType> Subarray(                                      \
-        script::EnvironmentSettings* settings, int start, int end) {           \
-      return SubarrayImpl<SubarrayType>(settings, start, end);                 \
-    }                                                                          \
-    scoped_refptr<SubarrayType> Subarray(                                      \
-        script::EnvironmentSettings* settings, int start) {                    \
-      return SubarrayImpl<SubarrayType>(settings, start,                       \
-                                        static_cast<int>(length()));           \
-    }                                                                          \
-                                                                               \
-    DEFINE_WRAPPABLE_TYPE(SubarrayType);                                       \
-                                                                               \
-   private:                                                                    \
-    DISALLOW_COPY_AND_ASSIGN(SubarrayType);                                    \
-  };
-
-#endif  // COBALT_DOM_TYPED_ARRAY_H_
diff --git a/src/cobalt/dom/typed_array_test.cc b/src/cobalt/dom/typed_array_test.cc
deleted file mode 100644
index 8bd93b0..0000000
--- a/src/cobalt/dom/typed_array_test.cc
+++ /dev/null
@@ -1,402 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "cobalt/dom/typed_array.h"
-
-#include <limits>
-
-#include "cobalt/dom/float32_array.h"
-#include "cobalt/dom/float64_array.h"
-#include "cobalt/dom/uint8_array.h"
-#include "cobalt/script/testing/mock_exception_state.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace cobalt {
-namespace dom {
-namespace {
-
-using script::testing::MockExceptionState;
-using testing::_;
-using testing::SaveArg;
-using testing::StrictMock;
-
-template <typename SubArrayType>
-class TypedArrayTest : public ::testing::Test {};
-
-typedef ::testing::Types<Uint8Array, Float32Array, Float64Array> TypedArrays;
-TYPED_TEST_CASE(TypedArrayTest, TypedArrays);
-
-TYPED_TEST(TypedArrayTest, CreateArray) {
-  static const uint32 kLength = 5;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> array =
-      new TypeParam(NULL, kLength, &exception_state);
-  EXPECT_EQ(kLength, array->length());
-  for (uint32 i = 0; i < kLength; ++i) {
-    EXPECT_EQ(0, array->Get(i));
-  }
-}
-
-TYPED_TEST(TypedArrayTest, CreateArrayCopy) {
-  static const uint32 kLength = 5;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> source =
-      new TypeParam(NULL, kLength, &exception_state);
-  for (uint32 i = 0; i < kLength; ++i) {
-    source->Set(i, static_cast<uint8>(i));
-  }
-  scoped_refptr<TypeParam> copy = new TypeParam(NULL, source, &exception_state);
-  for (uint32 i = 0; i < kLength; ++i) {
-    EXPECT_EQ(source->Get(i), copy->Get(i));
-  }
-}
-
-TYPED_TEST(TypedArrayTest, CopyArrayWithSet) {
-  static const uint32 kLength = 5;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> source =
-      new TypeParam(NULL, kLength, &exception_state);
-  for (uint32 i = 0; i < kLength; ++i) {
-    source->Set(i, static_cast<uint8>(i));
-  }
-  scoped_refptr<TypeParam> copy =
-      new TypeParam(NULL, kLength, &exception_state);
-  copy->Set(source, &exception_state);
-  for (uint32 i = 0; i < kLength; ++i) {
-    EXPECT_EQ(source->Get(i), copy->Get(i));
-  }
-}
-
-TYPED_TEST(TypedArrayTest, CopyArrayWithSetOffset) {
-  static const uint32 kLength = 5;
-  static const uint32 kOffset = 3;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> source =
-      new TypeParam(NULL, kLength, &exception_state);
-  for (uint32 i = 0; i < kLength; ++i) {
-    source->Set(i, static_cast<uint8>(i));
-  }
-  scoped_refptr<TypeParam> copy =
-      new TypeParam(NULL, kLength + kOffset, &exception_state);
-  copy->Set(source, kOffset, &exception_state);
-  for (uint32 i = 0; i < kOffset; ++i) {
-    EXPECT_EQ(0, copy->Get(i));
-  }
-  for (uint32 i = 0; i < kLength; ++i) {
-    EXPECT_EQ(source->Get(i), copy->Get(i + kOffset));
-  }
-}
-
-TYPED_TEST(TypedArrayTest, CopyArrayWithSetOffsetOnTypeParamWithNonZeroOffset) {
-  // As the following illustration, |dst_buffer| is an array buffer providing
-  // the storage.  |dst| is a three element view starts from the second byte
-  // of |dst_buffer|.
-  // | 0 | 0 | 0 | 0 | 0 |  <==  dst_buffer
-  //     <-   dst   ->
-  // |src_buffer| and |src| are independent of |dst_buffer| and |dst|.
-  // | 1 | 2 | 3 | 4 | 5 | 6 | <==  src_buffer
-  //         <- src ->
-  // So after calling set on |dst| with offset of 1 the content of
-  // |dst_buffer| and |dst| should be:
-  // | 0 | 0 | 3 | 4 | 0 |  <==  dst_buffer
-  //     <-   dst   ->
-
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> dst_buffer =
-      new ArrayBuffer(NULL, 5 * TypeParam::kBytesPerElement);
-  scoped_refptr<TypeParam> dst = new TypeParam(
-      NULL, dst_buffer, 1 * TypeParam::kBytesPerElement, 3, &exception_state);
-
-  scoped_refptr<ArrayBuffer> src_buffer =
-      new ArrayBuffer(NULL, 6 * TypeParam::kBytesPerElement);
-  scoped_refptr<TypeParam> src = new TypeParam(
-      NULL, src_buffer, 2 * TypeParam::kBytesPerElement, 2, &exception_state);
-
-  // Use a TypedArray to fill |src_buffer| with values.
-  scoped_refptr<TypeParam> fill =
-      new TypeParam(NULL, src_buffer, &exception_state);
-  for (uint32 i = 0; i < fill->length(); ++i) {
-    fill->Set(i, static_cast<uint8>(i + 1));
-  }
-
-  dst->Set(src, 1, &exception_state);
-
-  EXPECT_EQ(0, dst->Get(0));
-  EXPECT_EQ(3, dst->Get(1));
-  EXPECT_EQ(4, dst->Get(2));
-}
-
-TYPED_TEST(TypedArrayTest, SetItem) {
-  static const uint32 kLength = 3;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> array =
-      new TypeParam(NULL, kLength, &exception_state);
-  array->Set(1, 0xff);
-  EXPECT_EQ(0, array->Get(0));
-  EXPECT_EQ(0xff, array->Get(1));
-  EXPECT_EQ(0, array->Get(2));
-}
-
-TYPED_TEST(TypedArrayTest, ArrayView) {
-  // Test creating a second array that's a view of the first one.
-  // Write to the view and then check the original was modified.
-  static const uint32 kLength = 5;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> array =
-      new TypeParam(NULL, kLength, &exception_state);
-  scoped_refptr<TypeParam> view =
-      new TypeParam(NULL, array->buffer(), &exception_state);
-  for (uint32 i = 0; i < kLength; ++i) {
-    view->Set(i, static_cast<uint8>(i + 1));
-  }
-  for (uint32 i = 0; i < kLength; ++i) {
-    EXPECT_EQ(i + 1, array->Get(i));
-  }
-}
-
-TYPED_TEST(TypedArrayTest, ArrayViewLengthZero) {
-  static const uint32 kLength = 5;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> array =
-      new TypeParam(NULL, kLength, &exception_state);
-  scoped_refptr<TypeParam> view =
-      new TypeParam(NULL, array->buffer(),
-                    kLength * TypeParam::kBytesPerElement, &exception_state);
-  EXPECT_EQ(0, view->length());
-}
-
-TYPED_TEST(TypedArrayTest, ArrayViewOffset) {
-  // Test creating a second array that's a view of the first one.
-  // Write to the view and then check the original was modified.
-  static const uint32 kLength = 5;
-  static const uint32 kViewOffset = 3;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> array =
-      new TypeParam(NULL, kLength, &exception_state);
-  scoped_refptr<TypeParam> view = new TypeParam(
-      NULL, array->buffer(), kViewOffset * TypeParam::kBytesPerElement,
-      &exception_state);
-  for (uint32 i = 0; i < kLength - kViewOffset; ++i) {
-    view->Set(i, 0xff);
-  }
-  EXPECT_EQ(0, array->Get(0));
-  EXPECT_EQ(0, array->Get(1));
-  EXPECT_EQ(0, array->Get(2));
-  EXPECT_EQ(0xff, array->Get(3));
-  EXPECT_EQ(0xff, array->Get(4));
-}
-
-TYPED_TEST(TypedArrayTest, ArrayViewOffsetAndLength) {
-  // Test creating a second array that's a view of the first one.
-  // Write to the view and then check the original was modified.
-  static const uint32 kLength = 5;
-  static const uint32 kViewOffset = 3;
-  static const uint32 kViewLength = kLength - kViewOffset;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> array =
-      new TypeParam(NULL, kLength, &exception_state);
-  scoped_refptr<TypeParam> view = new TypeParam(
-      NULL, array->buffer(), kViewOffset * TypeParam::kBytesPerElement,
-      kViewLength, &exception_state);
-  for (uint32 i = 0; i < kViewLength; ++i) {
-    view->Set(i, static_cast<uint8>(kViewOffset + i));
-  }
-  EXPECT_EQ(0, array->Get(0));
-  EXPECT_EQ(0, array->Get(1));
-  EXPECT_EQ(0, array->Get(2));
-  EXPECT_EQ(3, array->Get(3));
-  EXPECT_EQ(4, array->Get(4));
-}
-
-TYPED_TEST(TypedArrayTest, CreateSubArrayOnlyStart) {
-  static const uint32 kLength = 5;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> array =
-      new TypeParam(NULL, kLength, &exception_state);
-  scoped_refptr<TypeParam> subarray = array->Subarray(NULL, 1);
-  for (uint32 i = 0; i < kLength; ++i) {
-    array->Set(i, static_cast<uint8>(i));
-  }
-  EXPECT_EQ(4, subarray->length());
-  EXPECT_EQ(1, subarray->Get(0));
-  EXPECT_EQ(2, subarray->Get(1));
-  EXPECT_EQ(3, subarray->Get(2));
-  EXPECT_EQ(4, subarray->Get(3));
-}
-
-TYPED_TEST(TypedArrayTest, CreateSubArrayStartEnd) {
-  static const uint32 kLength = 5;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> array =
-      new TypeParam(NULL, kLength, &exception_state);
-  scoped_refptr<TypeParam> subarray = array->Subarray(NULL, 1, 4);
-  for (uint32 i = 0; i < kLength; ++i) {
-    array->Set(i, static_cast<uint8>(i));
-  }
-  EXPECT_EQ(3, subarray->length());
-  EXPECT_EQ(1, subarray->Get(0));
-  EXPECT_EQ(2, subarray->Get(1));
-  EXPECT_EQ(3, subarray->Get(2));
-}
-
-TYPED_TEST(TypedArrayTest, CreateSubArrayStartEndOnTypeParamWithNonZeroOffset) {
-  // As the following illustration, |array_buffer| owns the whole buffer,
-  // |array| is a view starts from the second byte of |array_buffer|, |subarray|
-  // is a subarray of |array| starts from the second byte, which is in turn a
-  // view of |array_buffer| starts from the third byte.
-  // | 0 | 1 | 2 | 3 | 4 |  <==  array_buffer
-  //     <-    array    ->
-  //         <-subarray ->
-  static const uint32 kLength = 5;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<ArrayBuffer> array_buffer =
-      new ArrayBuffer(NULL, kLength * TypeParam::kBytesPerElement);
-  scoped_refptr<TypeParam> array =
-      new TypeParam(NULL, array_buffer, 1 * TypeParam::kBytesPerElement,
-                    kLength - 1, &exception_state);
-  // The length passed to Subarray(NULL, ) is actually one element longer than
-  // what
-  // |array| has.  This should be clamped inside Subarray(NULL, ) and the size
-  // of
-  // |subarray| should still be three.
-  scoped_refptr<TypeParam> subarray =
-      array->Subarray(NULL, 1, static_cast<int>(array->length()));
-
-  // Use a TypedArray to fill |array_buffer| with values.
-  scoped_refptr<TypeParam> fill =
-      new TypeParam(NULL, array_buffer, &exception_state);
-  for (uint32 i = 0; i < fill->length(); ++i) {
-    fill->Set(i, static_cast<uint8>(i));
-  }
-
-  EXPECT_EQ(1, array->Get(0));
-  EXPECT_EQ(2, subarray->Get(0));
-}
-
-TYPED_TEST(TypedArrayTest, CreateSubArrayNegativeOnlyStart) {
-  static const uint32 kLength = 5;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> array =
-      new TypeParam(NULL, kLength, &exception_state);
-  scoped_refptr<TypeParam> subarray = array->Subarray(NULL, -2);
-  for (uint32 i = 0; i < kLength; ++i) {
-    array->Set(i, static_cast<uint8>(i));
-  }
-
-  // subarray[0] -> array[3]
-  // subarray[1] -> array[4]
-  EXPECT_EQ(2, subarray->length());
-  EXPECT_EQ(3, subarray->Get(0));
-  EXPECT_EQ(4, subarray->Get(1));
-}
-
-TYPED_TEST(TypedArrayTest, CreateSubArrayNegativeStartEnd) {
-  static const uint32 kLength = 5;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> array =
-      new TypeParam(NULL, kLength, &exception_state);
-  scoped_refptr<TypeParam> subarray = array->Subarray(NULL, -3, -1);
-  for (uint32 i = 0; i < kLength; ++i) {
-    array->Set(i, static_cast<uint8>(i));
-  }
-
-  // subarray[0] -> array[2]
-  // subarray[1] -> array[3]
-  EXPECT_EQ(2, subarray->length());
-  EXPECT_EQ(2, subarray->Get(0));
-  EXPECT_EQ(3, subarray->Get(1));
-}
-
-TYPED_TEST(TypedArrayTest, CreateSubArrayInvalidLength) {
-  static const uint32 kLength = 5;
-  StrictMock<MockExceptionState> exception_state;
-  scoped_refptr<TypeParam> array =
-      new TypeParam(NULL, kLength, &exception_state);
-  scoped_refptr<TypeParam> subarray = array->Subarray(NULL, 12, 5);
-  EXPECT_EQ(0, subarray->length());
-}
-
-TYPED_TEST(TypedArrayTest, ExceptionInConstructor) {
-  // This test doesn't apply to any typed array whose element size is 1.
-  if (TypeParam::kBytesPerElement == 1) {
-    return;
-  }
-
-  StrictMock<MockExceptionState> exception_state;
-
-  // Create an ArrayBuffer whose size isn't a multiple of
-  // TypeParam::kBytesPerElement.
-  scoped_refptr<ArrayBuffer> array_buffer =
-      new ArrayBuffer(NULL, TypeParam::kBytesPerElement + 1);
-
-  // The size of the array_buffer isn't a multiple of
-  // TypeParam::kBytesPerElement.
-  EXPECT_CALL(exception_state, SetSimpleExceptionVA(script::kRangeError, _, _));
-  scoped_refptr<TypeParam> array =
-      new TypeParam(NULL, array_buffer, &exception_state);
-
-  // Neither the size of the array_buffer nor the byte_offset is a multiple of
-  // TypeParam::kBytesPerElement, but SetSimpleException() should only be called
-  // once.
-  EXPECT_CALL(exception_state, SetSimpleExceptionVA(script::kRangeError, _, _));
-  array = new TypeParam(NULL, array_buffer, 1, &exception_state);
-
-  // Now the size of the array_buffer is a multiple of
-  // TypeParam::kBytesPerElement but the byte_offset isn't.
-  EXPECT_CALL(exception_state, SetSimpleExceptionVA(script::kRangeError, _, _));
-  array_buffer = new ArrayBuffer(NULL, TypeParam::kBytesPerElement);
-  array = new TypeParam(NULL, array_buffer, 1, &exception_state);
-
-  // Both the size of the array_buffer and the byte_offset are multiples of
-  // TypeParam::kBytesPerElement but array_buffer cannot hold 2 elements.
-  EXPECT_CALL(exception_state, SetSimpleExceptionVA(script::kRangeError, _, _));
-  array = new TypeParam(NULL, array_buffer, 0, 2, &exception_state);
-
-  // The size of the array_buffer isn't a multiple of
-  // TypeParam::kBytesPerElement but the byte_offset is.  Also the whole typed
-  // array can fit into the array_buffer.  The constructor should run without
-  // raising any exception.
-  array_buffer = new ArrayBuffer(NULL, TypeParam::kBytesPerElement * 2 + 1);
-  array = new TypeParam(NULL, array_buffer, TypeParam::kBytesPerElement, 1,
-                        &exception_state);
-}
-
-TYPED_TEST(TypedArrayTest, ExceptionInSet) {
-  // This test doesn't apply to any typed array whose element size is 1.
-  if (TypeParam::kBytesPerElement == 1) {
-    return;
-  }
-
-  StrictMock<MockExceptionState> exception_state;
-
-  static const uint32 kLength = 5;
-  scoped_refptr<TypeParam> source =
-      new TypeParam(NULL, kLength + 1, &exception_state);
-  scoped_refptr<TypeParam> dest =
-      new TypeParam(NULL, kLength, &exception_state);
-  EXPECT_CALL(exception_state, SetSimpleExceptionVA(script::kRangeError, _, _));
-  dest->Set(source, &exception_state);
-
-  source = new TypeParam(NULL, kLength, &exception_state);
-  dest = new TypeParam(NULL, kLength + 1, &exception_state);
-  EXPECT_CALL(exception_state, SetSimpleExceptionVA(script::kRangeError, _, _));
-  dest->Set(source, 2, &exception_state);
-
-  dest->Set(source, 1, &exception_state);
-}
-
-}  // namespace
-}  // namespace dom
-}  // namespace cobalt
diff --git a/src/cobalt/dom/uint16_array.h b/src/cobalt/dom/uint16_array.h
deleted file mode 100644
index 90f7b11..0000000
--- a/src/cobalt/dom/uint16_array.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2016 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef COBALT_DOM_UINT16_ARRAY_H_
-#define COBALT_DOM_UINT16_ARRAY_H_
-
-#include "cobalt/dom/typed_array.h"
-
-namespace cobalt {
-namespace dom {
-
-DEFINE_TYPED_ARRAY(Uint16Array, uint16);
-
-}  // namespace dom
-}  // namespace cobalt
-
-#endif  // COBALT_DOM_UINT16_ARRAY_H_
diff --git a/src/cobalt/dom/uint16_array.idl b/src/cobalt/dom/uint16_array.idl
deleted file mode 100644
index 88e1bea..0000000
--- a/src/cobalt/dom/uint16_array.idl
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2016 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// https://www.khronos.org/registry/typedarray/specs/latest/#7
-[
-  Constructor(unsigned long length),
-  Constructor(Uint16Array array),
-  Constructor(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length),
-  ConstructorCallWith=EnvironmentSettings,
-  RaisesException=Constructor
-]
-interface Uint16Array : ArrayBufferView {
-  const unsigned long BYTES_PER_ELEMENT = 2;
-
-  readonly attribute unsigned long length;
-
-  getter unsigned short get(unsigned long index);
-  setter void set(unsigned long index, unsigned short value);
-
-  // TODO: When arrays or sequences are supported, support them here.
-  // void set(sequence<long> array, optional unsigned long offset);
-
-  // Copy items into this array from source, starting at this[offset].
-  [RaisesException] void set(Uint16Array source, optional unsigned long offset);
-
-  // Return a new Uint16Array that is a view on top of this one.
-  // Contains this[start]..this[end]. end defaults to length if unspecified.
-  [CallWith=EnvironmentSettings] Uint16Array subarray(long start, optional long end);
-};
diff --git a/src/cobalt/dom/uint32_array.idl b/src/cobalt/dom/uint32_array.idl
deleted file mode 100644
index 81a435e..0000000
--- a/src/cobalt/dom/uint32_array.idl
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2016 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// https://www.khronos.org/registry/typedarray/specs/latest/#7
-[
-  Constructor(unsigned long length),
-  Constructor(Uint32Array array),
-  Constructor(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length),
-  ConstructorCallWith=EnvironmentSettings,
-  RaisesException=Constructor
-]
-interface Uint32Array : ArrayBufferView {
-  const unsigned long BYTES_PER_ELEMENT = 4;
-
-  readonly attribute unsigned long length;
-
-  getter unsigned long get(unsigned long index);
-  setter void set(unsigned long index, unsigned long value);
-
-  // TODO: When arrays or sequences are supported, support them here.
-  // void set(sequence<long> array, optional unsigned long offset);
-
-  // Copy items into this array from source, starting at this[offset].
-  [RaisesException] void set(Uint32Array source, optional unsigned long offset);
-
-  // Return a new Uint32Array that is a view on top of this one.
-  // Contains this[start]..this[end]. end defaults to length if unspecified.
-  [CallWith=EnvironmentSettings] Uint32Array subarray(long start, optional long end);
-};
diff --git a/src/cobalt/dom/uint8_array.h b/src/cobalt/dom/uint8_array.h
deleted file mode 100644
index b0b1b9d..0000000
--- a/src/cobalt/dom/uint8_array.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#ifndef COBALT_DOM_UINT8_ARRAY_H_
-#define COBALT_DOM_UINT8_ARRAY_H_
-
-#include "cobalt/dom/typed_array.h"
-
-namespace cobalt {
-namespace dom {
-
-DEFINE_TYPED_ARRAY(Uint8Array, uint8);
-
-}  // namespace dom
-}  // namespace cobalt
-
-#endif  // COBALT_DOM_UINT8_ARRAY_H_
diff --git a/src/cobalt/dom/uint8_array.idl b/src/cobalt/dom/uint8_array.idl
deleted file mode 100644
index 0b29898..0000000
--- a/src/cobalt/dom/uint8_array.idl
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// https://www.khronos.org/registry/typedarray/specs/latest/#7.1
-[
-  Constructor(unsigned long length),
-  Constructor(Uint8Array array),
-  Constructor(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length),
-  ConstructorCallWith=EnvironmentSettings,
-  RaisesException=Constructor
-]
-interface Uint8Array : ArrayBufferView {
-  const unsigned long BYTES_PER_ELEMENT = 1;
-
-  readonly attribute unsigned long length;
-
-  getter octet get(unsigned long index);
-  setter void set(unsigned long index, octet value);
-
-  // TODO: When arrays or sequences are supported, support them here.
-  // void set(sequence<long> array, optional unsigned long offset);
-
-  // Copy items into this array from source, starting at this[offset].
-  [RaisesException] void set(Uint8Array source, optional unsigned long offset);
-
-  // Return a new Uint8Array that is a view on top of this one.
-  // Contains this[start]..this[end]. end defaults to length if unspecified.
-  [CallWith=EnvironmentSettings] Uint8Array subarray(long start, optional long end);
-};
diff --git a/src/cobalt/dom/window.cc b/src/cobalt/dom/window.cc
index 0bfd760..c6543ea 100644
--- a/src/cobalt/dom/window.cc
+++ b/src/cobalt/dom/window.cc
@@ -262,7 +262,7 @@
   script::Handle<ScreenshotManager::InterfacePromise> promise =
       html_element_context()
           ->script_value_factory()
-          ->CreateInterfacePromise<scoped_refptr<dom::ArrayBuffer>>();
+          ->CreateInterfacePromise<dom::Screenshot>();
 
   std::unique_ptr<ScreenshotManager::InterfacePromiseValue::Reference>
       promise_reference(new ScreenshotManager::InterfacePromiseValue::Reference(
diff --git a/src/cobalt/fetch/fetch_internal.cc b/src/cobalt/fetch/fetch_internal.cc
index d6bd76e..4674209 100644
--- a/src/cobalt/fetch/fetch_internal.cc
+++ b/src/cobalt/fetch/fetch_internal.cc
@@ -33,25 +33,25 @@
 }
 
 // static
-scoped_refptr<dom::Uint8Array> FetchInternal::EncodeToUTF8(
+script::Handle<script::Uint8Array> FetchInternal::EncodeToUTF8(
     script::EnvironmentSettings* settings, const std::string& text,
     script::ExceptionState* exception_state) {
+  dom::DOMSettings* dom_settings =
+      base::polymorphic_downcast<dom::DOMSettings*>(settings);
   // The conversion helper already translated the JSValue into a UTF-8 encoded
   // string. So just wrap the result in a Uint8Array.
-  return new dom::Uint8Array(settings,
-      reinterpret_cast<const uint8*>(text.c_str()),
-      static_cast<uint32>(text.size()),
-      exception_state);
+  return script::Uint8Array::New(dom_settings->global_environment(),
+                                 text.data(), text.size());
 }
 
 // static
 std::string FetchInternal::DecodeFromUTF8(
-    const scoped_refptr<dom::Uint8Array>& data,
+    const script::Handle<script::Uint8Array>& data,
     script::ExceptionState* exception_state) {
   // The conversion helper expects the return value to be a UTF-8 encoded
   // string.
-  base::StringPiece input(reinterpret_cast<const char*>(data->data()),
-                          data->length());
+  base::StringPiece input(reinterpret_cast<const char*>(data->Data()),
+                          data->Length());
 
   if (IsStringUTF8(input)) {
     // Input is already UTF-8. Just strip the byte order mark if it's present.
diff --git a/src/cobalt/fetch/fetch_internal.h b/src/cobalt/fetch/fetch_internal.h
index 946c7b6..713d7d4 100644
--- a/src/cobalt/fetch/fetch_internal.h
+++ b/src/cobalt/fetch/fetch_internal.h
@@ -18,9 +18,9 @@
 #include <string>
 
 #include "base/memory/ref_counted.h"
-#include "cobalt/dom/uint8_array.h"
 #include "cobalt/script/environment_settings.h"
 #include "cobalt/script/exception_state.h"
+#include "cobalt/script/typed_arrays.h"
 #include "cobalt/script/wrappable.h"
 
 namespace cobalt {
@@ -37,13 +37,13 @@
       const std::string& url, bool allow_credentials);
 
   // Return a Uint8Array representing the given text as UTF-8 encoded data.
-  static scoped_refptr<dom::Uint8Array> EncodeToUTF8(
+  static script::Handle<script::Uint8Array> EncodeToUTF8(
       script::EnvironmentSettings* settings, const std::string& text,
       script::ExceptionState* exception_state);
 
   // Return a UTF-8 encoded string representing the given data.
   static std::string DecodeFromUTF8(
-      const scoped_refptr<dom::Uint8Array>& data,
+      const script::Handle<script::Uint8Array>& data,
       script::ExceptionState* exception_state);
 
   DEFINE_WRAPPABLE_TYPE(FetchInternal);
diff --git a/src/cobalt/layout/box.cc b/src/cobalt/layout/box.cc
index b21d447..61cd3ae 100644
--- a/src/cobalt/layout/box.cc
+++ b/src/cobalt/layout/box.cc
@@ -37,6 +37,7 @@
 #include "cobalt/math/vector2d_f.h"
 #include "cobalt/render_tree/border.h"
 #include "cobalt/render_tree/brush.h"
+#include "cobalt/render_tree/clear_rect_node.h"
 #include "cobalt/render_tree/color_rgba.h"
 #include "cobalt/render_tree/filter_node.h"
 #include "cobalt/render_tree/matrix_transform_node.h"
@@ -47,6 +48,7 @@
 
 using cobalt::render_tree::Border;
 using cobalt::render_tree::Brush;
+using cobalt::render_tree::ClearRectNode;
 using cobalt::render_tree::CompositionNode;
 using cobalt::render_tree::FilterNode;
 using cobalt::render_tree::MatrixTransformNode;
@@ -1427,24 +1429,38 @@
   }
 }
 
+math::RectF Box::GetBackgroundRect() {
+  return math::RectF(
+      math::PointF(border_left_width().toFloat(), border_top_width().toFloat()),
+      GetPaddingBoxSize());
+}
+
 void Box::RenderAndAnimateBackgroundColor(
     const base::optional<RoundedCorners>& rounded_corners,
     render_tree::CompositionNode::Builder* border_node_builder,
     AnimateNode::Builder* animate_node_builder) {
+  bool background_color_animated =
+      animations()->IsPropertyAnimated(cssom::kBackgroundColorProperty);
+
+  if (!blend_background_color_) {
+    // Usually this code is executed only on the initial containing block box.
+    DCHECK(!rounded_corners);
+    DCHECK(!background_color_animated);
+    border_node_builder->AddChild(
+        new ClearRectNode(GetBackgroundRect(),
+                          GetUsedColor(computed_style()->background_color())));
+    return;
+  }
+
   // Only create the RectNode if the background color is not the initial value
   // (which we know is transparent) and not transparent.  If it's animated,
   // add it no matter what since its value may change over time to be
   // non-transparent.
   bool background_color_transparent =
       GetUsedColor(computed_style()->background_color()).a() == 0.0f;
-  bool background_color_animated =
-      animations()->IsPropertyAnimated(cssom::kBackgroundColorProperty);
   if (!background_color_transparent || background_color_animated) {
-    RectNode::Builder rect_node_builder(
-        math::RectF(math::PointF(border_left_width().toFloat(),
-                                 border_top_width().toFloat()),
-                    GetPaddingBoxSize()),
-        scoped_ptr<Brush>());
+    RectNode::Builder rect_node_builder(GetBackgroundRect(),
+                                        scoped_ptr<Brush>());
     SetupBackgroundColorNodeFromStyle(rounded_corners, computed_style(),
                                       &rect_node_builder);
     if (!rect_node_builder.rect.IsEmpty()) {
@@ -1474,9 +1490,7 @@
   base::optional<CompositionNode::Builder> composition;
   result.is_opaque = false;
 
-  math::RectF image_frame(
-      math::PointF(border_left_width().toFloat(), border_top_width().toFloat()),
-      GetPaddingBoxSize());
+  math::RectF image_frame(GetBackgroundRect());
 
   cssom::PropertyListValue* property_list =
       base::polymorphic_downcast<cssom::PropertyListValue*>(
diff --git a/src/cobalt/layout/box.h b/src/cobalt/layout/box.h
index dda5300..9d4f40c 100644
--- a/src/cobalt/layout/box.h
+++ b/src/cobalt/layout/box.h
@@ -579,6 +579,15 @@
   bool ApplyTransformActionToCoordinates(
       TransformAction action, std::vector<math::Vector2dF>* coordinates) const;
 
+  // Intended to be set to false on the initial containing block, this indicates
+  // that when the background color is rendered, it will be blended with what,
+  // is behind it (only relevant when the color is not opaque). As an example,
+  // if set to false, a background color of transparent will replace any
+  // previous pixel values instead of being a no-op.
+  void set_blend_background_color(bool value) {
+    blend_background_color_ = value;
+  }
+
  protected:
   UsedStyleProvider* used_style_provider() const {
     return used_style_provider_;
@@ -717,6 +726,10 @@
       bool* /*is_placement_requirement_met*/, bool* /*is_placed*/,
       LayoutUnit* /*placed_offset*/) {}
 
+  // Get the rectangle for which gives the region that background-color
+  // and background-image would populate.
+  math::RectF GetBackgroundRect();
+
   // Helper methods used by |RenderAndAnimate|.
   void RenderAndAnimateBorder(
       const base::optional<render_tree::RoundedCorners>& rounded_corners,
@@ -832,6 +845,11 @@
   // earlier.
   size_t draw_order_position_in_stacking_context_;
 
+  // Determines whether the background should be rendered as a clear (i.e. with
+  // blending disabled).  It is expected that this may only be set on the
+  // initial containing block.
+  bool blend_background_color_ = true;
+
   // For write access to parent/containing_block members.
   friend class ContainerBox;
   friend class LayoutBoxes;
diff --git a/src/cobalt/layout/layout.cc b/src/cobalt/layout/layout.cc
index 1a9fb07..195b52f 100644
--- a/src/cobalt/layout/layout.cc
+++ b/src/cobalt/layout/layout.cc
@@ -54,7 +54,8 @@
     LayoutStatTracker* layout_stat_tracker,
     icu::BreakIterator* line_break_iterator,
     icu::BreakIterator* character_break_iterator,
-    scoped_refptr<BlockLevelBlockContainerBox>* initial_containing_block) {
+    scoped_refptr<BlockLevelBlockContainerBox>* initial_containing_block,
+    bool clear_window_with_background_color) {
   TRACE_EVENT0("cobalt::layout", "UpdateComputedStylesAndLayoutBoxTree()");
   // Layout-related cleanup is performed on the UsedStyleProvider in this
   // object's destructor.
@@ -75,6 +76,10 @@
           used_style_provider, layout_stat_tracker);
   *initial_containing_block = initial_containing_block_creation_results.box;
 
+  if (clear_window_with_background_color) {
+    (*initial_containing_block)->set_blend_background_color(false);
+  }
+
   // Generate boxes.
   if (document->html()) {
     TRACE_EVENT0("cobalt::layout", kBenchmarkStatBoxGeneration);
diff --git a/src/cobalt/layout/layout.h b/src/cobalt/layout/layout.h
index 678fe54..5d017de 100644
--- a/src/cobalt/layout/layout.h
+++ b/src/cobalt/layout/layout.h
@@ -46,7 +46,8 @@
     LayoutStatTracker* layout_stat_tracker,
     icu::BreakIterator* line_break_iterator,
     icu::BreakIterator* character_break_iterator,
-    scoped_refptr<BlockLevelBlockContainerBox>* initial_containing_block);
+    scoped_refptr<BlockLevelBlockContainerBox>* initial_containing_block,
+    bool clear_window_with_background_color);
 
 // Generates the render tree (along with corresponding animations) of the box
 // tree contained within the provided containing block.
diff --git a/src/cobalt/layout/layout_manager.cc b/src/cobalt/layout/layout_manager.cc
index 89bc349..6077abe 100644
--- a/src/cobalt/layout/layout_manager.cc
+++ b/src/cobalt/layout/layout_manager.cc
@@ -47,7 +47,8 @@
        const OnLayoutCallback& on_layout, LayoutTrigger layout_trigger,
        int dom_max_element_depth, float layout_refresh_rate,
        const std::string& language, bool enable_image_animations,
-       LayoutStatTracker* layout_stat_tracker);
+       LayoutStatTracker* layout_stat_tracker,
+       bool clear_window_with_background_color);
   ~Impl();
 
   // From dom::DocumentObserver.
@@ -110,6 +111,8 @@
 
   bool suspended_;
 
+  const bool clear_window_with_background_color_;
+
   DISALLOW_COPY_AND_ASSIGN(Impl);
 };
 
@@ -162,7 +165,8 @@
     const OnLayoutCallback& on_layout, LayoutTrigger layout_trigger,
     int dom_max_element_depth, float layout_refresh_rate,
     const std::string& language, bool enable_image_animations,
-    LayoutStatTracker* layout_stat_tracker)
+    LayoutStatTracker* layout_stat_tracker,
+    bool clear_window_with_background_color)
     : window_(window),
       locale_(icu::Locale::createCanonical(language.c_str())),
       used_style_provider_(new UsedStyleProvider(
@@ -180,7 +184,8 @@
       dom_max_element_depth_(dom_max_element_depth),
       layout_refresh_rate_(layout_refresh_rate),
       layout_stat_tracker_(layout_stat_tracker),
-      suspended_(false) {
+      suspended_(false),
+      clear_window_with_background_color_(clear_window_with_background_color) {
   window_->document()->AddObserver(this);
   window_->SetSynchronousLayoutCallback(
       base::Bind(&Impl::DoSynchronousLayout, base::Unretained(this)));
@@ -275,7 +280,7 @@
         locale_, window_->document(), dom_max_element_depth_,
         used_style_provider_.get(), layout_stat_tracker_,
         line_break_iterator_.get(), character_break_iterator_.get(),
-        &initial_containing_block_);
+        &initial_containing_block_, clear_window_with_background_color_);
     are_computed_styles_and_box_tree_dirty_ = false;
   }
 }
@@ -434,10 +439,12 @@
     const OnLayoutCallback& on_layout, LayoutTrigger layout_trigger,
     const int dom_max_element_depth, const float layout_refresh_rate,
     const std::string& language, bool enable_image_animations,
-    LayoutStatTracker* layout_stat_tracker)
+    LayoutStatTracker* layout_stat_tracker,
+    bool clear_window_with_background_color)
     : impl_(new Impl(name, window, on_render_tree_produced, on_layout,
                      layout_trigger, dom_max_element_depth, layout_refresh_rate,
-                     language, enable_image_animations, layout_stat_tracker)) {}
+                     language, enable_image_animations, layout_stat_tracker,
+                     clear_window_with_background_color)) {}
 
 LayoutManager::~LayoutManager() {}
 
diff --git a/src/cobalt/layout/layout_manager.h b/src/cobalt/layout/layout_manager.h
index 1092cce..bc3d592 100644
--- a/src/cobalt/layout/layout_manager.h
+++ b/src/cobalt/layout/layout_manager.h
@@ -73,7 +73,8 @@
                 const int dom_max_element_depth,
                 const float layout_refresh_rate, const std::string& language,
                 bool enable_image_animations,
-                LayoutStatTracker* layout_stat_tracker);
+                LayoutStatTracker* layout_stat_tracker,
+                bool clear_window_with_background_color);
   ~LayoutManager();
 
   void Suspend();
diff --git a/src/cobalt/layout/replaced_box.cc b/src/cobalt/layout/replaced_box.cc
index 1dd410a..2a04e44 100644
--- a/src/cobalt/layout/replaced_box.cc
+++ b/src/cobalt/layout/replaced_box.cc
@@ -320,7 +320,7 @@
 #if defined(FORCE_VIDEO_EXTERNAL_MESH)
     if (!*is_video_punched_out_) {
       AnimateNode::Builder animate_node_builder;
-      scoped_refptr<ImageNode> image_node = new ImageNode(NULL);
+      scoped_refptr<ImageNode> image_node = new ImageNode(nullptr);
       animate_node_builder.Add(
           image_node, base::Bind(&AnimateVideoImage, replace_image_cb_));
 
@@ -612,7 +612,7 @@
     const cssom::MapToMeshFunction* mtm_function) const {
   // First setup the animated image node.
   AnimateNode::Builder animate_node_builder;
-  scoped_refptr<ImageNode> image_node = new ImageNode(NULL);
+  scoped_refptr<ImageNode> image_node = new ImageNode(nullptr);
   animate_node_builder.Add(image_node,
                            base::Bind(&AnimateVideoImage, replace_image_cb_));
   scoped_refptr<AnimateNode> animate_node =
diff --git a/src/cobalt/layout_tests/testdata/css3-fonts/color-emojis-should-render-properly.html b/src/cobalt/layout_tests/testdata/css3-fonts/color-emojis-should-render-properly.html
index 19d0066..22e2cab 100644
--- a/src/cobalt/layout_tests/testdata/css3-fonts/color-emojis-should-render-properly.html
+++ b/src/cobalt/layout_tests/testdata/css3-fonts/color-emojis-should-render-properly.html
@@ -17,6 +17,9 @@
       background-color: #03a9f4;
       width: 500px;
     }
+    .bold-span {
+      font-weight: bold;
+    }
   </style>
 </head>
 <body>
@@ -26,7 +29,7 @@
     <span>&#x1f648;&#x1f649;&#x1f64a;&#x1f468;&#x1f469;&#x1f3c3;&#x1f40c;</span>
     <span>&#x1f41c;&#x1f490;&#x1f332;&#x1f347;&#x1f95d;&#x1f344;&#x1f354;</span>
     <span>&#x1f35f;&#x1f35e;&#x1f95e;&#x1f32e;&#x1f363;&#x1f361;&#x1f368;</span>
-    <span>&#x1f30e;&#x1f31a;</span>
+    <span class="bold-span">&#x1f30e;&#x1f31a;</span>
   </div>
 </body>
 </html>
diff --git a/src/cobalt/layout_tests/web_platform_tests.cc b/src/cobalt/layout_tests/web_platform_tests.cc
index 78cf442..0855f43 100644
--- a/src/cobalt/layout_tests/web_platform_tests.cc
+++ b/src/cobalt/layout_tests/web_platform_tests.cc
@@ -334,7 +334,6 @@
 
 // Temporarily disabled to allow V8 to start testing as the default JavaScript
 // engine on linux/android/raspi.  In order to get these to work we need to:
-// * Decouple our fetch/streams polyfills from our promise polfill.
 // * Fix ArrayBuffers (V8 optimizer is still getting tricked by these...)
 #if 0
 INSTANTIATE_TEST_CASE_P(
@@ -349,12 +348,9 @@
     mediasession, WebPlatformTest,
     ::testing::ValuesIn(EnumerateWebPlatformTests("mediasession")));
 
-// Disabled for the same reason as fetch.
-#if 0
 INSTANTIATE_TEST_CASE_P(streams, WebPlatformTest,
                         ::testing::ValuesIn(EnumerateWebPlatformTests(
                             "streams", "'ReadableStream' in this")));
-#endif
 
 #endif  // !defined(COBALT_WIN)
 
diff --git a/src/cobalt/loader/image/animated_webp_image.cc b/src/cobalt/loader/image/animated_webp_image.cc
index 79e1e64..d2570a0 100644
--- a/src/cobalt/loader/image/animated_webp_image.cc
+++ b/src/cobalt/loader/image/animated_webp_image.cc
@@ -21,6 +21,7 @@
 #include "cobalt/base/polymorphic_downcast.h"
 #include "cobalt/loader/image/image_decoder.h"
 #include "cobalt/render_tree/brush.h"
+#include "cobalt/render_tree/clear_rect_node.h"
 #include "cobalt/render_tree/composition_node.h"
 #include "cobalt/render_tree/image_node.h"
 #include "cobalt/render_tree/node.h"
@@ -252,19 +253,26 @@
     if (current_canvas_) {
       builder.AddChild(new render_tree::ImageNode(current_canvas_));
     } else {
-      scoped_ptr<render_tree::Brush> brush(
-          new render_tree::SolidColorBrush(background_color_));
-      builder.AddChild(
-          new render_tree::RectNode(math::RectF(size_), brush.Pass()));
+      builder.AddChild(new render_tree::ClearRectNode(math::RectF(size_),
+                                                      background_color_));
     }
     // Dispose previous frame by adding a solid rectangle.
     if (should_dispose_previous_frame_to_background_) {
-      scoped_ptr<render_tree::Brush> brush(
-          new render_tree::SolidColorBrush(background_color_));
-      builder.AddChild(
-          new render_tree::RectNode(previous_frame_rect_, brush.Pass()));
+      builder.AddChild(new render_tree::ClearRectNode(previous_frame_rect_,
+                                                      background_color_));
     }
+
     // Add the current frame.
+    if (webp_iterator.blend_method == WEBP_MUX_NO_BLEND) {
+      // If blending is disabled, first clear the image region to transparent
+      // before rendering.
+      builder.AddChild(new render_tree::ClearRectNode(
+          math::RectF(
+              math::PointF(webp_iterator.x_offset, webp_iterator.y_offset),
+              next_frame_image->GetSize()),
+          render_tree::ColorRGBA(0, 0, 0, 0)));
+    }
+
     builder.AddChild(new render_tree::ImageNode(
         next_frame_image,
         math::Vector2dF(webp_iterator.x_offset, webp_iterator.y_offset)));
diff --git a/src/cobalt/loader/loader.gyp b/src/cobalt/loader/loader.gyp
index 6f3d18f..3fc1dda 100644
--- a/src/cobalt/loader/loader.gyp
+++ b/src/cobalt/loader/loader.gyp
@@ -84,8 +84,6 @@
         'mesh/projection_codec/projection_decoder.h',
         'net_fetcher.cc',
         'net_fetcher.h',
-        'origin.cc',
-        'origin.h',
         'resource_cache.h',
         'sync_loader.cc',
         'sync_loader.h',
@@ -94,6 +92,7 @@
       'dependencies': [
         '<(DEPTH)/cobalt/base/base.gyp:base',
         '<(DEPTH)/cobalt/csp/csp.gyp:csp',
+        '<(DEPTH)/cobalt/loader/origin.gyp:origin',
         '<(DEPTH)/cobalt/network/network.gyp:network',
         '<(DEPTH)/cobalt/render_tree/render_tree.gyp:render_tree',
 	'<(DEPTH)/cobalt/renderer/test/png_utils/png_utils.gyp:png_utils',
diff --git a/src/cobalt/loader/origin.cc b/src/cobalt/loader/origin.cc
index b1aca32..b7ecc73 100644
--- a/src/cobalt/loader/origin.cc
+++ b/src/cobalt/loader/origin.cc
@@ -14,73 +14,53 @@
 
 #include "cobalt/loader/origin.h"
 
-namespace {
-// Returns true if the url can have non-opaque origin.
-// Blob URLs needs to be pre-processed.
-bool NonBlobURLCanHaveTupleOrigin(const GURL& url) {
-  if (url.SchemeIs("https")) {
-    return true;
-  } else if (url.SchemeIs("http")) {
-    return true;
-  } else if (url.SchemeIs("ftp")) {
-    return true;
-  } else if (url.SchemeIs("ws")) {
-    return true;
-  } else if (url.SchemeIs("wss")) {
-    return true;
-  }
-  return false;
-}
-// Returns false if url should be opaque.
-// Otherwise, extract origin tuple from the url and assemble them as a string
-// for easier access and comparison.
-bool NonBlobURLGetOriginStr(const GURL& url, std::string* output) {
-  if (!NonBlobURLCanHaveTupleOrigin(url)) {
-    return false;
-  }
-  *output = url.scheme() + "://" + url.host() +
-            (url.has_port() ? ":" + url.port() : "");
-  return true;
-}
-}  // namespace
-
 namespace cobalt {
 namespace loader {
 
-Origin::Origin() : is_opaque_(true) {}
-
-Origin::Origin(const GURL& url) : is_opaque_(false) {
-  if (url.is_valid() && url.has_scheme() && url.has_host()) {
-    if (url.SchemeIs("blob")) {
-      // Let path_url be the result of parsing URL's path.
-      // Return a new opaque origin, if url is failure, and url's origin
-      // otherwise.
-      GURL path_url(url.path());
-      if (path_url.is_valid() && path_url.has_host() && path_url.has_scheme() &&
-          NonBlobURLGetOriginStr(path_url, &origin_str_)) {
-        return;
-      }
-    } else if (NonBlobURLGetOriginStr(url, &origin_str_)) {
-      // Assign a tuple origin if given url is allowed to have one.
-      return;
-    }
-  }
-  // Othwise, return a new opaque origin.
-  is_opaque_ = true;
+bool Origin::Tuple::operator==(const Tuple& rhs) const {
+  return scheme == rhs.scheme && host == rhs.host && port == rhs.port;
 }
 
+// static
+base::optional<Origin::Tuple> Origin::GetTupleFromURL(
+    const GURL& url, bool recurse_into_blob_paths) {
+  if (!url.is_valid()) return base::nullopt;
+  if (!url.has_scheme()) return base::nullopt;
+  if (!url.has_host() && !url.SchemeIs("file")) return base::nullopt;
+
+  if (url.SchemeIs("blob") && recurse_into_blob_paths) {
+    // In the case of blobs, recurse into their path to determine the origin
+    // tuple.
+    return GetTupleFromURL(GURL(url.path()), false);
+  }
+
+  if (!url.SchemeIs("https") && !url.SchemeIs("http") && !url.SchemeIs("ftp") &&
+      !url.SchemeIs("ws") && !url.SchemeIs("wss") && !url.SchemeIs("file")) {
+    return base::nullopt;
+  }
+
+  return Origin::Tuple{url.scheme(), url.host(),
+                       url.has_port() ? url.port() : ""};
+}
+
+Origin::Origin() {}
+
+Origin::Origin(const GURL& url) : tuple_(GetTupleFromURL(url, true)) {}
+
 std::string Origin::SerializedOrigin() const {
-  if (is_opaque_) {
+  if (tuple_) {
+    return tuple_->scheme + "://" + tuple_->host +
+           (tuple_->port.empty() ? "" : ":" + tuple_->port);
+  } else {
     return "null";
   }
-  return origin_str_;
 }
 
 bool Origin::operator==(const Origin& rhs) const {
-  if (is_opaque_ || rhs.is_opaque_) {
+  if (!tuple_ || !rhs.tuple_) {
     return false;
   } else {
-    return origin_str_ == rhs.origin_str_;
+    return *tuple_ == *rhs.tuple_;
   }
 }
 
diff --git a/src/cobalt/loader/origin.gyp b/src/cobalt/loader/origin.gyp
new file mode 100644
index 0000000..ad8bcfb
--- /dev/null
+++ b/src/cobalt/loader/origin.gyp
@@ -0,0 +1,26 @@
+# Copyright 2018 Google Inc. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{
+  'targets': [
+    {
+      'target_name': 'origin',
+      'type': 'static_library',
+      'sources': [
+        'origin.cc',
+        'origin.h',
+      ],
+    },
+  ],
+}
diff --git a/src/cobalt/loader/origin.h b/src/cobalt/loader/origin.h
index 9c11e94..dfa0a19 100644
--- a/src/cobalt/loader/origin.h
+++ b/src/cobalt/loader/origin.h
@@ -17,6 +17,7 @@
 
 #include <string>
 
+#include "base/optional.h"
 #include "googleurl/src/gurl.h"
 
 namespace cobalt {
@@ -31,7 +32,7 @@
   explicit Origin(const GURL& url);
   // https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin
   std::string SerializedOrigin() const;
-  bool is_opaque() const { return is_opaque_; }
+  bool is_opaque() const { return !tuple_; }
   // Only document has an origin and no elements inherit document's origin, so
   // opaque origin comparison can always return false.
   // https://html.spec.whatwg.org/multipage/origin.html#same-origin
@@ -40,8 +41,20 @@
   bool operator!=(const Origin& rhs) const { return !(*this == rhs); }
 
  private:
-  bool is_opaque_;
-  std::string origin_str_;
+  struct Tuple {
+    bool operator==(const Tuple& rhs) const;
+
+    std::string scheme;
+    std::string host;
+    std::string port;
+  };
+
+  // Helper function for extracting a tuple from a URL.  If a tuple cannot
+  // be extracted, then base::nullopt is returned.
+  static base::optional<Origin::Tuple> GetTupleFromURL(
+      const GURL& url, bool recurse_into_blob_paths);
+
+  base::optional<Tuple> tuple_;
 };
 }  // namespace loader
 }  // namespace cobalt
diff --git a/src/cobalt/math/transform_2d.cc b/src/cobalt/math/transform_2d.cc
index 9be27e7..1386ece 100644
--- a/src/cobalt/math/transform_2d.cc
+++ b/src/cobalt/math/transform_2d.cc
@@ -20,35 +20,44 @@
 namespace cobalt {
 namespace math {
 
-cobalt::math::Matrix3F TranslateMatrix(float x, float y) {
-  return cobalt::math::Matrix3F::FromValues(
+Matrix3F TranslateMatrix(float x, float y) {
+  return Matrix3F::FromValues(
       1.0f, 0,    x,
       0,    1.0f, y,
       0,    0,    1.0f);
 }
 
-cobalt::math::Matrix3F ScaleMatrix(float x_scale, float y_scale) {
-  return cobalt::math::Matrix3F::FromValues(
+Matrix3F ScaleMatrix(float x_scale, float y_scale) {
+  return Matrix3F::FromValues(
       x_scale, 0,       0,
       0,       y_scale, 0,
       0,       0,       1.0f);
 }
 
-cobalt::math::Matrix3F ScaleMatrix(float scale) {
+Matrix3F ScaleMatrix(float scale) {
   return ScaleMatrix(scale, scale);
 }
 
-cobalt::math::Matrix3F RotateMatrix(float counter_clockwise_angle_in_radians) {
+Matrix3F RotateMatrix(float counter_clockwise_angle_in_radians) {
   float sin_theta = sin(counter_clockwise_angle_in_radians);
   float cos_theta = cos(counter_clockwise_angle_in_radians);
 
   // Rotation matrix for a space where up is represented by negative y.
-  return cobalt::math::Matrix3F::FromValues(
+  return Matrix3F::FromValues(
       cos_theta,  sin_theta,  0,
       -sin_theta, cos_theta,  0,
       0,          0,          1.0f);
 }
 
+Vector2dF GetScale2d(const Matrix3F& transform) {
+  float m00 = transform(0, 0);
+  float m01 = transform(0, 1);
+  float m10 = transform(1, 0);
+  float m11 = transform(1, 1);
+  return Vector2dF(std::sqrt(m00 * m00 + m10 * m10),
+                   std::sqrt(m01 * m01 + m11 * m11));
+}
+
 bool IsOnlyScaleAndTranslate(const Matrix3F& transform) {
   const float kEpsilon = 0.0001f;
   return std::abs(transform(0, 1)) < kEpsilon &&
diff --git a/src/cobalt/math/transform_2d.h b/src/cobalt/math/transform_2d.h
index d6b6d3d..af376f0 100644
--- a/src/cobalt/math/transform_2d.h
+++ b/src/cobalt/math/transform_2d.h
@@ -21,20 +21,28 @@
 namespace cobalt {
 namespace math {
 
-cobalt::math::Matrix3F TranslateMatrix(float x, float y);
-inline cobalt::math::Matrix3F TranslateMatrix(
-    const math::Vector2dF& translate) {
+// Get a transform matrix with only the specified translation.
+Matrix3F TranslateMatrix(float x, float y);
+inline Matrix3F TranslateMatrix(const Vector2dF& translate) {
   return TranslateMatrix(translate.x(), translate.y());
 }
 
-cobalt::math::Matrix3F ScaleMatrix(float x_scale, float y_scale);
-inline cobalt::math::Matrix3F ScaleMatrix(const math::Vector2dF& scale) {
+// Get a transform matrix with only the specified scaling.
+Matrix3F ScaleMatrix(float x_scale, float y_scale);
+inline Matrix3F ScaleMatrix(const Vector2dF& scale) {
   return ScaleMatrix(scale.x(), scale.y());
 }
 
-cobalt::math::Matrix3F ScaleMatrix(float scale);
-cobalt::math::Matrix3F RotateMatrix(float counter_clockwise_angle_in_radians);
+// Get a transform matrix with only the specified uniform scaling.
+Matrix3F ScaleMatrix(float scale);
 
+// Get a transform matrix with only the specified rotation.
+Matrix3F RotateMatrix(float counter_clockwise_angle_in_radians);
+
+// Get the x-axis and y-axis scale factors of the given transform.
+Vector2dF GetScale2d(const Matrix3F& transform);
+
+// Determine if the given transform only scales and/or translates.
 bool IsOnlyScaleAndTranslate(const Matrix3F& transform);
 
 }  // namespace math
diff --git a/src/cobalt/media/base/drm_system.cc b/src/cobalt/media/base/drm_system.cc
index f03ba30..886e972 100644
--- a/src/cobalt/media/base/drm_system.cc
+++ b/src/cobalt/media/base/drm_system.cc
@@ -237,7 +237,7 @@
                                                            error_message);
     }
 
-    // Sweep the context of |GenerateSessionUpdateRequest|.
+    // Sweep the context of |GenerateSessionUpdateRequest| once license updated.
     ticket_to_session_update_request_map_.erase(
         session_update_request_iterator);
   } else {
diff --git a/src/cobalt/media/base/drm_system.h b/src/cobalt/media/base/drm_system.h
index 9a06ffc..805085a 100644
--- a/src/cobalt/media/base/drm_system.h
+++ b/src/cobalt/media/base/drm_system.h
@@ -213,7 +213,6 @@
       scoped_array<uint8> message, int message_size);
   void OnSessionUpdated(int ticket, SbDrmStatus status,
                         const std::string& error_message);
-
 #if SB_HAS(DRM_KEY_STATUSES)
   void OnSessionKeyStatusChanged(
       const std::string& session_id, const std::vector<std::string>& key_ids,
diff --git a/src/cobalt/media/sandbox/media_sandbox.cc b/src/cobalt/media/sandbox/media_sandbox.cc
index aca6a1c..f39a394 100644
--- a/src/cobalt/media/sandbox/media_sandbox.cc
+++ b/src/cobalt/media/sandbox/media_sandbox.cc
@@ -121,7 +121,7 @@
 
 void MediaSandbox::Impl::SetupAndSubmitScene() {
   scoped_refptr<render_tree::ImageNode> image_node =
-      new render_tree::ImageNode(NULL);
+      new render_tree::ImageNode(nullptr);
   render_tree::animations::AnimateNode::Builder animate_node_builder;
 
   animate_node_builder.Add(
diff --git a/src/cobalt/media_capture/blob_event.h b/src/cobalt/media_capture/blob_event.h
new file mode 100644
index 0000000..fca77cb
--- /dev/null
+++ b/src/cobalt/media_capture/blob_event.h
@@ -0,0 +1,77 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COBALT_MEDIA_CAPTURE_BLOB_EVENT_H_
+#define COBALT_MEDIA_CAPTURE_BLOB_EVENT_H_
+
+#include <limits>
+#include <string>
+
+#include "cobalt/dom/blob.h"
+#include "cobalt/dom/event.h"
+#include "cobalt/media_capture/blob_event_init.h"
+#include "cobalt/script/wrappable.h"
+
+namespace cobalt {
+namespace media_capture {
+
+// Implements the WebAPI defined at
+// https://w3c.github.io/mediacapture-record/#blob-event
+class BlobEvent : public dom::Event {
+ public:
+  explicit BlobEvent(base::Token type,
+                     const media_capture::BlobEventInit& blob_event_init)
+      : dom::Event(type) {
+    Init(blob_event_init);
+  }
+  explicit BlobEvent(const std::string& type,
+                     const media_capture::BlobEventInit& blob_event_init)
+      : dom::Event(type) {
+    Init(blob_event_init);
+  }
+  explicit BlobEvent(base::Token type, const scoped_refptr<dom::Blob>& blob,
+                     double timecode)
+      : dom::Event(type), blob_(blob), timecode_(timecode) {}
+  explicit BlobEvent(const std::string& type,
+                     const scoped_refptr<dom::Blob>& blob, double timecode)
+      : dom::Event(type), blob_(blob), timecode_(timecode) {}
+
+  scoped_refptr<dom::Blob> data() const { return blob_; }
+  double timecode() const { return timecode_; }
+
+  DEFINE_WRAPPABLE_TYPE(BlobEvent);
+
+  void TraceMembers(script::Tracer* tracer) override {
+    dom::Event::TraceMembers(tracer);
+    tracer->Trace(blob_);
+  }
+
+ protected:
+  void Init(const media_capture::BlobEventInit& blob_event_init) {
+    if (blob_event_init.has_data()) {
+      blob_ = blob_event_init.data();
+    }
+    if (blob_event_init.has_timecode()) {
+      timecode_ = blob_event_init.timecode();
+    }
+  }
+
+  scoped_refptr<dom::Blob> blob_;
+  double timecode_ = std::numeric_limits<double>::quiet_NaN();
+};
+
+}  // namespace media_capture
+}  // namespace cobalt
+
+#endif  // COBALT_MEDIA_CAPTURE_BLOB_EVENT_H_
diff --git a/src/cobalt/media_capture/blob_event.idl b/src/cobalt/media_capture/blob_event.idl
new file mode 100644
index 0000000..9952da4
--- /dev/null
+++ b/src/cobalt/media_capture/blob_event.idl
@@ -0,0 +1,22 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This IDL is derived from the BlobEvent specification from
+// https://w3c.github.io/mediacapture-record/#blobevent-section.
+
+[ Exposed=Window, Constructor(DOMString type, BlobEventInit eventInitDict) ]
+interface BlobEvent : Event {
+  [SameObject] readonly attribute Blob data;
+  readonly attribute DOMHighResTimeStamp timecode;
+};
diff --git a/src/cobalt/dom/array_buffer_view.idl b/src/cobalt/media_capture/blob_event_init.idl
similarity index 64%
rename from src/cobalt/dom/array_buffer_view.idl
rename to src/cobalt/media_capture/blob_event_init.idl
index 3b8902a..f33b422 100644
--- a/src/cobalt/dom/array_buffer_view.idl
+++ b/src/cobalt/media_capture/blob_event_init.idl
@@ -1,4 +1,4 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
+// Copyright 2018 Google Inc. All Rights Reserved.
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -12,11 +12,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// https://www.khronos.org/registry/typedarray/specs/latest/#6
+// This IDL is derived from the BlobEventInit specification from
+// https://w3c.github.io/mediacapture-record/#blobeventinit
 
-[NoInterfaceObject]
-interface ArrayBufferView {
-    readonly attribute ArrayBuffer buffer;
-    readonly attribute unsigned long byteOffset;
-    readonly attribute unsigned long byteLength;
+dictionary BlobEventInit {
+  required Blob data;
+  DOMHighResTimeStamp timecode;
 };
diff --git a/src/cobalt/media_capture/media_capture_test.gyp b/src/cobalt/media_capture/media_capture_test.gyp
index c5903c7..e9c2bdf 100644
--- a/src/cobalt/media_capture/media_capture_test.gyp
+++ b/src/cobalt/media_capture/media_capture_test.gyp
@@ -22,6 +22,7 @@
       'type': '<(gtest_target_type)',
       'sources': [
         'get_user_media_test.cc',
+        'media_recorder_test.cc',
       ],
       'dependencies': [
         '<(DEPTH)/cobalt/dom/dom.gyp:dom',
diff --git a/src/cobalt/media_capture/media_recorder.cc b/src/cobalt/media_capture/media_recorder.cc
index 638048c..98b8b39 100644
--- a/src/cobalt/media_capture/media_recorder.cc
+++ b/src/cobalt/media_capture/media_recorder.cc
@@ -19,11 +19,18 @@
 
 #include "base/message_loop.h"
 #include "base/string_piece.h"
-#include "cobalt/dom/array_buffer.h"
+#include "base/string_util_starboard.h"
+#include "cobalt/base/polymorphic_downcast.h"
+#include "cobalt/base/tokens.h"
 #include "cobalt/dom/blob.h"
 #include "cobalt/dom/dom_exception.h"
+#include "cobalt/dom/dom_settings.h"
+#include "cobalt/media_capture/blob_event.h"
+#include "cobalt/media_stream/audio_parameters.h"
+#include "cobalt/media_stream/media_stream_audio_track.h"
 #include "cobalt/media_stream/media_stream_track.h"
 #include "cobalt/media_stream/media_track_settings.h"
+#include "cobalt/script/array_buffer.h"
 
 namespace {
 
@@ -31,13 +38,21 @@
 const char kLinear16MimeType[] = "audio/L16";
 
 const int32 kMinimumTimeSliceInMilliseconds = 1;
+const int32 kSchedulingLatencyBufferMilliseconds = 20;
 
-// Read Microphone input every few milliseconds, so that
-// the input buffer doesn't fill up.
-const int32 kDefaultMicrophoneReadThresholdMilliseconds = 50;
-
-const double kSchedulingLatencyBufferSeconds = 0.20;
-
+// Returns the number of bytes needed to store |time_span| duration
+// of audio that has a bitrate of |bits_per_second|.
+int64 GetRecommendedBufferSizeInBytes(base::TimeDelta time_span,
+                                      int64 bits_per_second) {
+  DCHECK_GE(time_span, base::TimeDelta::FromSeconds(0));
+  // Increase buffer slightly to account for the fact that scheduling our
+  // tasks might be a little bit noisy.
+  double buffer_window_span_seconds = time_span.InSecondsF();
+  int64 recommended_buffer_size = static_cast<int64>(
+      std::ceil(buffer_window_span_seconds * bits_per_second / 8));
+  DCHECK_GT(recommended_buffer_size, 0);
+  return recommended_buffer_size;
+}
 }  // namespace
 
 namespace cobalt {
@@ -45,6 +60,7 @@
 
 void MediaRecorder::Start(int32 timeslice,
                           script::ExceptionState* exception_state) {
+  DCHECK(stream_);
   DCHECK(thread_checker_.CalledOnValidThread());
   // Following the spec at
   // https://www.w3.org/TR/mediastream-recording/#mediarecorder-methods:
@@ -56,14 +72,21 @@
   // Step #3
   if (recording_state_ != kRecordingStateInactive) {
     dom::DOMException::Raise(dom::DOMException::kInvalidStateErr,
-                             "Internal error: Unable to get DOM settings.",
+                             "Recording state must be inactive.",
                              exception_state);
     return;
   }
 
-  // Step #4-5.3, not needed for Cobalt.
+  // Step #4, not needed for Cobalt.
+
+  // Step 5.
   recording_state_ = kRecordingStateRecording;
 
+  // Step 5.1.
+  DispatchEvent(new dom::Event(base::Tokens::start()));
+
+  // Steps 5.2-5.3, not needed for Cobalt.
+
   // Step #5.4, create a new Blob, and start collecting data.
 
   // If timeslice is not undefined, then once a minimum of timeslice
@@ -71,59 +94,21 @@
   // imposed by the UA, whichever is greater, start gathering data into a new
   // Blob blob, and queue a task, using the DOM manipulation task source, that
   // fires a blob event named |dataavailable| at target.
-
-  // We need to drain the media frequently, so try to read atleast once every
-  // |read_frequency_| interval.
-  int32 effective_time_slice_milliseconds =
-      std::min(kDefaultMicrophoneReadThresholdMilliseconds, timeslice);
   // Avoid rounding down to 0 milliseconds.
-  effective_time_slice_milliseconds = std::max(
-      kMinimumTimeSliceInMilliseconds, effective_time_slice_milliseconds);
-  read_frequency_ =
-      base::TimeDelta::FromMilliseconds(effective_time_slice_milliseconds);
+  int effective_time_slice_milliseconds =
+      std::max(kMinimumTimeSliceInMilliseconds, timeslice);
+  DCHECK_GT(effective_time_slice_milliseconds, 0);
 
   // This is the frequency we will callback to Javascript.
-  callback_frequency_ = base::TimeDelta::FromMilliseconds(timeslice);
+  timeslice_ =
+      base::TimeDelta::FromMilliseconds(effective_time_slice_milliseconds);
 
-  int64 buffer_size_hint = GetRecommendedBufferSize(callback_frequency_);
-  recorded_buffer_.HintTypicalSize(static_cast<size_t>(buffer_size_hint));
+  slice_origin_timestamp_ = base::TimeTicks::Now();
 
-  ResetLastCallbackTime();
-  ReadStreamAndDoCallback();
+  script::Sequence<scoped_refptr<media_stream::MediaStreamTrack>>&
+      audio_tracks = stream_->GetAudioTracks();
 
-  stream_reader_callback_.Reset(
-      base::Bind(&MediaRecorder::ReadStreamAndDoCallback, this));
-  MessageLoop::current()->PostTask(FROM_HERE,
-                                   stream_reader_callback_.callback());
-
-  // Step #5.5, not needed.
-
-  // Step #6, return undefined.
-}
-
-void MediaRecorder::Stop(script::ExceptionState* exception_state) {
-  DCHECK(thread_checker_.CalledOnValidThread());
-  UNREFERENCED_PARAMETER(exception_state);
-  NOTREACHED();
-}
-
-MediaRecorder::MediaRecorder(
-    script::EnvironmentSettings* settings,
-    const scoped_refptr<media_stream::MediaStream>& stream,
-    const MediaRecorderOptions& options)
-    : settings_(settings), stream_(stream) {
-  // Per W3C spec, the default value of this is platform-specific,
-  // so Linear16 was chosen. Spec url:
-  // https://www.w3.org/TR/mediastream-recording/#dom-mediarecorder-mediarecorder
-  mime_type_ =
-      options.has_mime_type() ? options.mime_type() : kLinear16MimeType;
-}
-
-void MediaRecorder::ReadStreamAndDoCallback() {
-  DCHECK(stream_);
-  DCHECK(thread_checker_.CalledOnValidThread());
-
-  size_t number_audio_tracks = stream_->GetAudioTracks().size();
+  size_t number_audio_tracks = audio_tracks.size();
   if (number_audio_tracks == 0) {
     LOG(WARNING) << "Audio Tracks are empty.";
     return;
@@ -131,131 +116,177 @@
   LOG_IF(WARNING, number_audio_tracks > 1)
       << "Only recording the first audio track.";
 
-  base::TimeTicks current_time = base::TimeTicks::Now();
-  base::TimeDelta time_difference = last_callback_time_ - current_time;
+  auto* first_audio_track =
+      base::polymorphic_downcast<media_stream::MediaStreamAudioTrack*>(
+          audio_tracks.begin()->get());
+  DCHECK(first_audio_track);
+  first_audio_track->AddSink(this);
 
-  int64 recommended_buffer_size = GetRecommendedBufferSize(time_difference);
-  base::StringPiece writeable_buffer = recorded_buffer_.GetWriteCursor(
-      static_cast<size_t>(recommended_buffer_size));
+  // Step #5.5 is implemented in |MediaRecorder::OnReadyStateChanged|.
 
-  media_stream::MediaStreamTrack* track =
-      stream_->GetAudioTracks().begin()->get();
-
-  int64 bytes_read = track->Read(writeable_buffer);
-
-  if (bytes_read < 0) {
-    // An error occured, so do not post another read.
-    DoOnDataCallback();
-    return;
-  }
-
-  DCHECK_LE(bytes_read, static_cast<int64>(writeable_buffer.size()));
-  recorded_buffer_.IncrementCursorPosition(static_cast<size_t>(bytes_read));
-
-  if (current_time >= GetNextCallbackTime()) {
-    DoOnDataCallback();
-    ResetLastCallbackTime();
-  }
-
-  // Note that GetNextCallbackTime() should not be cached, since
-  // ResetLastCallbackTime() above can change its value.
-  base::TimeDelta time_until_expiration = GetNextCallbackTime() - current_time;
-
-  // Consider the scenario where |time_until_expiration| is 4ms, and
-  // read_frequency is 10ms.  In this case, just do the read 4 milliseconds
-  // later, and then do the callback.
-  base::TimeDelta delay_until_next_read =
-      std::min(time_until_expiration, read_frequency_);
-
-  MessageLoop::current()->PostDelayedTask(
-      FROM_HERE, stream_reader_callback_.callback(), delay_until_next_read);
+  // Step #6, return undefined.
 }
 
-void MediaRecorder::DoOnDataCallback() {
+void MediaRecorder::Stop(script::ExceptionState* exception_state) {
   DCHECK(thread_checker_.CalledOnValidThread());
-  if (recorded_buffer_.GetWrittenChunk().empty()) {
+
+  if (recording_state_ == kRecordingStateInactive) {
+    dom::DOMException::Raise(dom::DOMException::kInvalidStateErr,
+                             "Recording state must NOT be inactive.",
+                             exception_state);
+    return;
+  }
+  StopRecording();
+}
+
+void MediaRecorder::OnData(const ShellAudioBus& audio_bus,
+                           base::TimeTicks reference_time) {
+  // The source is always int16 data from the microphone.
+  DCHECK_EQ(audio_bus.sample_type(), ShellAudioBus::kInt16);
+  DCHECK_EQ(audio_bus.channels(), 1);
+  const char* data =
+      reinterpret_cast<const char*>(audio_bus.interleaved_data());
+  size_t data_size = audio_bus.GetSampleSizeInBytes() * audio_bus.frames();
+  base::TimeTicks now = base::TimeTicks::Now();
+  bool last_in_slice = now > slice_origin_timestamp_ + timeslice_;
+
+  if (last_in_slice) {
+    DLOG(INFO) << "Slice finished.";
+    // The next slice's timestamp is now.
+    slice_origin_timestamp_ = now;
+  }
+
+  WriteData(data, data_size, last_in_slice, reference_time);
+}
+
+void MediaRecorder::OnSetFormat(const media_stream::AudioParameters& params) {
+  bits_per_second_ = params.GetBitsPerSecond();
+
+  // Add some padding to the end of the buffer to account for jitter in
+  // scheduling, etc.
+  // This allows us to potentially avoid unnecessary resizing.
+  base::TimeDelta recommended_time_slice =
+      timeslice_ +
+      base::TimeDelta::FromMilliseconds(kSchedulingLatencyBufferMilliseconds);
+  int64 buffer_size_hint =
+      GetRecommendedBufferSizeInBytes(recommended_time_slice, bits_per_second_);
+  buffer_.reserve(static_cast<size_t>(buffer_size_hint));
+}
+
+void MediaRecorder::OnReadyStateChanged(
+    media_stream::MediaStreamTrack::ReadyState new_state) {
+  // Step 5.5 from start(), defined at:
+  // https://www.w3.org/TR/mediastream-recording/#mediarecorder-methods
+  if (new_state == media_stream::MediaStreamTrack::kReadyStateEnded) {
+    StopRecording();
+    stream_ = nullptr;
+  }
+}
+
+MediaRecorder::MediaRecorder(
+    script::EnvironmentSettings* settings,
+    const scoped_refptr<media_stream::MediaStream>& stream,
+    const MediaRecorderOptions& options)
+    : settings_(settings),
+      stream_(stream),
+      javascript_message_loop_(base::MessageLoopProxy::current()) {
+  // Per W3C spec, the default value of this is platform-specific,
+  // so Linear16 was chosen. Spec url:
+  // https://www.w3.org/TR/mediastream-recording/#dom-mediarecorder-mediarecorder
+  mime_type_ =
+      options.has_mime_type() ? options.mime_type() : kLinear16MimeType;
+
+  blob_options_.set_type(mime_type_);
+}
+
+void MediaRecorder::StopRecording() {
+  DCHECK(stream_);
+  DCHECK_NE(recording_state_, kRecordingStateInactive);
+
+  recording_state_ = kRecordingStateInactive;
+  UnsubscribeFromTrack();
+
+  WriteData(nullptr, 0, true, base::TimeTicks::Now());
+
+  timeslice_ = base::TimeDelta::FromSeconds(0);
+  DispatchEvent(new dom::Event(base::Tokens::stop()));
+}
+
+void MediaRecorder::UnsubscribeFromTrack() {
+  DCHECK(stream_);
+  script::Sequence<scoped_refptr<media_stream::MediaStreamTrack>>&
+      audio_tracks = stream_->GetAudioTracks();
+  size_t number_audio_tracks = audio_tracks.size();
+  if (number_audio_tracks == 0) {
+    LOG(WARNING) << "Audio Tracks are empty.";
+    return;
+  }
+  auto* first_audio_track =
+      base::polymorphic_downcast<media_stream::MediaStreamAudioTrack*>(
+          audio_tracks.begin()->get());
+  DCHECK(first_audio_track);
+
+  first_audio_track->RemoveSink(this);
+}
+
+void MediaRecorder::DoOnDataCallback(scoped_ptr<std::vector<uint8>> data,
+                                     base::TimeTicks timecode) {
+  if (javascript_message_loop_ != base::MessageLoopProxy::current()) {
+    javascript_message_loop_->PostTask(
+        FROM_HERE, base::Bind(&MediaRecorder::DoOnDataCallback, this,
+                              base::Passed(&data), timecode));
+    return;
+  }
+  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK(data);
+
+  if (data->empty()) {
     DLOG(WARNING) << "No data was recorded.";
     return;
   }
 
-  base::StringPiece written_data = recorded_buffer_.GetWrittenChunk();
-  DCHECK_LE(written_data.size(), kuint32max);
-  uint32 number_of_written_bytes = static_cast<uint32>(written_data.size());
+  DCHECK_LE(data->size(), kuint32max);
 
-  auto array_buffer = make_scoped_refptr(new dom::ArrayBuffer(
-      settings_, reinterpret_cast<const uint8*>(written_data.data()),
-      number_of_written_bytes));
-  recorded_buffer_.Reset();
+  auto array_buffer = script::ArrayBuffer::New(
+      base::polymorphic_downcast<dom::DOMSettings*>(settings_)
+          ->global_environment(),
+      data->data(), data->size());
+  data->clear();
 
-  auto blob = make_scoped_refptr(new dom::Blob(settings_, array_buffer));
-  // TODO: Post a task to fire BlobEvent (constructed out of |blob| and
-  // |array_buffer| at target.
+  auto blob =
+      make_scoped_refptr(new dom::Blob(settings_, array_buffer, blob_options_));
+
+  DispatchEvent(new media_capture::BlobEvent(base::Tokens::dataavailable(),
+                                             blob, timecode.ToInternalValue()));
 }
 
-void MediaRecorder::ResetLastCallbackTime() {
-  DCHECK(thread_checker_.CalledOnValidThread());
-  last_callback_time_ = base::TimeTicks::Now();
-}
+void MediaRecorder::WriteData(const char* data, size_t length,
+                              bool last_in_slice, base::TimeTicks timecode) {
+  buffer_.insert(buffer_.end(), data, data + length);
 
-void MediaRecorder::CalculateStreamBitrate() {
-  DCHECK(thread_checker_.CalledOnValidThread());
-  media_stream::MediaStreamTrack* track =
-      stream_->GetAudioTracks().begin()->get();
-  const media_stream::MediaTrackSettings& settings = track->GetSettings();
-  DCHECK_GT(settings.sample_rate(), 0);
-  DCHECK_GT(settings.sample_size(), 0);
-  DCHECK_GT(settings.channel_count(), 0);
-  bitrate_bps_ = settings.sample_rate() * settings.sample_size() *
-                 settings.channel_count();
-  DCHECK_GT(bitrate_bps_, 0);
-}
+  if (!last_in_slice) {
+    return;
+  }
 
-int64 MediaRecorder::GetRecommendedBufferSize(base::TimeDelta time_span) const {
-  DCHECK_GE(time_span, base::TimeDelta::FromSeconds(0));
-  // Increase buffer slightly to account for the fact that scheduling our
-  // tasks might be a little bit noisy.
-  double buffer_window_span_seconds =
-      time_span.InSecondsF() + kSchedulingLatencyBufferSeconds;
-  int64 recommended_buffer_size =
-      static_cast<int64>(std::ceil(buffer_window_span_seconds * bitrate_bps_));
-  DCHECK_GT(recommended_buffer_size, 0);
-  return recommended_buffer_size;
+  auto buffer_to_send(make_scoped_ptr(new std::vector<uint8>()));
+  buffer_to_send->swap(buffer_);
+  // Use the previous buffer size as a proxy for the next buffer size.
+  buffer_.reserve(buffer_to_send->size());
+  DoOnDataCallback(buffer_to_send.Pass(), timecode);
 }
 
 bool MediaRecorder::IsTypeSupported(const base::StringPiece mime_type) {
-  return mime_type == kLinear16MimeType;
-}
-
-base::StringPiece MediaRecorder::Buffer::GetWriteCursor(
-    size_t number_of_bytes) {
-  size_t minimim_required_size = current_position_ + number_of_bytes;
-  if (minimim_required_size > buffer_.size()) {
-    buffer_.resize(minimim_required_size);
+  base::StringPiece mime_type_container = mime_type;
+  size_t pos = mime_type.find_first_of(';');
+  if (pos != base::StringPiece::npos) {
+    mime_type_container = base::StringPiece(mime_type.begin(), pos);
   }
-  return base::StringPiece(reinterpret_cast<const char*>(buffer_.data()),
-                           number_of_bytes);
-}
-
-void MediaRecorder::Buffer::IncrementCursorPosition(size_t number_of_bytes) {
-  size_t new_position = current_position_ + number_of_bytes;
-  DCHECK_LE(new_position, buffer_.size());
-  current_position_ = new_position;
-}
-
-base::StringPiece MediaRecorder::Buffer::GetWrittenChunk() const {
-  return base::StringPiece(reinterpret_cast<const char*>(buffer_.data()),
-                           current_position_);
-}
-
-void MediaRecorder::Buffer::Reset() {
-  current_position_ = 0;
-  buffer_.resize(0);
-}
-
-void MediaRecorder::Buffer::HintTypicalSize(size_t number_of_bytes) {
-  // Cap the hint size to be 1 Megabyte.
-  const size_t kMaxBufferSizeHintInBytes = 1024 * 1024;
-  buffer_.reserve(std::min(number_of_bytes, kMaxBufferSizeHintInBytes));
+  const base::StringPiece linear16_mime_type(kLinear16MimeType);
+  auto match_iterator =
+      std::search(mime_type_container.begin(), mime_type_container.end(),
+                  linear16_mime_type.begin(), linear16_mime_type.end(),
+                  base::CaseInsensitiveCompareASCII<char>());
+  return match_iterator == mime_type_container.begin();
 }
 
 }  // namespace media_capture
diff --git a/src/cobalt/media_capture/media_recorder.h b/src/cobalt/media_capture/media_recorder.h
index cebaa73..1945b9d 100644
--- a/src/cobalt/media_capture/media_recorder.h
+++ b/src/cobalt/media_capture/media_recorder.h
@@ -20,14 +20,18 @@
 
 #include "base/basictypes.h"
 #include "base/cancelable_callback.h"
+#include "base/message_loop_proxy.h"
 #include "base/optional.h"
 #include "base/string_piece.h"
 #include "base/threading/thread_checker.h"
 #include "base/time.h"
+#include "cobalt/dom/blob_property_bag.h"
 #include "cobalt/dom/event_target.h"
 #include "cobalt/media_capture/media_recorder_options.h"
 #include "cobalt/media_capture/recording_state.h"
+#include "cobalt/media_stream/audio_parameters.h"
 #include "cobalt/media_stream/media_stream.h"
+#include "cobalt/media_stream/media_stream_audio_sink.h"
 #include "cobalt/script/environment_settings.h"
 #include "cobalt/script/wrappable.h"
 
@@ -36,7 +40,8 @@
 
 // This class represents a MediaRecorder, and implements the specification at:
 // https://www.w3.org/TR/mediastream-recording/#mediarecorder-api
-class MediaRecorder : public dom::EventTarget {
+class MediaRecorder : public media_stream::MediaStreamAudioSink,
+                      public dom::EventTarget {
  public:
   // Constructors.
   explicit MediaRecorder(
@@ -44,6 +49,13 @@
       const scoped_refptr<media_stream::MediaStream>& stream,
       const MediaRecorderOptions& options = MediaRecorderOptions());
 
+  ~MediaRecorder() override {
+    DCHECK(thread_checker_.CalledOnValidThread());
+    if (recording_state_ != kRecordingStateInactive) {
+      UnsubscribeFromTrack();
+    }
+  }
+
   // Readonly attributes.
   const std::string& mime_type() const { return mime_type_; }
 
@@ -59,6 +71,26 @@
   void Stop(script::ExceptionState* exception_state);
 
   // EventHandlers.
+  const EventListenerScriptValue* onstart() const {
+    DCHECK(thread_checker_.CalledOnValidThread());
+    return GetAttributeEventListener(base::Tokens::start());
+  }
+
+  void set_onstart(const EventListenerScriptValue& event_listener) {
+    DCHECK(thread_checker_.CalledOnValidThread());
+    SetAttributeEventListener(base::Tokens::start(), event_listener);
+  }
+
+  const EventListenerScriptValue* onstop() const {
+    DCHECK(thread_checker_.CalledOnValidThread());
+    return GetAttributeEventListener(base::Tokens::stop());
+  }
+
+  void set_onstop(const EventListenerScriptValue& event_listener) {
+    DCHECK(thread_checker_.CalledOnValidThread());
+    SetAttributeEventListener(base::Tokens::stop(), event_listener);
+  }
+
   const EventListenerScriptValue* onerror() const {
     DCHECK(thread_checker_.CalledOnValidThread());
     return GetAttributeEventListener(base::Tokens::error());
@@ -79,54 +111,45 @@
     SetAttributeEventListener(base::Tokens::dataavailable(), event_listener);
   }
 
+  // MediaStreamAudioSink overrides.
+  void OnData(const ShellAudioBus& audio_bus,
+              base::TimeTicks reference_time) override;
+  void OnSetFormat(const media_stream::AudioParameters& params) override;
+  void OnReadyStateChanged(
+      media_stream::MediaStreamTrack::ReadyState ready_state) override;
+
   DEFINE_WRAPPABLE_TYPE(MediaRecorder);
 
  private:
   MediaRecorder(const MediaRecorder&) = delete;
   MediaRecorder& operator=(const MediaRecorder&) = delete;
 
-  class Buffer {
-   public:
-    base::StringPiece GetWriteCursor(size_t number_of_bytes);
-    void IncrementCursorPosition(size_t number_of_bytes);
-    base::StringPiece GetWrittenChunk() const;
-    void Reset();
-    void HintTypicalSize(size_t number_of_bytes);
+  void StopRecording();
 
-   private:
-    size_t current_position_ = 0;
-    std::vector<uint8> buffer_;
-  };
+  void UnsubscribeFromTrack();
 
-  void ReadStreamAndDoCallback();
-  void DoOnDataCallback();
-  void ScheduleOnDataAvailableCallback();
-  void ResetLastCallbackTime();
-  void CalculateStreamBitrate();
-  int64 GetRecommendedBufferSize(base::TimeDelta time_span) const;
-  base::TimeTicks GetNextCallbackTime() const {
-    return last_callback_time_ + callback_frequency_;
-  }
+  void DoOnDataCallback(scoped_ptr<std::vector<uint8>> data,
+                        base::TimeTicks timecode);
+  void WriteData(const char* data, size_t length, bool last_in_slice,
+                 base::TimeTicks timecode);
 
   base::ThreadChecker thread_checker_;
+  std::vector<uint8> buffer_;
 
   RecordingState recording_state_ = kRecordingStateInactive;
 
   script::EnvironmentSettings* settings_;
   std::string mime_type_;
+  dom::BlobPropertyBag blob_options_;
   scoped_refptr<media_stream::MediaStream> stream_;
 
-  base::TimeTicks last_callback_time_;
-  // Frequency we will callback to Javascript.
-  base::TimeDelta callback_frequency_;
+  scoped_refptr<base::MessageLoopProxy> javascript_message_loop_;
+  base::TimeDelta timeslice_;
+  // Only used to determine if |timeslice_| amount of time has
+  // been passed since the slice was started.
+  base::TimeTicks slice_origin_timestamp_;
 
-  // Frequency we will read the stream.
-  base::TimeDelta read_frequency_;
-
-  int64 bitrate_bps_;
-  Buffer recorded_buffer_;
-
-  base::CancelableClosure stream_reader_callback_;
+  int64 bits_per_second_ = 0;
 };
 
 }  // namespace media_capture
diff --git a/src/cobalt/media_capture/media_recorder.idl b/src/cobalt/media_capture/media_recorder.idl
index 45b513f..6ef4062 100644
--- a/src/cobalt/media_capture/media_recorder.idl
+++ b/src/cobalt/media_capture/media_recorder.idl
@@ -19,6 +19,8 @@
 interface MediaRecorder : EventTarget {
   readonly attribute DOMString mimeType;
   attribute EventHandler ondataavailable;
+  attribute EventHandler onstart;
+  attribute EventHandler onstop;
   attribute EventHandler onerror;
 
   [RaisesException] void start(optional long timeslice);
diff --git a/src/cobalt/media_capture/media_recorder_test.cc b/src/cobalt/media_capture/media_recorder_test.cc
new file mode 100644
index 0000000..c1b4a47
--- /dev/null
+++ b/src/cobalt/media_capture/media_recorder_test.cc
@@ -0,0 +1,209 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "cobalt/media_capture/media_recorder.h"
+
+#include "cobalt/dom/dom_exception.h"
+#include "cobalt/dom/testing/mock_event_listener.h"
+#include "cobalt/media_capture/media_recorder_options.h"
+#include "cobalt/media_stream/media_stream.h"
+#include "cobalt/media_stream/media_stream_audio_source.h"
+#include "cobalt/media_stream/media_stream_audio_track.h"
+#include "cobalt/media_stream/testing/mock_media_stream_audio_track.h"
+#include "cobalt/script/testing/fake_script_value.h"
+#include "cobalt/script/testing/mock_exception_state.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+using ::testing::_;
+using ::testing::Eq;
+using ::testing::Pointee;
+using ::testing::Property;
+using ::testing::SaveArg;
+using ::testing::StrictMock;
+using cobalt::dom::EventListener;
+using cobalt::dom::testing::MockEventListener;
+using cobalt::script::testing::MockExceptionState;
+using cobalt::script::testing::FakeScriptValue;
+
+namespace cobalt {
+namespace media_stream {
+
+class FakeMediaStreamAudioSource : public MediaStreamAudioSource {
+ public:
+  MOCK_METHOD0(EnsureSourceIsStarted, bool());
+  MOCK_METHOD0(EnsureSourceIsStopped, void());
+
+  void DeliverDataToTracks(
+      const MediaStreamAudioTrack::ShellAudioBus& audio_bus,
+      base::TimeTicks reference_time) {
+    MediaStreamAudioSource::DeliverDataToTracks(audio_bus, reference_time);
+  }
+
+  void SetFormat(const media_stream::AudioParameters& params) {
+    MediaStreamAudioSource::SetFormat(params);
+  }
+};
+
+}  // namespace media_stream
+
+namespace media_capture {
+
+class MediaRecorderTest : public ::testing::Test {
+ protected:
+  MediaRecorderTest() {
+    auto audio_track = make_scoped_refptr(
+        new StrictMock<media_stream::MockMediaStreamAudioTrack>());
+    media_stream::MediaStream::TrackSequences sequences;
+    sequences.push_back(audio_track);
+    audio_track->Start(base::Bind(&base::DoNothing));
+    auto stream = make_scoped_refptr(new media_stream::MediaStream(sequences));
+    media_source_ = new StrictMock<media_stream::FakeMediaStreamAudioSource>();
+    EXPECT_CALL(*media_source_, EnsureSourceIsStarted());
+    EXPECT_CALL(*media_source_, EnsureSourceIsStopped());
+    media_source_->ConnectToTrack(audio_track);
+    media_recorder_ =
+        new MediaRecorder(nullptr, stream, MediaRecorderOptions());
+  }
+
+ protected:
+  scoped_refptr<media_capture::MediaRecorder> media_recorder_;
+  scoped_refptr<StrictMock<media_stream::FakeMediaStreamAudioSource>>
+      media_source_;
+  StrictMock<MockExceptionState> exception_state_;
+};
+
+TEST_F(MediaRecorderTest, CanSupportMimeType) {
+  EXPECT_TRUE(MediaRecorder::IsTypeSupported("audio/L16"));
+  EXPECT_TRUE(MediaRecorder::IsTypeSupported("audio/l16"));
+  EXPECT_TRUE(
+      MediaRecorder::IsTypeSupported("audio/l16;endianness=little-endian"));
+
+  EXPECT_FALSE(MediaRecorder::IsTypeSupported("audio/pcm"));
+  EXPECT_FALSE(MediaRecorder::IsTypeSupported("audio/webm"));
+  EXPECT_FALSE(MediaRecorder::IsTypeSupported("pcm"));
+  EXPECT_FALSE(MediaRecorder::IsTypeSupported("L16"));
+  EXPECT_FALSE(MediaRecorder::IsTypeSupported("L16"));
+}
+
+TEST_F(MediaRecorderTest, StartStopStartStop) {
+  media_recorder_->Start(&exception_state_);
+  media_recorder_->Stop(&exception_state_);
+  media_recorder_->Start(&exception_state_);
+  media_recorder_->Stop(&exception_state_);
+}
+
+TEST_F(MediaRecorderTest, ExceptionOnStartingTwiceWithoutStop) {
+  scoped_refptr<script::ScriptException> exception;
+
+  EXPECT_CALL(exception_state_, SetException(_))
+      .WillOnce(SaveArg<0>(&exception));
+
+  media_recorder_->Start(&exception_state_);
+  media_recorder_->Start(&exception_state_);
+
+  ASSERT_TRUE(exception.get());
+  dom::DOMException& dom_exception(
+      *base::polymorphic_downcast<dom::DOMException*>(exception.get()));
+  EXPECT_EQ(dom::DOMException::kInvalidStateErr, dom_exception.code());
+  EXPECT_EQ(dom_exception.message(), "Recording state must be inactive.");
+}
+
+TEST_F(MediaRecorderTest, ExceptionOnStoppingTwiceWithoutStartingInBetween) {
+  scoped_refptr<script::ScriptException> exception;
+
+  EXPECT_CALL(exception_state_, SetException(_))
+      .WillOnce(SaveArg<0>(&exception));
+
+  media_recorder_->Start(&exception_state_);
+  media_recorder_->Stop(&exception_state_);
+  media_recorder_->Stop(&exception_state_);
+
+  ASSERT_TRUE(exception.get());
+  dom::DOMException& dom_exception(
+      *base::polymorphic_downcast<dom::DOMException*>(exception.get()));
+  EXPECT_EQ(dom::DOMException::kInvalidStateErr, dom_exception.code());
+  EXPECT_EQ(dom_exception.message(), "Recording state must NOT be inactive.");
+}
+
+TEST_F(MediaRecorderTest, RecordL16Frames) {
+  scoped_ptr<MockEventListener> listener = MockEventListener::Create();
+  FakeScriptValue<EventListener> script_object(listener.get());
+  media_recorder_->set_ondataavailable(script_object);
+  EXPECT_CALL(*listener,
+              HandleEvent(Eq(media_recorder_),
+                          Pointee(Property(&dom::Event::type,
+                                           base::Tokens::dataavailable())),
+                          _));
+
+  media_recorder_->Start(&exception_state_);
+
+  const int kSampleRate = 16000;
+  media_stream::AudioParameters params(1, kSampleRate, 16);
+  media_recorder_->OnSetFormat(params);
+
+  std::vector<int16> frames;
+  frames.push_back(1);
+  frames.push_back(-1);
+  frames.push_back(-32768);
+  frames.push_back(32767);
+  frames.push_back(1000);
+  frames.push_back(0);
+  media_stream::MediaStreamAudioTrack::ShellAudioBus audio_bus(1, frames.size(),
+                                                               frames.data());
+  base::TimeTicks current_time = base::TimeTicks::Now();
+  media_recorder_->OnData(audio_bus, current_time);
+  current_time += base::TimeDelta::FromSecondsD(frames.size() / kSampleRate);
+  media_recorder_->OnData(audio_bus, current_time);
+  current_time += base::TimeDelta::FromSecondsD(frames.size() / kSampleRate);
+  media_recorder_->OnData(audio_bus, current_time);
+
+  media_recorder_->Stop(&exception_state_);
+}
+
+TEST_F(MediaRecorderTest, StartEvent) {
+  scoped_ptr<MockEventListener> listener = MockEventListener::Create();
+  FakeScriptValue<EventListener> script_object(listener.get());
+  media_recorder_->set_onstart(script_object);
+  EXPECT_CALL(
+      *listener,
+      HandleEvent(Eq(media_recorder_),
+                  Pointee(Property(&dom::Event::type, base::Tokens::start())),
+                  _));
+
+  media_recorder_->Start(&exception_state_);
+}
+
+TEST_F(MediaRecorderTest, StopEvent) {
+  scoped_ptr<MockEventListener> listener = MockEventListener::Create();
+  FakeScriptValue<EventListener> script_object(listener.get());
+  media_recorder_->Start(&exception_state_);
+  media_recorder_->set_onstop(script_object);
+
+  EXPECT_CALL(
+      *listener,
+      HandleEvent(Eq(media_recorder_),
+                  Pointee(Property(&dom::Event::type, base::Tokens::stop())),
+                  _));
+
+  media_recorder_->Stop(&exception_state_);
+}
+
+TEST_F(MediaRecorderTest, ReleaseRecorderBeforeStoppingSource) {
+  // This test ensures that media recorder can be destroyed
+  // before the audio source is destroyed. It should not crash.
+  media_recorder_ = nullptr;
+}
+
+}  // namespace media_capture
+}  // namespace cobalt
diff --git a/src/cobalt/media_stream/audio_parameters.h b/src/cobalt/media_stream/audio_parameters.h
index 5f1e012..7fd0343 100644
--- a/src/cobalt/media_stream/audio_parameters.h
+++ b/src/cobalt/media_stream/audio_parameters.h
@@ -24,6 +24,11 @@
 
 class AudioParameters {
  public:
+  // Even though a constructed object is not valid, and there are no setters,
+  // it is still possible to construct a dummy object and use the assignment
+  // operator later.
+  AudioParameters() = default;
+
   AudioParameters(int channel_count, int sample_rate, int bits_per_sample)
       : channel_count_(channel_count),
         sample_rate_(sample_rate),
diff --git a/src/cobalt/media_stream/media_stream.gyp b/src/cobalt/media_stream/media_stream.gyp
index 8581291..cc86fc6 100644
--- a/src/cobalt/media_stream/media_stream.gyp
+++ b/src/cobalt/media_stream/media_stream.gyp
@@ -24,10 +24,21 @@
         'audio_parameters.cc',
         'audio_parameters.h',
         'media_stream.h',
+        'media_stream_audio_deliverer.h',
+        'media_stream_audio_sink.h',
+        'media_stream_audio_source.cc',
+        'media_stream_audio_source.h',
+        'media_stream_audio_track.cc',
+        'media_stream_audio_track.h',
+        'media_stream_source.cc',
+        'media_stream_source.h',
         'media_stream_track.h',
+        'microphone_audio_source.cc',
+        'microphone_audio_source.h',
       ],
       'dependencies': [
         '<(DEPTH)/cobalt/browser/browser_bindings_gen.gyp:generated_types',
+        '<(DEPTH)/cobalt/speech/speech.gyp:speech',
       ],
       'export_dependent_settings': [
         '<(DEPTH)/cobalt/browser/browser_bindings_gen.gyp:generated_types',
diff --git a/src/cobalt/media_stream/media_stream_audio_deliverer.h b/src/cobalt/media_stream/media_stream_audio_deliverer.h
new file mode 100644
index 0000000..d047f73
--- /dev/null
+++ b/src/cobalt/media_stream/media_stream_audio_deliverer.h
@@ -0,0 +1,186 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COBALT_MEDIA_STREAM_MEDIA_STREAM_AUDIO_DELIVERER_H_
+#define COBALT_MEDIA_STREAM_MEDIA_STREAM_AUDIO_DELIVERER_H_
+
+#include <algorithm>
+#include <vector>
+
+#include "base/debug/trace_event.h"
+#include "base/synchronization/lock.h"
+#include "base/threading/thread_checker.h"
+#include "base/time.h"
+#include "cobalt/media_stream/audio_parameters.h"
+
+#if defined(COBALT_MEDIA_SOURCE_2016)
+#include "cobalt/media/base/shell_audio_bus.h"
+#else  // defined(COBALT_MEDIA_SOURCE_2016)
+#include "media/base/shell_audio_bus.h"
+#endif  // defined(COBALT_MEDIA_SOURCE_2016)
+
+namespace cobalt {
+namespace media_stream {
+
+// Template containing functionality common to both MediaStreamAudioSource and
+// MediaStreamAudioTrack. This is used for managing the connections between
+// objects through which audio data flows, and doing so in a thread-safe manner.
+//
+// The Consumer parameter of the template is the type of the objects to which
+// audio data is delivered: MediaStreamAudioTrack or MediaStreamAudioSink. It's
+// assumed the Consumer class defines methods named OnSetFormat() and OnData()
+// that have the same signature as the ones defined in this template.
+// MediaStreamAudioDeliverer will always guarantee the Consumer's OnSetFormat()
+// and OnData() methods are called sequentially.
+template <typename Consumer>
+class MediaStreamAudioDeliverer {
+ public:
+  MediaStreamAudioDeliverer() {}
+  ~MediaStreamAudioDeliverer() {}
+
+  // Returns the current audio parameters. These will be invalid before the
+  // first call to OnSetFormat(). This method is thread-safe.
+  media_stream::AudioParameters GetAudioParameters() const {
+    base::AutoLock auto_lock(params_lock_);
+    return params_;
+  }
+
+  // Begin delivering audio to |consumer|. The caller must guarantee |consumer|
+  // is not destroyed until after calling RemoveConsumer(consumer). This method
+  // must be called on the main thread.
+  void AddConsumer(Consumer* consumer) {
+    DCHECK(thread_checker_.CalledOnValidThread());
+    DCHECK(consumer);
+    base::AutoLock auto_lock(consumers_lock_);
+    DCHECK(std::find(consumers_.begin(), consumers_.end(), consumer) ==
+           consumers_.end());
+    DCHECK(std::find(pending_consumers_.begin(), pending_consumers_.end(),
+                     consumer) == pending_consumers_.end());
+    pending_consumers_.push_back(consumer);
+  }
+
+  // Stop delivering audio to |consumer|. Returns true if |consumer| was the
+  // last consumer removed, false otherwise. When this method returns, no
+  // further calls will be made to OnSetFormat() or OnData() on any thread.
+  // This method must be called on the main thread.
+  bool RemoveConsumer(Consumer* consumer) {
+    DCHECK(thread_checker_.CalledOnValidThread());
+    base::AutoLock auto_lock(consumers_lock_);
+    const bool had_consumers =
+        !consumers_.empty() || !pending_consumers_.empty();
+    auto it = std::find(consumers_.begin(), consumers_.end(), consumer);
+    if (it != consumers_.end()) {
+      consumers_.erase(it);
+    } else {
+      it = std::find(pending_consumers_.begin(), pending_consumers_.end(),
+                     consumer);
+      if (it != pending_consumers_.end()) pending_consumers_.erase(it);
+    }
+    return had_consumers && consumers_.empty() && pending_consumers_.empty();
+  }
+
+  // Returns the current list of connected Consumers. This is normally used to
+  // send a notification to all consumers. This method must be called on the
+  // main thread.
+  void GetConsumerList(std::vector<Consumer*>* consumer_list) const {
+    DCHECK(thread_checker_.CalledOnValidThread());
+    base::AutoLock auto_lock(consumers_lock_);
+    *consumer_list = consumers_;
+    consumer_list->insert(consumer_list->end(), pending_consumers_.begin(),
+                          pending_consumers_.end());
+  }
+
+  // Change the format of the audio passed in the next call to OnData(). This
+  // method may be called on any thread but, logically, should only be called
+  // between calls to OnData().
+  void OnSetFormat(const media_stream::AudioParameters& params) {
+    DCHECK(params.IsValid());
+    base::AutoLock auto_lock(consumers_lock_);
+    {
+      base::AutoLock auto_params_lock(params_lock_);
+      if (params_ == params) return;
+      params_ = params;
+    }
+    pending_consumers_.insert(pending_consumers_.end(), consumers_.begin(),
+                              consumers_.end());
+    consumers_.clear();
+  }
+
+  // Deliver data to all consumers. This method may be called on any thread.
+
+#if defined(COBALT_MEDIA_SOURCE_2016)
+  void OnData(const media::ShellAudioBus& audio_bus,
+#else   // defined(COBALT_MEDIA_SOURCE_2016)
+  void OnData(const ::media::ShellAudioBus& audio_bus,
+#endif  // defined(COBALT_MEDIA_SOURCE_2016)
+              base::TimeTicks reference_time) {
+    TRACE_EVENT1("media_stream", "MediaStreamAudioDeliverer::OnData",
+                 "reference time (ms)",
+                 (reference_time - base::TimeTicks()).InMillisecondsF());
+    base::AutoLock auto_lock(consumers_lock_);
+
+    // Call OnSetFormat() for all pending consumers and move them to the
+    // active-delivery list.
+    if (!pending_consumers_.empty()) {
+      const media_stream::AudioParameters params = GetAudioParameters();
+      DCHECK(params.IsValid());
+      for (Consumer* consumer : pending_consumers_)
+        consumer->OnSetFormat(params);
+      consumers_.insert(consumers_.end(), pending_consumers_.begin(),
+                        pending_consumers_.end());
+      pending_consumers_.clear();
+    }
+
+    // Deliver the audio data to each consumer.
+    for (Consumer* consumer : consumers_)
+      consumer->OnData(audio_bus, reference_time);
+  }
+
+ private:
+  // In debug builds, check that all methods that could cause object graph or
+  // data flow changes are being called on the main thread.
+  base::ThreadChecker thread_checker_;
+
+  // Protects concurrent access to |pending_consumers_| and |consumers_|.
+  mutable base::Lock consumers_lock_;
+
+  // Any consumers needing a call to OnSetFormat(), to be notified of the
+  // changed audio format, are placed in this list. This includes consumers
+  // added via AddConsumer() that need to have an initial OnSetFormat() call
+  // before audio data is first delivered. Consumers are moved from this list to
+  // |consumers_| on the audio thread.
+  std::vector<Consumer*> pending_consumers_;
+
+  // Consumers that are up to date on the current audio format and are receiving
+  // audio data are placed in this list.
+  std::vector<Consumer*> consumers_;
+
+  // Protects concurrent access to |params_|.
+  mutable base::Lock params_lock_;
+
+  // Specifies the current format of the audio passing through this
+  // MediaStreamAudioDeliverer.
+  media_stream::AudioParameters params_;
+
+  DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioDeliverer);
+};
+
+}  // namespace media_stream
+}  // namespace cobalt
+
+#endif  // COBALT_MEDIA_STREAM_MEDIA_STREAM_AUDIO_DELIVERER_H_
diff --git a/src/cobalt/media_stream/media_stream_audio_sink.h b/src/cobalt/media_stream/media_stream_audio_sink.h
new file mode 100644
index 0000000..25ee1a6
--- /dev/null
+++ b/src/cobalt/media_stream/media_stream_audio_sink.h
@@ -0,0 +1,59 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COBALT_MEDIA_STREAM_MEDIA_STREAM_AUDIO_SINK_H_
+#define COBALT_MEDIA_STREAM_MEDIA_STREAM_AUDIO_SINK_H_
+
+#include "cobalt/media_stream/audio_parameters.h"
+
+#include "cobalt/media_stream/media_stream_source.h"
+
+#if defined(COBALT_MEDIA_SOURCE_2016)
+#include "cobalt/media/base/shell_audio_bus.h"
+#else  // defined(COBALT_MEDIA_SOURCE_2016)
+#include "media/base/shell_audio_bus.h"
+#endif  // defined(COBALT_MEDIA_SOURCE_2016)
+
+namespace cobalt {
+namespace media_stream {
+
+// Abstract base class that is used to represent a sink for the audio data.
+// Note: users of this class will call OnSetFormat is before OnData.
+class MediaStreamAudioSink {
+ public:
+#if defined(COBALT_MEDIA_SOURCE_2016)
+  typedef media::ShellAudioBus ShellAudioBus;
+#else   // defined(COBALT_MEDIA_SOURCE_2016)
+  typedef ::media::ShellAudioBus ShellAudioBus;
+#endif  // defined(COBALT_MEDIA_SOURCE_2016)
+  MediaStreamAudioSink() = default;
+
+  // These are called on the same thread.
+  virtual void OnData(const ShellAudioBus& audio_bus,
+                      base::TimeTicks reference_time) = 0;
+  virtual void OnSetFormat(const media_stream::AudioParameters& params) = 0;
+  virtual void OnReadyStateChanged(
+      media_stream::MediaStreamTrack::ReadyState new_state) {
+    UNREFERENCED_PARAMETER(new_state);
+  }
+
+ private:
+  MediaStreamAudioSink(const MediaStreamAudioSink&) = delete;
+  MediaStreamAudioSink& operator=(const MediaStreamAudioSink&) = delete;
+};
+
+}  // namespace media_stream
+}  // namespace cobalt
+
+#endif  // COBALT_MEDIA_STREAM_MEDIA_STREAM_AUDIO_SINK_H_
diff --git a/src/cobalt/media_stream/media_stream_audio_source.cc b/src/cobalt/media_stream/media_stream_audio_source.cc
new file mode 100644
index 0000000..84b261c
--- /dev/null
+++ b/src/cobalt/media_stream/media_stream_audio_source.cc
@@ -0,0 +1,80 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "cobalt/media_stream/media_stream_audio_source.h"
+
+#include "base/compiler_specific.h"
+
+namespace cobalt {
+namespace media_stream {
+
+MediaStreamAudioSource::~MediaStreamAudioSource() {
+  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK(stop_callback_.is_null());
+}
+
+bool MediaStreamAudioSource::ConnectToTrack(MediaStreamAudioTrack* track) {
+  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK(track);
+
+  // Try to start the source, if has not been permanently stopped.
+  // If we are unable to start the source, the MediaSteamTrack will stay in
+  // the stopped/ended state.
+  if (!is_stopped_) {
+    if (!EnsureSourceIsStarted()) {
+      StopSource();
+    }
+  }
+
+  if (is_stopped_) {
+    return false;
+  }
+
+  // It is safe to pass an unretained pointer, since the callback here
+  // will be called in |MediaStreamAudioTrack::Stop|.
+  track->Start(base::Bind(&MediaStreamAudioSource::StopAudioDeliveryTo,
+                          weak_this_, base::Unretained(track)));
+  deliverer_.AddConsumer(track);
+  return true;
+}
+
+void MediaStreamAudioSource::DeliverDataToTracks(
+    const MediaStreamAudioTrack::ShellAudioBus& audio_bus,
+    base::TimeTicks reference_time) {
+  deliverer_.OnData(audio_bus, reference_time);
+}
+
+MediaStreamAudioSource::MediaStreamAudioSource()
+    : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)),
+      weak_this_(weak_ptr_factory_.GetWeakPtr()) {}
+
+void MediaStreamAudioSource::DoStopSource() {
+  DCHECK(thread_checker_.CalledOnValidThread());
+  EnsureSourceIsStopped();
+  is_stopped_ = true;
+}
+
+void MediaStreamAudioSource::StopAudioDeliveryTo(MediaStreamAudioTrack* track) {
+  DCHECK(thread_checker_.CalledOnValidThread());
+  bool did_remove_last_track = deliverer_.RemoveConsumer(track);
+  // Per spec at: https://www.w3.org/TR/mediacapture-streams/#mediastreamtrack
+  // "When all tracks using a source have been stopped or ended by some other
+  // means, the source is stopped."
+  if (!is_stopped_ && did_remove_last_track) {
+    StopSource();
+  }
+}
+
+}  // namespace media_stream
+}  // namespace cobalt
diff --git a/src/cobalt/media_stream/media_stream_audio_source.h b/src/cobalt/media_stream/media_stream_audio_source.h
new file mode 100644
index 0000000..a66d5ae
--- /dev/null
+++ b/src/cobalt/media_stream/media_stream_audio_source.h
@@ -0,0 +1,93 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COBALT_MEDIA_STREAM_MEDIA_STREAM_AUDIO_SOURCE_H_
+#define COBALT_MEDIA_STREAM_MEDIA_STREAM_AUDIO_SOURCE_H_
+
+#include "base/callback.h"
+#include "base/gtest_prod_util.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "cobalt/media_stream/audio_parameters.h"
+#include "cobalt/media_stream/media_stream_audio_deliverer.h"
+#include "cobalt/media_stream/media_stream_audio_track.h"
+#include "cobalt/media_stream/media_stream_source.h"
+
+namespace cobalt {
+namespace media_stream {
+
+// Base class that provides functionality to connect tracks
+// and have audio data delivered to them.
+// Subclasses should:
+//   implement |EnsureSourceIsStarted()| and |EnsureSourceIsStopped()|
+//   call |SetFormat()| and |DeliverDataToTracks()|
+class MediaStreamAudioSource : public MediaStreamSource {
+ public:
+  MediaStreamAudioSource();
+  ~MediaStreamAudioSource() override;
+
+  // Connects this source to the track. One source can be connected to multiple
+  // tracks.  Returns true if successful.
+  bool ConnectToTrack(MediaStreamAudioTrack* track);
+
+ protected:
+  // Subclasses should override these Ensure* methods.
+
+  // Returns true if the source has been successfully started.
+  // After the source has been started, subclasses should call
+  // |DeliverDataToTracks| to deliver the data.
+  virtual bool EnsureSourceIsStarted() = 0;
+  // Stops the source. |DeliverDataToTracks| must not be called after
+  // the source is stopped.
+  virtual void EnsureSourceIsStopped() = 0;
+
+  // Subclasses should call these methods. |DeliverDataToTracks| can be
+  // called from a different thread than where MediaStreamAudioSource
+  // was created.
+  void DeliverDataToTracks(
+      const MediaStreamAudioTrack::ShellAudioBus& audio_bus,
+      base::TimeTicks reference_time);
+
+  void SetFormat(const media_stream::AudioParameters& params) {
+    DLOG(INFO) << "MediaStreamAudioSource@" << this << "::SetFormat("
+               << params.AsHumanReadableString() << "), was previously set to {"
+               << deliverer_.GetAudioParameters().AsHumanReadableString()
+               << "}.";
+    deliverer_.OnSetFormat(params);
+  }
+
+ private:
+  MediaStreamAudioSource(const MediaStreamAudioSource&) = delete;
+  MediaStreamAudioSource& operator=(const MediaStreamAudioSource&) = delete;
+
+  void DoStopSource() final;
+  void StopAudioDeliveryTo(MediaStreamAudioTrack* track);
+
+  base::ThreadChecker thread_checker_;
+  base::Closure stop_callback_;
+
+  base::WeakPtrFactory<MediaStreamAudioSource> weak_ptr_factory_;
+  base::WeakPtr<MediaStreamAudioSource> weak_this_;
+
+  MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer_;
+
+  bool is_stopped_ = false;
+
+  FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioSourceTest, DeliverData);
+};
+
+}  // namespace media_stream
+}  // namespace cobalt
+
+#endif  // COBALT_MEDIA_STREAM_MEDIA_STREAM_AUDIO_SOURCE_H_
diff --git a/src/cobalt/media_stream/media_stream_audio_source_test.cc b/src/cobalt/media_stream/media_stream_audio_source_test.cc
new file mode 100644
index 0000000..b2d90ba
--- /dev/null
+++ b/src/cobalt/media_stream/media_stream_audio_source_test.cc
@@ -0,0 +1,123 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "cobalt/media_stream/media_stream_audio_source.h"
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "cobalt/media_stream/media_stream_audio_track.h"
+#include "cobalt/media_stream/testing/mock_media_stream_audio_source.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+#if defined(COBALT_MEDIA_SOURCE_2016)
+#include "cobalt/media/base/shell_audio_bus.h"
+#else  // defined(COBALT_MEDIA_SOURCE_2016)
+#include "media/base/shell_audio_bus.h"
+#endif  // defined(COBALT_MEDIA_SOURCE_2016)
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::StrictMock;
+
+namespace {
+
+void Increment(int* value) { ++(*value); }
+
+}  // namespace
+
+namespace cobalt {
+namespace media_stream {
+
+#if defined(COBALT_MEDIA_SOURCE_2016)
+typedef media::ShellAudioBus ShellAudioBus;
+#else   // defined(COBALT_MEDIA_SOURCE_2016)
+typedef ::media::ShellAudioBus ShellAudioBus;
+#endif  // defined(COBALT_MEDIA_SOURCE_2016)
+
+class MediaStreamAudioSourceTest : public testing::Test {
+ public:
+  MediaStreamAudioSourceTest()
+      : audio_source_(new StrictMock<MockMediaStreamAudioSource>()),
+        track_(new MediaStreamAudioTrack()) {}
+
+ protected:
+  scoped_refptr<StrictMock<MockMediaStreamAudioSource>> audio_source_;
+  scoped_refptr<MediaStreamAudioTrack> track_;
+};
+
+TEST_F(MediaStreamAudioSourceTest, SourceCanStart) {
+  EXPECT_CALL(*audio_source_, EnsureSourceIsStarted())
+      .WillOnce(Return(true));
+  // Source will be stopped when the last track is disconnected.
+  // This happens when |track_| is destructed.
+  EXPECT_CALL(*audio_source_, EnsureSourceIsStopped());
+
+  // Adding a track ensures that the source is started.
+  bool source_started = audio_source_->ConnectToTrack(track_.get());
+  EXPECT_TRUE(source_started);
+}
+
+TEST_F(MediaStreamAudioSourceTest, SourceCannotStart) {
+  EXPECT_CALL(*audio_source_, EnsureSourceIsStarted())
+      .WillOnce(Return(false));
+  EXPECT_CALL(*audio_source_, EnsureSourceIsStopped());
+
+  // Adding a track ensures that the source is started (if it is not stopped).
+  bool source_started = audio_source_->ConnectToTrack(track_.get());
+  EXPECT_FALSE(source_started);
+}
+
+TEST_F(MediaStreamAudioSourceTest, CallStopCallback) {
+  EXPECT_CALL(*audio_source_, EnsureSourceIsStarted())
+      .WillOnce(Return(true));
+  EXPECT_CALL(*audio_source_, EnsureSourceIsStopped());
+
+  int times_callback_is_called = 0;
+  base::Closure closure = base::Bind(Increment, &times_callback_is_called);
+  audio_source_->SetStopCallback(closure);
+
+  // Adding a track ensures that the source is started.
+  audio_source_->ConnectToTrack(track_);
+  audio_source_->StopSource();
+
+  EXPECT_EQ(1, times_callback_is_called);
+}
+
+TEST_F(MediaStreamAudioSourceTest, EmptyStopCallback) {
+  // This test should not crash.
+  EXPECT_CALL(*audio_source_, EnsureSourceIsStarted())
+      .WillOnce(Return(true));
+  EXPECT_CALL(*audio_source_, EnsureSourceIsStopped());
+
+  // Adding a track ensures that the source is started.
+  audio_source_->ConnectToTrack(track_);
+  audio_source_->StopSource();
+}
+
+TEST_F(MediaStreamAudioSourceTest, AddMultipleTracks) {
+  // This test should not crash.
+  EXPECT_CALL(*audio_source_, EnsureSourceIsStarted())
+      .Times(2)
+      .WillRepeatedly(Return(true));
+  EXPECT_CALL(*audio_source_, EnsureSourceIsStopped());
+
+  // Adding a track ensures that the source is started.
+  audio_source_->ConnectToTrack(track_);
+  auto track2 = make_scoped_refptr(new MediaStreamAudioTrack());
+  audio_source_->ConnectToTrack(track2);
+  audio_source_->StopSource();
+}
+
+}  // namespace media_stream
+}  // namespace cobalt
diff --git a/src/cobalt/media_stream/media_stream_audio_track.cc b/src/cobalt/media_stream/media_stream_audio_track.cc
new file mode 100644
index 0000000..4af09d7
--- /dev/null
+++ b/src/cobalt/media_stream/media_stream_audio_track.cc
@@ -0,0 +1,72 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "cobalt/media_stream/media_stream_audio_track.h"
+
+#include <vector>
+
+#include "base/callback_helpers.h"
+
+namespace cobalt {
+namespace media_stream {
+
+void MediaStreamAudioTrack::AddSink(MediaStreamAudioSink* sink) {
+  DCHECK(thread_checker_.CalledOnValidThread());
+
+  if (stop_callback_.is_null()) {
+    sink->OnReadyStateChanged(MediaStreamTrack::kReadyStateEnded);
+    return;
+  }
+
+  deliverer_.AddConsumer(sink);
+}
+
+void MediaStreamAudioTrack::RemoveSink(MediaStreamAudioSink* sink) {
+  DCHECK(thread_checker_.CalledOnValidThread());
+  deliverer_.RemoveConsumer(sink);
+}
+
+void MediaStreamAudioTrack::Stop() {
+  DCHECK(thread_checker_.CalledOnValidThread());
+  base::ResetAndRunIfNotNull(&stop_callback_);
+
+  std::vector<MediaStreamAudioSink*> consumer_sinks_to_remove;
+  deliverer_.GetConsumerList(&consumer_sinks_to_remove);
+  for (MediaStreamAudioSink* sink : consumer_sinks_to_remove) {
+    deliverer_.RemoveConsumer(sink);
+    sink->OnReadyStateChanged(MediaStreamTrack::kReadyStateEnded);
+  }
+}
+
+void MediaStreamAudioTrack::Start(const base::Closure& stop_callback) {
+  DCHECK(!stop_callback.is_null());  // This variable is passed in.
+  DCHECK(stop_callback_.is_null());  // This is the member variable.
+  stop_callback_ = stop_callback;
+}
+
+void MediaStreamAudioTrack::OnData(const ShellAudioBus& audio_bus,
+                                   base::TimeTicks reference_time) {
+  deliverer_.OnData(audio_bus, reference_time);
+}
+
+void MediaStreamAudioTrack::OnSetFormat(
+    const media_stream::AudioParameters& params) {
+  settings_.set_channel_count(params.channel_count());
+  settings_.set_sample_rate(params.sample_rate());
+  settings_.set_sample_size(params.bits_per_sample());
+  deliverer_.OnSetFormat(params);
+}
+
+}  // namespace media_stream
+}  // namespace cobalt
diff --git a/src/cobalt/media_stream/media_stream_audio_track.h b/src/cobalt/media_stream/media_stream_audio_track.h
new file mode 100644
index 0000000..c4d588c
--- /dev/null
+++ b/src/cobalt/media_stream/media_stream_audio_track.h
@@ -0,0 +1,96 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COBALT_MEDIA_STREAM_MEDIA_STREAM_AUDIO_TRACK_H_
+#define COBALT_MEDIA_STREAM_MEDIA_STREAM_AUDIO_TRACK_H_
+
+#include "base/callback.h"
+#include "base/string_piece.h"
+#include "base/threading/thread_checker.h"
+#include "cobalt/dom/event_target.h"
+#include "cobalt/media_stream/audio_parameters.h"
+#include "cobalt/media_stream/media_stream_audio_deliverer.h"
+#include "cobalt/media_stream/media_stream_audio_sink.h"
+#include "cobalt/media_stream/media_stream_track.h"
+#include "cobalt/media_stream/media_track_settings.h"
+
+#if defined(COBALT_MEDIA_SOURCE_2016)
+#include "cobalt/media/base/shell_audio_bus.h"
+#else  // defined(COBALT_MEDIA_SOURCE_2016)
+#include "media/base/shell_audio_bus.h"
+#endif  // defined(COBALT_MEDIA_SOURCE_2016)
+
+namespace cobalt {
+
+namespace media_capture {
+
+class MediaRecorderTest;
+
+}
+
+namespace media_stream {
+
+class MediaStreamAudioSource;
+
+// This class represents a MediaStreamTrack, and implements the specification
+// at: https://www.w3.org/TR/mediacapture-streams/#dom-mediastreamtrack
+class MediaStreamAudioTrack : public MediaStreamTrack {
+ public:
+#if defined(COBALT_MEDIA_SOURCE_2016)
+  typedef media::ShellAudioBus ShellAudioBus;
+#else   // defined(COBALT_MEDIA_SOURCE_2016)
+  typedef ::media::ShellAudioBus ShellAudioBus;
+#endif  // defined(COBALT_MEDIA_SOURCE_2016)
+  MediaStreamAudioTrack() = default;
+
+  ~MediaStreamAudioTrack() override { Stop(); }
+
+  void AddSink(MediaStreamAudioSink* sink);
+  void RemoveSink(MediaStreamAudioSink* sink);
+
+  void Stop() override;
+
+ private:
+  FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioTrackTest, OnSetFormatAndData);
+  FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioTrackTest, OneTrackMultipleSinks);
+  FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioTrackTest, TwoTracksWithOneSinkEach);
+  FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioTrackTest, AddRemoveSink);
+  FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioTrackTest, Stop);
+  FRIEND_TEST_ALL_PREFIXES(MediaStreamAudioTrackTest,
+                           ReadyStateEndedNotifyIfAlreadyStopped);
+
+  friend class media_capture::MediaRecorderTest;
+  friend class MediaStreamAudioSource;
+  friend class MediaStreamAudioDeliverer<MediaStreamAudioTrack>;
+
+  // Called by MediaStreamAudioSource.
+  void Start(const base::Closure& stop_callback);
+
+  // Called by MediaStreamAudioDeliverer.
+  void OnData(const ShellAudioBus& audio_bus, base::TimeTicks reference_time);
+  void OnSetFormat(const media_stream::AudioParameters& params);
+
+  base::ThreadChecker thread_checker_;
+  MediaStreamAudioDeliverer<MediaStreamAudioSink> deliverer_;
+
+  MediaStreamAudioTrack(const MediaStreamAudioTrack&) = delete;
+  MediaStreamAudioTrack& operator=(const MediaStreamAudioTrack&) = delete;
+
+  base::Closure stop_callback_;
+};
+
+}  // namespace media_stream
+}  // namespace cobalt
+
+#endif  // COBALT_MEDIA_STREAM_MEDIA_STREAM_AUDIO_TRACK_H_
diff --git a/src/cobalt/media_stream/media_stream_audio_track_test.cc b/src/cobalt/media_stream/media_stream_audio_track_test.cc
new file mode 100644
index 0000000..d7e667f
--- /dev/null
+++ b/src/cobalt/media_stream/media_stream_audio_track_test.cc
@@ -0,0 +1,215 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "cobalt/media_stream/media_stream_audio_track.h"
+
+#include "base/bind_helpers.h"
+#include "cobalt/media_stream/media_stream_audio_deliverer.h"
+#include "cobalt/media_stream/testing/mock_media_stream_audio_sink.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+#if defined(COBALT_MEDIA_SOURCE_2016)
+#include "cobalt/media/base/shell_audio_bus.h"
+#else  // defined(COBALT_MEDIA_SOURCE_2016)
+#include "media/base/shell_audio_bus.h"
+#endif  // defined(COBALT_MEDIA_SOURCE_2016)
+
+using ::testing::_;
+using ::testing::StrictMock;
+
+namespace {
+
+const int kFrameCount = 20;
+const int kChannelCount = 1;
+const int kSampleRate = 1000;
+const int kBitsPerSample = 8;
+
+}  // namespace
+
+namespace cobalt {
+namespace media_stream {
+
+#if defined(COBALT_MEDIA_SOURCE_2016)
+typedef media::ShellAudioBus ShellAudioBus;
+#else   // defined(COBALT_MEDIA_SOURCE_2016)
+typedef ::media::ShellAudioBus ShellAudioBus;
+#endif  // defined(COBALT_MEDIA_SOURCE_2016)
+
+// This fixture is created, so it can be added as a friend to
+// |MediaStreamAudioTrack|.  This enables calling a private method
+// called|Start()| on the track, without instantiating an audio source.
+class MediaStreamAudioTrackTest : public testing::Test {};
+
+TEST_F(MediaStreamAudioTrackTest, OnSetFormatAndData) {
+  media_stream::AudioParameters expected_params(kChannelCount, kSampleRate,
+                                                kBitsPerSample);
+  base::TimeTicks expected_time = base::TimeTicks::Now();
+
+  StrictMock<MockMediaStreamAudioSink> mock_sink;
+  ::testing::InSequence seq;
+  EXPECT_CALL(mock_sink, OnSetFormat(expected_params));
+  EXPECT_CALL(mock_sink, OnData(_, expected_time));
+  EXPECT_CALL(mock_sink, OnReadyStateChanged(
+                             MediaStreamTrack::ReadyState::kReadyStateEnded));
+
+  scoped_refptr<MediaStreamAudioTrack> track = new MediaStreamAudioTrack();
+  track->Start(base::Bind(&base::DoNothing));
+  track->AddSink(&mock_sink);
+
+  MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer;
+  deliverer.AddConsumer(track);
+
+  deliverer.OnSetFormat(expected_params);
+
+  ShellAudioBus audio_bus(kChannelCount, kFrameCount, ShellAudioBus::kInt16,
+                          ShellAudioBus::kInterleaved);
+
+  deliverer.OnData(audio_bus, expected_time);
+}
+
+TEST_F(MediaStreamAudioTrackTest, OneTrackMultipleSinks) {
+  media_stream::AudioParameters expected_params(kChannelCount, kSampleRate,
+                                                kBitsPerSample);
+  base::TimeTicks expected_time = base::TimeTicks::Now();
+
+  StrictMock<MockMediaStreamAudioSink> mock_sink1;
+  EXPECT_CALL(mock_sink1, OnSetFormat(expected_params));
+  EXPECT_CALL(mock_sink1, OnData(_, expected_time));
+  EXPECT_CALL(mock_sink1, OnReadyStateChanged(
+                              MediaStreamTrack::ReadyState::kReadyStateEnded));
+  StrictMock<MockMediaStreamAudioSink> mock_sink2;
+  EXPECT_CALL(mock_sink2, OnSetFormat(expected_params));
+  EXPECT_CALL(mock_sink2, OnData(_, expected_time));
+  EXPECT_CALL(mock_sink2, OnReadyStateChanged(
+                              MediaStreamTrack::ReadyState::kReadyStateEnded));
+
+  scoped_refptr<MediaStreamAudioTrack> track = new MediaStreamAudioTrack();
+  track->Start(base::Bind(&base::DoNothing));
+  track->AddSink(&mock_sink1);
+  track->AddSink(&mock_sink2);
+
+  MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer;
+  deliverer.AddConsumer(track);
+
+  deliverer.OnSetFormat(expected_params);
+
+  ShellAudioBus audio_bus(kChannelCount, kFrameCount, ShellAudioBus::kInt16,
+                          ShellAudioBus::kInterleaved);
+
+  deliverer.OnData(audio_bus, expected_time);
+}
+
+TEST_F(MediaStreamAudioTrackTest, TwoTracksWithOneSinkEach) {
+  media_stream::AudioParameters expected_params(kChannelCount, kSampleRate,
+                                                kBitsPerSample);
+  base::TimeTicks expected_time = base::TimeTicks::Now();
+
+  StrictMock<MockMediaStreamAudioSink> mock_sink1;
+  EXPECT_CALL(mock_sink1, OnSetFormat(expected_params));
+  EXPECT_CALL(mock_sink1, OnData(_, expected_time));
+  EXPECT_CALL(mock_sink1, OnReadyStateChanged(
+                              MediaStreamTrack::ReadyState::kReadyStateEnded));
+  StrictMock<MockMediaStreamAudioSink> mock_sink2;
+  EXPECT_CALL(mock_sink2, OnSetFormat(expected_params));
+  EXPECT_CALL(mock_sink2, OnData(_, expected_time));
+  EXPECT_CALL(mock_sink2, OnReadyStateChanged(
+                              MediaStreamTrack::ReadyState::kReadyStateEnded));
+
+  scoped_refptr<MediaStreamAudioTrack> track1 = new MediaStreamAudioTrack();
+  scoped_refptr<MediaStreamAudioTrack> track2 = new MediaStreamAudioTrack();
+  track1->Start(base::Bind(&base::DoNothing));
+  track2->Start(base::Bind(&base::DoNothing));
+  track1->AddSink(&mock_sink1);
+  track2->AddSink(&mock_sink2);
+
+  MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer;
+  deliverer.AddConsumer(track1);
+  deliverer.AddConsumer(track2);
+
+  deliverer.OnSetFormat(expected_params);
+
+  ShellAudioBus audio_bus(kChannelCount, kFrameCount, ShellAudioBus::kInt16,
+                          ShellAudioBus::kInterleaved);
+
+  deliverer.OnData(audio_bus, expected_time);
+}
+
+TEST_F(MediaStreamAudioTrackTest, AddRemoveSink) {
+  media_stream::AudioParameters expected_params(kChannelCount, kSampleRate,
+                                                kBitsPerSample);
+  base::TimeTicks expected_time = base::TimeTicks::Now();
+
+  // This never receives any data because the sink is removed before the data
+  // is delivered.
+  StrictMock<MockMediaStreamAudioSink> mock_sink;
+
+  scoped_refptr<MediaStreamAudioTrack> track = new MediaStreamAudioTrack();
+  track->Start(base::Bind(&base::DoNothing));
+  track->AddSink(&mock_sink);
+
+  MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer;
+  deliverer.AddConsumer(track);
+
+  deliverer.OnSetFormat(expected_params);
+
+  ShellAudioBus audio_bus(kChannelCount, kFrameCount, ShellAudioBus::kInt16,
+                          ShellAudioBus::kInterleaved);
+
+  track->RemoveSink(&mock_sink);
+  deliverer.OnData(audio_bus, expected_time);
+}
+
+TEST_F(MediaStreamAudioTrackTest, Stop) {
+  StrictMock<MockMediaStreamAudioSink> mock_sink;
+
+  scoped_refptr<MediaStreamAudioTrack> track = new MediaStreamAudioTrack();
+  track->Start(base::Bind(&base::DoNothing));
+  track->AddSink(&mock_sink);
+
+  MediaStreamAudioDeliverer<MediaStreamAudioTrack> deliverer;
+  deliverer.AddConsumer(track);
+
+  EXPECT_CALL(mock_sink, OnReadyStateChanged(
+                             MediaStreamTrack::ReadyState::kReadyStateEnded));
+
+  // This should call |OnReadyStateChanged| with |ReadyState::kReadyStateEnded|,
+  // and |OnReadyStateChanged| should NOT be called when track gets destroyed,
+  // since the track is already stopped.
+  track->Stop();
+
+  EXPECT_CALL(mock_sink, OnReadyStateChanged(_)).Times(0);
+}
+
+TEST_F(MediaStreamAudioTrackTest, ReadyStateEndedNotifyIfAlreadyStopped) {
+  scoped_refptr<MediaStreamAudioTrack> track = new MediaStreamAudioTrack();
+  track->Start(base::Bind(&base::DoNothing));
+  track->Stop();
+
+  StrictMock<MockMediaStreamAudioSink> mock_sink;
+  EXPECT_CALL(mock_sink, OnReadyStateChanged(
+                             MediaStreamTrack::ReadyState::kReadyStateEnded));
+  track->AddSink(&mock_sink);
+}
+
+TEST_F(MediaStreamAudioTrackTest, ReadyStateEndedNotifyIfNeverStarted) {
+  scoped_refptr<MediaStreamAudioTrack> track = new MediaStreamAudioTrack();
+
+  StrictMock<MockMediaStreamAudioSink> mock_sink;
+  EXPECT_CALL(mock_sink, OnReadyStateChanged(
+                             MediaStreamTrack::ReadyState::kReadyStateEnded));
+  track->AddSink(&mock_sink);
+}
+
+}  // namespace media_stream
+}  // namespace cobalt
diff --git a/src/cobalt/media_stream/media_stream_source.cc b/src/cobalt/media_stream/media_stream_source.cc
new file mode 100644
index 0000000..9c64784
--- /dev/null
+++ b/src/cobalt/media_stream/media_stream_source.cc
@@ -0,0 +1,44 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "cobalt/media_stream/media_stream_source.h"
+
+#include "base/callback_helpers.h"
+
+namespace cobalt {
+namespace media_stream {
+
+MediaStreamSource::~MediaStreamSource() {
+  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK(stop_callback_.is_null());
+}
+
+void MediaStreamSource::StopSource() {
+  DCHECK(thread_checker_.CalledOnValidThread());
+  DoStopSource();
+  FinalizeStopSource();
+}
+
+void MediaStreamSource::SetStopCallback(const base::Closure& stop_callback) {
+  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK(stop_callback_.is_null());
+  stop_callback_ = stop_callback;
+}
+
+void MediaStreamSource::FinalizeStopSource() {
+  base::ResetAndRunIfNotNull(&stop_callback_);
+}
+
+}  // namespace media_stream
+}  // namespace cobalt
diff --git a/src/cobalt/media_stream/media_stream_source.h b/src/cobalt/media_stream/media_stream_source.h
new file mode 100644
index 0000000..a10424e
--- /dev/null
+++ b/src/cobalt/media_stream/media_stream_source.h
@@ -0,0 +1,53 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COBALT_MEDIA_STREAM_MEDIA_STREAM_SOURCE_H_
+#define COBALT_MEDIA_STREAM_MEDIA_STREAM_SOURCE_H_
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "cobalt/media_stream/media_stream_track.h"
+
+namespace cobalt {
+namespace media_stream {
+
+class MediaStreamSource : public base::RefCounted<MediaStreamSource> {
+ public:
+  MediaStreamSource() = default;
+  virtual ~MediaStreamSource();
+
+  void StopSource();
+  // Only one call back can be set at a time.  Stopping a source will
+  // call the |stop_callback| if set, and then clear it.
+  void SetStopCallback(const base::Closure& stop_callback);
+
+ protected:
+  // Called from StopSource(). Derived classes can implement their own
+  // logic here when StopSource is called.
+  virtual void DoStopSource() = 0;
+  // Calls |stop_callback| if it is set.
+  void FinalizeStopSource();
+
+ private:
+  MediaStreamSource(const MediaStreamSource&) = delete;
+  MediaStreamSource& operator=(const MediaStreamSource&) = delete;
+
+  base::ThreadChecker thread_checker_;
+  base::Closure stop_callback_;
+};
+
+}  // namespace media_stream
+}  // namespace cobalt
+
+#endif  // COBALT_MEDIA_STREAM_MEDIA_STREAM_SOURCE_H_
diff --git a/src/cobalt/media_stream/media_stream_test.gyp b/src/cobalt/media_stream/media_stream_test.gyp
index 642166b..f002897 100644
--- a/src/cobalt/media_stream/media_stream_test.gyp
+++ b/src/cobalt/media_stream/media_stream_test.gyp
@@ -22,7 +22,12 @@
       'type': '<(gtest_target_type)',
       'sources': [
         'audio_parameters_test.cc',
+        'media_stream_audio_source_test.cc',
+        'media_stream_audio_track_test.cc',
         'media_stream_test.cc',
+        'testing/mock_media_stream_audio_sink.h',
+        'testing/mock_media_stream_audio_source.h',
+        'testing/mock_media_stream_audio_track.h',
       ],
       'dependencies': [
         '<(DEPTH)/cobalt/dom/dom.gyp:dom',
diff --git a/src/cobalt/media_stream/media_stream_track.h b/src/cobalt/media_stream/media_stream_track.h
index bb060b8..cfd1e7f 100644
--- a/src/cobalt/media_stream/media_stream_track.h
+++ b/src/cobalt/media_stream/media_stream_track.h
@@ -15,6 +15,7 @@
 #ifndef COBALT_MEDIA_STREAM_MEDIA_STREAM_TRACK_H_
 #define COBALT_MEDIA_STREAM_MEDIA_STREAM_TRACK_H_
 
+#include "base/callback.h"
 #include "base/string_piece.h"
 #include "cobalt/dom/event_target.h"
 #include "cobalt/media_stream/media_track_settings.h"
@@ -26,27 +27,22 @@
 // at: https://www.w3.org/TR/mediacapture-streams/#dom-mediastreamtrack
 class MediaStreamTrack : public dom::EventTarget {
  public:
-  // Function exposed to Javascript via IDL.
+  enum ReadyState { kReadyStateLive, kReadyStateEnded, };
+
+  MediaStreamTrack() = default;
+  // Function exposed to JavaScript via IDL.
   const MediaTrackSettings& GetSettings() { return settings_; }
 
-  // The following function is not exposed to Javascript.
-
-  // Returns number of bytes read. If the return value is 0, the user
-  // is encouraged to try again later, as there might be no additional
-  // data available. Returns a value < 0 on error.
-  int64 Read(base::StringPiece output_buffer) {
-    UNREFERENCED_PARAMETER(output_buffer);
-    NOTIMPLEMENTED();
-    return 0;
-  }
+  virtual void Stop() = 0;
 
   DEFINE_WRAPPABLE_TYPE(MediaStreamTrack);
 
+ protected:
+  MediaTrackSettings settings_;
+
  private:
   MediaStreamTrack(const MediaStreamTrack&) = delete;
   MediaStreamTrack& operator=(const MediaStreamTrack&) = delete;
-
-  MediaTrackSettings settings_;
 };
 
 }  // namespace media_stream
diff --git a/src/cobalt/media_stream/microphone_audio_source.cc b/src/cobalt/media_stream/microphone_audio_source.cc
new file mode 100644
index 0000000..09ad78f
--- /dev/null
+++ b/src/cobalt/media_stream/microphone_audio_source.cc
@@ -0,0 +1,120 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "cobalt/media_stream/microphone_audio_source.h"
+
+#include <string>
+
+#include "cobalt/media_stream/audio_parameters.h"
+#include "cobalt/speech/microphone.h"
+#include "cobalt/speech/microphone_fake.h"
+#include "cobalt/speech/microphone_starboard.h"
+
+#if SB_USE_SB_MICROPHONE && !defined(DISABLE_MICROPHONE_IDL)
+#define ENABLE_MICROPHONE_IDL
+#endif
+
+namespace cobalt {
+namespace media_stream {
+
+bool MicrophoneAudioSource::EnsureSourceIsStarted() {
+  microphone_manager_.Open();
+  return true;
+}
+
+void MicrophoneAudioSource::EnsureSourceIsStopped() {
+  microphone_manager_.Close();
+}
+
+scoped_ptr<cobalt::speech::Microphone> MicrophoneAudioSource::CreateMicrophone(
+    const cobalt::speech::Microphone::Options& options, int buffer_size_bytes) {
+#if defined(ENABLE_FAKE_MICROPHONE)
+  UNREFERENCED_PARAMETER(buffer_size_bytes);
+  if (options.enable_fake_microphone) {
+    return make_scoped_ptr<speech::Microphone>(
+        new speech::MicrophoneFake(options));
+  }
+#else
+  UNREFERENCED_PARAMETER(options);
+#endif  // defined(ENABLE_FAKE_MICROPHONE)
+
+  scoped_ptr<speech::Microphone> mic;
+
+#if defined(ENABLE_MICROPHONE_IDL)
+  mic.reset(new speech::MicrophoneStarboard(
+      speech::MicrophoneStarboard::kDefaultSampleRate, buffer_size_bytes));
+
+  AudioParameters params(
+      1, speech::MicrophoneStarboard::kDefaultSampleRate,
+      speech::MicrophoneStarboard::kSbMicrophoneSampleSizeInBytes * 8);
+  SetFormat(params);
+#else
+  UNREFERENCED_PARAMETER(buffer_size_bytes);
+#endif  // defined(ENABLE_MICROPHONE_IDL)
+
+  return mic.Pass();
+}
+
+MicrophoneAudioSource::MicrophoneAudioSource(
+    const speech::Microphone::Options& options)
+    // Note: It is safe to use unretained pointers here, since
+    // |microphone_manager_| is a member variable, and |this| object
+    // will have the same lifetime.
+    // Furthermore, it is an error to destruct the microphone manager
+    // without stopping it, so these callbacks are not to be called
+    // during the destruction of the object.
+    : ALLOW_THIS_IN_INITIALIZER_LIST(microphone_manager_(
+          base::Bind(&MicrophoneAudioSource::OnDataReceived,
+                     base::Unretained(this)),
+          base::Bind(&MicrophoneAudioSource::OnDataCompletion,
+                     base::Unretained(this)),
+          base::Bind(&MicrophoneAudioSource::OnMicError,
+                     base::Unretained(this)),
+          base::Bind(&MicrophoneAudioSource::CreateMicrophone,
+                     base::Unretained(this), options))) {}
+
+void MicrophoneAudioSource::OnDataReceived(
+    scoped_ptr<MediaStreamAudioTrack::ShellAudioBus> audio_bus) {
+  base::TimeTicks now = base::TimeTicks::Now();
+  DeliverDataToTracks(*audio_bus, now);
+}
+
+void MicrophoneAudioSource::OnDataCompletion() {
+  DLOG(INFO) << "Microphone is closed.";
+  StopSource();
+}
+
+void MicrophoneAudioSource::OnMicError(
+    speech::MicrophoneManager::MicrophoneError error,
+    const std::string& error_message) {
+  std::string microphone_error_category;
+  switch (error) {
+    case speech::MicrophoneManager::MicrophoneError::kAborted:
+      // Unable to open the microphone.
+      microphone_error_category = "Aborted";
+      break;
+    case speech::MicrophoneManager::MicrophoneError::kAudioCapture:
+      microphone_error_category = "AudioCapture";
+      break;
+  }
+  LOG(ERROR) << "Got a microphone error. Category[" << microphone_error_category
+             << "] " << error_message;
+
+  // This will notify downstream objects audio track, and source that there will
+  // be no more data.
+  StopSource();
+}
+
+}  // namespace media_stream
+}  // namespace cobalt
diff --git a/src/cobalt/media_stream/microphone_audio_source.h b/src/cobalt/media_stream/microphone_audio_source.h
new file mode 100644
index 0000000..6cffb98
--- /dev/null
+++ b/src/cobalt/media_stream/microphone_audio_source.h
@@ -0,0 +1,62 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COBALT_MEDIA_STREAM_MICROPHONE_AUDIO_SOURCE_H_
+#define COBALT_MEDIA_STREAM_MICROPHONE_AUDIO_SOURCE_H_
+
+#include <string>
+
+#include "base/memory/ref_counted.h"
+#include "cobalt/media_stream/media_stream_audio_source.h"
+#include "cobalt/speech/microphone_manager.h"
+
+namespace cobalt {
+namespace media_stream {
+
+class MicrophoneAudioSource : public MediaStreamAudioSource,
+                              public base::RefCounted<MicrophoneAudioSource> {
+ public:
+  explicit MicrophoneAudioSource(const speech::Microphone::Options& options);
+
+ private:
+  MicrophoneAudioSource(const MicrophoneAudioSource&) = delete;
+  MicrophoneAudioSource& operator=(const MicrophoneAudioSource&) = delete;
+  ~MicrophoneAudioSource() = default;
+
+  bool EnsureSourceIsStarted() override;
+
+  void EnsureSourceIsStopped() override;
+
+  // MicrophoneManager callbacks.
+  scoped_ptr<cobalt::speech::Microphone> CreateMicrophone(
+      const cobalt::speech::Microphone::Options& options,
+      int buffer_size_bytes);
+
+  void OnDataReceived(
+      scoped_ptr<MediaStreamAudioTrack::ShellAudioBus> audio_bus);
+
+  void OnDataCompletion();
+
+  void OnMicError(speech::MicrophoneManager::MicrophoneError error,
+                  const std::string& error_message);
+
+  speech::MicrophoneManager microphone_manager_;
+
+  friend class base::RefCounted<MicrophoneAudioSource>;
+};
+
+}  // namespace media_stream
+}  // namespace cobalt
+
+#endif  // COBALT_MEDIA_STREAM_MICROPHONE_AUDIO_SOURCE_H_
diff --git a/src/cobalt/media_stream/testing/mock_media_stream_audio_sink.h b/src/cobalt/media_stream/testing/mock_media_stream_audio_sink.h
new file mode 100644
index 0000000..553428e
--- /dev/null
+++ b/src/cobalt/media_stream/testing/mock_media_stream_audio_sink.h
@@ -0,0 +1,37 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COBALT_MEDIA_STREAM_TESTING_MOCK_MEDIA_STREAM_AUDIO_SINK_H_
+#define COBALT_MEDIA_STREAM_TESTING_MOCK_MEDIA_STREAM_AUDIO_SINK_H_
+
+#include "cobalt/media_stream/media_stream_audio_sink.h"
+
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace cobalt {
+namespace media_stream {
+
+class MockMediaStreamAudioSink : public MediaStreamAudioSink {
+ public:
+  MOCK_METHOD2(OnData, void(const ShellAudioBus& audio_bus,
+                            base::TimeTicks reference_time));
+  MOCK_METHOD1(OnSetFormat, void(const media_stream::AudioParameters& params));
+  MOCK_METHOD1(OnReadyStateChanged,
+               void(media_stream::MediaStreamTrack::ReadyState new_state));
+};
+
+}  // namespace media_stream
+}  // namespace cobalt
+
+#endif  // COBALT_MEDIA_STREAM_TESTING_MOCK_MEDIA_STREAM_AUDIO_SINK_H_
diff --git a/src/cobalt/media_stream/testing/mock_media_stream_audio_source.h b/src/cobalt/media_stream/testing/mock_media_stream_audio_source.h
new file mode 100644
index 0000000..606221f
--- /dev/null
+++ b/src/cobalt/media_stream/testing/mock_media_stream_audio_source.h
@@ -0,0 +1,34 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COBALT_MEDIA_STREAM_TESTING_MOCK_MEDIA_STREAM_AUDIO_SOURCE_H_
+#define COBALT_MEDIA_STREAM_TESTING_MOCK_MEDIA_STREAM_AUDIO_SOURCE_H_
+
+#include "cobalt/media_stream/media_stream_audio_source.h"
+
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace cobalt {
+namespace media_stream {
+
+class MockMediaStreamAudioSource : public MediaStreamAudioSource {
+ public:
+  MOCK_METHOD0(EnsureSourceIsStarted, bool());
+  MOCK_METHOD0(EnsureSourceIsStopped, void());
+};
+
+}  // namespace media_stream
+}  // namespace cobalt
+
+#endif  // COBALT_MEDIA_STREAM_TESTING_MOCK_MEDIA_STREAM_AUDIO_SOURCE_H_
diff --git a/src/cobalt/media_stream/testing/mock_media_stream_audio_track.h b/src/cobalt/media_stream/testing/mock_media_stream_audio_track.h
new file mode 100644
index 0000000..8e765bd
--- /dev/null
+++ b/src/cobalt/media_stream/testing/mock_media_stream_audio_track.h
@@ -0,0 +1,33 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COBALT_MEDIA_STREAM_TESTING_MOCK_MEDIA_STREAM_AUDIO_TRACK_H_
+#define COBALT_MEDIA_STREAM_TESTING_MOCK_MEDIA_STREAM_AUDIO_TRACK_H_
+
+#include "cobalt/media_stream/media_stream_audio_track.h"
+
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace cobalt {
+namespace media_stream {
+
+class MockMediaStreamAudioTrack : public MediaStreamAudioTrack {
+ public:
+  MOCK_METHOD0(Stop, void());
+};
+
+}  // namespace media_stream
+}  // namespace cobalt
+
+#endif  // COBALT_MEDIA_STREAM_TESTING_MOCK_MEDIA_STREAM_AUDIO_TRACK_H_
diff --git a/src/cobalt/overlay_info/qr_code_overlay.cc b/src/cobalt/overlay_info/qr_code_overlay.cc
index a3388d8..7c37273 100644
--- a/src/cobalt/overlay_info/qr_code_overlay.cc
+++ b/src/cobalt/overlay_info/qr_code_overlay.cc
@@ -209,7 +209,7 @@
     return;
   }
 
-  scoped_refptr<ImageNode> image_node = new ImageNode(NULL);
+  scoped_refptr<ImageNode> image_node = new ImageNode(nullptr);
   render_tree::animations::AnimateNode::Builder animate_node_builder;
 
   animate_node_builder.Add(
diff --git a/src/cobalt/render_tree/animations/animate_node.cc b/src/cobalt/render_tree/animations/animate_node.cc
index d0fdfd8..d95b5d4 100644
--- a/src/cobalt/render_tree/animations/animate_node.cc
+++ b/src/cobalt/render_tree/animations/animate_node.cc
@@ -70,6 +70,7 @@
         depends_on_time_expiry_(-base::TimeDelta::Max()) {}
 
   void Visit(animations::AnimateNode* animate) override;
+  void Visit(ClearRectNode* clear_rect) override { VisitNode(clear_rect); }
   void Visit(CompositionNode* composition) override { VisitNode(composition); }
   void Visit(FilterNode* text) override { VisitNode(text); }
   void Visit(ImageNode* image) override { VisitNode(image); }
@@ -243,6 +244,7 @@
     NOTREACHED();
   }
   // Immediately switch to a templated visitor function.
+  void Visit(ClearRectNode* clear_rect) override { VisitNode(clear_rect); }
   void Visit(CompositionNode* composition) override { VisitNode(composition); }
   void Visit(FilterNode* text) override { VisitNode(text); }
   void Visit(ImageNode* image) override { VisitNode(image); }
@@ -397,6 +399,7 @@
     NOTREACHED();
   }
   // Immediately switch to a templated visitor function.
+  void Visit(ClearRectNode* clear_rect) override { VisitNode(clear_rect); }
   void Visit(CompositionNode* composition) override { VisitNode(composition); }
   void Visit(FilterNode* text) override { VisitNode(text); }
   void Visit(ImageNode* image) override { VisitNode(image); }
diff --git a/src/cobalt/render_tree/child_iterator.h b/src/cobalt/render_tree/child_iterator.h
index e247117..12c327b 100644
--- a/src/cobalt/render_tree/child_iterator.h
+++ b/src/cobalt/render_tree/child_iterator.h
@@ -15,6 +15,7 @@
 #ifndef COBALT_RENDER_TREE_CHILD_ITERATOR_H_
 #define COBALT_RENDER_TREE_CHILD_ITERATOR_H_
 
+#include "cobalt/render_tree/clear_rect_node.h"
 #include "cobalt/render_tree/composition_node.h"
 #include "cobalt/render_tree/filter_node.h"
 #include "cobalt/render_tree/image_node.h"
@@ -29,6 +30,7 @@
 namespace cobalt {
 namespace render_tree {
 
+class ClearRectNode;
 class ImageNode;
 class PunchThroughVideoNode;
 class RectNode;
diff --git a/src/cobalt/dom/uint32_array.h b/src/cobalt/render_tree/clear_rect_node.cc
similarity index 68%
rename from src/cobalt/dom/uint32_array.h
rename to src/cobalt/render_tree/clear_rect_node.cc
index 8532467..d66fae6 100644
--- a/src/cobalt/dom/uint32_array.h
+++ b/src/cobalt/render_tree/clear_rect_node.cc
@@ -1,4 +1,4 @@
-// Copyright 2016 Google Inc. All Rights Reserved.
+// Copyright 2018 Google Inc. All Rights Reserved.
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -12,17 +12,14 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#ifndef COBALT_DOM_UINT32_ARRAY_H_
-#define COBALT_DOM_UINT32_ARRAY_H_
+#include "cobalt/render_tree/clear_rect_node.h"
 
-#include "cobalt/dom/typed_array.h"
+#include "cobalt/render_tree/node_visitor.h"
 
 namespace cobalt {
-namespace dom {
+namespace render_tree {
 
-DEFINE_TYPED_ARRAY(Uint32Array, uint32);
+void ClearRectNode::Accept(NodeVisitor* visitor) { visitor->Visit(this); }
 
-}  // namespace dom
+}  // namespace render_tree
 }  // namespace cobalt
-
-#endif  // COBALT_DOM_UINT32_ARRAY_H_
diff --git a/src/cobalt/render_tree/clear_rect_node.h b/src/cobalt/render_tree/clear_rect_node.h
new file mode 100644
index 0000000..ed884b4
--- /dev/null
+++ b/src/cobalt/render_tree/clear_rect_node.h
@@ -0,0 +1,68 @@
+// Copyright 2018 Google Inc. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef COBALT_RENDER_TREE_CLEAR_RECT_NODE_H_
+#define COBALT_RENDER_TREE_CLEAR_RECT_NODE_H_
+
+#include "base/compiler_specific.h"
+#include "cobalt/base/type_id.h"
+#include "cobalt/math/rect_f.h"
+#include "cobalt/render_tree/color_rgba.h"
+#include "cobalt/render_tree/node.h"
+
+namespace cobalt {
+namespace render_tree {
+
+// A simple rectangle, filled (without blending) with a specified color.
+class ClearRectNode : public Node {
+ public:
+  class Builder {
+   public:
+    Builder(const Builder& other) = default;
+
+    Builder(const math::RectF& rect, const ColorRGBA& color)
+        : rect(rect), color(color) {}
+
+    bool operator==(const Builder& other) const {
+      return rect == other.rect && color == other.color;
+    }
+
+    // The destination rectangle.
+    math::RectF rect;
+
+    // The clear color.
+    ColorRGBA color;
+  };
+
+  // Forwarding constructor to the set of Builder constructors.
+  template <typename... Us>
+  ClearRectNode(Us&&... args) : data_(std::forward<Us>(args)...) {}
+
+  void Accept(NodeVisitor* visitor) override;
+  math::RectF GetBounds() const override { return data_.rect; }
+
+  base::TypeId GetTypeId() const override {
+    return base::GetTypeId<ClearRectNode>();
+  }
+
+  const Builder& data() const { return data_; }
+
+ private:
+  const Builder data_;
+};
+
+}  // namespace render_tree
+}  // namespace cobalt
+
+#endif  // COBALT_RENDER_TREE_CLEAR_RECT_NODE_H_
diff --git a/src/cobalt/render_tree/dump_render_tree_to_string.cc b/src/cobalt/render_tree/dump_render_tree_to_string.cc
index 138cebd..44ea437 100644
--- a/src/cobalt/render_tree/dump_render_tree_to_string.cc
+++ b/src/cobalt/render_tree/dump_render_tree_to_string.cc
@@ -16,6 +16,7 @@
 
 #include <sstream>
 
+#include "cobalt/render_tree/clear_rect_node.h"
 #include "cobalt/render_tree/composition_node.h"
 #include "cobalt/render_tree/filter_node.h"
 #include "cobalt/render_tree/image_node.h"
@@ -43,6 +44,7 @@
   DebugTreePrinter() : indent_(0) {}
 
   void Visit(animations::AnimateNode* /* animate */) override { NOTREACHED(); }
+  void Visit(ClearRectNode* clear_rect) override;
   void Visit(CompositionNode* composition) override;
   void Visit(FilterNode* text) override;
   void Visit(ImageNode* image) override;
@@ -84,6 +86,11 @@
   int indent_;
 };
 
+void DebugTreePrinter::Visit(ClearRectNode* clear_rect) {
+  AddNamedNodeString(clear_rect, "ClearRectNode");
+  result_ << "\n";
+}
+
 void DebugTreePrinter::Visit(CompositionNode* composition) {
   AddNamedNodeString(composition, "CompositionNode");
   result_ << "\n";
diff --git a/src/cobalt/render_tree/filter_node.cc b/src/cobalt/render_tree/filter_node.cc
index fa66bac..dd6a0b4 100644
--- a/src/cobalt/render_tree/filter_node.cc
+++ b/src/cobalt/render_tree/filter_node.cc
@@ -37,22 +37,6 @@
                              const scoped_refptr<render_tree::Node>& source)
     : source(source), map_to_mesh_filter(map_to_mesh_filter) {}
 
-FilterNode::FilterNode(const OpacityFilter& opacity_filter,
-                       const scoped_refptr<render_tree::Node>& source)
-    : data_(opacity_filter, source) { AssertValid(); }
-
-FilterNode::FilterNode(const ViewportFilter& viewport_filter,
-                       const scoped_refptr<render_tree::Node>& source)
-    : data_(viewport_filter, source) { AssertValid(); }
-
-FilterNode::FilterNode(const BlurFilter& blur_filter,
-                       const scoped_refptr<render_tree::Node>& source)
-    : data_(blur_filter, source) { AssertValid(); }
-
-FilterNode::FilterNode(const MapToMeshFilter& map_to_mesh_filter,
-                       const scoped_refptr<render_tree::Node>& source)
-    : data_(map_to_mesh_filter, source) { AssertValid(); }
-
 void FilterNode::Accept(NodeVisitor* visitor) { visitor->Visit(this); }
 
 math::RectF FilterNode::Builder::GetBounds() const {
diff --git a/src/cobalt/render_tree/filter_node.h b/src/cobalt/render_tree/filter_node.h
index 7978627..e3b8302 100644
--- a/src/cobalt/render_tree/filter_node.h
+++ b/src/cobalt/render_tree/filter_node.h
@@ -16,6 +16,7 @@
 #define COBALT_RENDER_TREE_FILTER_NODE_H_
 
 #include "base/compiler_specific.h"
+#include "base/logging.h"
 #include "base/optional.h"
 #include "cobalt/base/type_id.h"
 #include "cobalt/render_tree/blur_filter.h"
@@ -35,6 +36,7 @@
 class FilterNode : public Node {
  public:
   struct Builder {
+    Builder(const Builder&) = default;
     explicit Builder(const scoped_refptr<render_tree::Node>& source);
 
     Builder(const OpacityFilter& opacity_filter,
@@ -81,22 +83,14 @@
     base::optional<MapToMeshFilter> map_to_mesh_filter;
   };
 
-  explicit FilterNode(const Builder& builder) : data_(builder) {
-    AssertValid();
+  // Forwarding constructor to the set of Builder constructors.
+  template <typename... Args>
+  FilterNode(Args&&... args) : data_(std::forward<Args>(args)...) {
+    if (DCHECK_IS_ON()) {
+      AssertValid();
+    }
   }
 
-  FilterNode(const OpacityFilter& opacity_filter,
-             const scoped_refptr<render_tree::Node>& source);
-
-  FilterNode(const ViewportFilter& viewport_filter,
-             const scoped_refptr<render_tree::Node>& source);
-
-  FilterNode(const BlurFilter& blur_filter,
-             const scoped_refptr<render_tree::Node>& source);
-
-  FilterNode(const MapToMeshFilter& map_to_mesh_filter,
-             const scoped_refptr<render_tree::Node>& source);
-
   void Accept(NodeVisitor* visitor) override;
   math::RectF GetBounds() const override { return data_.GetBounds(); }
 
diff --git a/src/cobalt/render_tree/image_node.cc b/src/cobalt/render_tree/image_node.cc
index cb0d178..d8644c5 100644
--- a/src/cobalt/render_tree/image_node.cc
+++ b/src/cobalt/render_tree/image_node.cc
@@ -19,17 +19,18 @@
 namespace cobalt {
 namespace render_tree {
 
+ImageNode::Builder::Builder(const scoped_refptr<Image>& source)
+    : Builder(source, source ? math::RectF(source->GetSize()) : math::RectF()) {
+}
+
 ImageNode::Builder::Builder(const scoped_refptr<Image>& source,
                             const math::RectF& destination_rect)
-    : source(source),
-      destination_rect(destination_rect),
-      local_transform(math::Matrix3F::Identity()) {}
+    : source(source), destination_rect(destination_rect) {}
 
 ImageNode::Builder::Builder(const scoped_refptr<Image>& source,
                             const math::Vector2dF& offset)
     : source(source),
-      destination_rect(PointAtOffsetFromOrigin(offset), source->GetSize()),
-      local_transform(math::Matrix3F::Identity()) {}
+      destination_rect(PointAtOffsetFromOrigin(offset), source->GetSize()) {}
 
 ImageNode::Builder::Builder(const scoped_refptr<Image>& source,
                             const math::RectF& destination_rect,
@@ -38,22 +39,6 @@
       destination_rect(destination_rect),
       local_transform(local_transform) {}
 
-ImageNode::ImageNode(const scoped_refptr<Image>& source)
-    : data_(source, source ? math::RectF(source->GetSize()) : math::RectF()) {}
-
-ImageNode::ImageNode(const scoped_refptr<Image>& source,
-                     const math::RectF& destination_rect)
-    : data_(source, destination_rect) {}
-
-ImageNode::ImageNode(const scoped_refptr<Image>& source,
-                     const math::Vector2dF& offset)
-    : data_(source, offset) {}
-
-ImageNode::ImageNode(const scoped_refptr<Image>& source,
-                     const math::RectF& destination_rect,
-                     const math::Matrix3F& local_transform)
-    : data_(source, destination_rect, local_transform) {}
-
 void ImageNode::Accept(NodeVisitor* visitor) { visitor->Visit(this); }
 
 math::RectF ImageNode::GetBounds() const { return data_.destination_rect; }
diff --git a/src/cobalt/render_tree/image_node.h b/src/cobalt/render_tree/image_node.h
index a1219c5..c843491 100644
--- a/src/cobalt/render_tree/image_node.h
+++ b/src/cobalt/render_tree/image_node.h
@@ -29,9 +29,20 @@
 class ImageNode : public Node {
  public:
   struct Builder {
+    Builder(const Builder&) = default;
+
+    // If no width/height are specified, the native width and height of the
+    // image will be selected and used as the image node's width and height.
+    explicit Builder(const scoped_refptr<Image>& source);
+    // The specified image will render with the given width and height, which
+    // may result in scaling.
     Builder(const scoped_refptr<Image>& source,
             const math::RectF& destination_rect);
+    // Positions the image using the unscaled source image dimensions, along
+    // with a translation offset.
     Builder(const scoped_refptr<Image>& source, const math::Vector2dF& offset);
+    // Allows users to additionally supply a local matrix to be applied to the
+    // normalized image coordinates.
     Builder(const scoped_refptr<Image>& source,
             const math::RectF& destination_rect,
             const math::Matrix3F& local_transform);
@@ -56,26 +67,12 @@
     // destination rectangle.  As an example, if you were to pass in a scale
     // matrix that scales the image coordinates by 0.5 in all directions, the
     // image will appear zoomed out.
-    math::Matrix3F local_transform;
+    math::Matrix3F local_transform = math::Matrix3F::Identity();
   };
 
-  explicit ImageNode(const Builder& builder) : data_(builder) {}
-
-  // If no width/height are specified, the native width and height of the
-  // image will be selected and used as the image node's width and height.
-  explicit ImageNode(const scoped_refptr<Image>& source);
-  // The specified image will render with the given width and height, which
-  // may result in scaling.
-  ImageNode(const scoped_refptr<Image>& image,
-            const math::RectF& destination_rect);
-
-  ImageNode(const scoped_refptr<Image>& image, const math::Vector2dF& offset);
-
-  // Allows users to additionally supply a local matrix to be applied to the
-  // normalized image coordinates.
-  ImageNode(const scoped_refptr<Image>& image,
-            const math::RectF& destination_rect,
-            const math::Matrix3F& local_transform);
+  // Forwarding constructor to the set of Builder constructors.
+  template <typename... Args>
+  ImageNode(Args&&... args) : data_(std::forward<Args>(args)...) {}
 
   void Accept(NodeVisitor* visitor) override;
   math::RectF GetBounds() const override;
diff --git a/src/cobalt/render_tree/matrix_transform_3d_node.h b/src/cobalt/render_tree/matrix_transform_3d_node.h
index ae25d16..3887741 100644
--- a/src/cobalt/render_tree/matrix_transform_3d_node.h
+++ b/src/cobalt/render_tree/matrix_transform_3d_node.h
@@ -34,6 +34,7 @@
 class MatrixTransform3DNode : public Node {
  public:
   struct Builder {
+    Builder(const Builder&) = default;
     Builder(const scoped_refptr<Node>& source, const glm::mat4& transform)
         : source(source), transform(transform) {}
 
@@ -49,11 +50,9 @@
     glm::mat4 transform;
   };
 
-  MatrixTransform3DNode(const scoped_refptr<Node>& source,
-                        const glm::mat4& transform)
-      : data_(source, transform) {}
-
-  explicit MatrixTransform3DNode(const Builder& builder) : data_(builder) {}
+  // Forwarding constructor to the set of Builder constructors.
+  template <typename... Args>
+  MatrixTransform3DNode(Args&&... args) : data_(std::forward<Args>(args)...) {}
 
   void Accept(NodeVisitor* visitor) override;
   math::RectF GetBounds() const override;
diff --git a/src/cobalt/render_tree/matrix_transform_node.h b/src/cobalt/render_tree/matrix_transform_node.h
index 510d204..861b349 100644
--- a/src/cobalt/render_tree/matrix_transform_node.h
+++ b/src/cobalt/render_tree/matrix_transform_node.h
@@ -31,6 +31,7 @@
 class MatrixTransformNode : public Node {
  public:
   struct Builder {
+    Builder(const Builder&) = default;
     Builder(const scoped_refptr<Node>& source, const math::Matrix3F& transform)
         : source(source), transform(transform) {}
 
@@ -46,11 +47,9 @@
     math::Matrix3F transform;
   };
 
-  MatrixTransformNode(const scoped_refptr<Node>& source,
-                      const math::Matrix3F& transform)
-      : data_(source, transform) {}
-
-  explicit MatrixTransformNode(const Builder& builder) : data_(builder) {}
+  // Forwarding constructor to the set of Builder constructors.
+  template <typename... Args>
+  MatrixTransformNode(Args&&... args) : data_(std::forward<Args>(args)...) {}
 
   void Accept(NodeVisitor* visitor) override;
   math::RectF GetBounds() const override;
diff --git a/src/cobalt/render_tree/node_visitor.h b/src/cobalt/render_tree/node_visitor.h
index 1cfe21f..c174948 100644
--- a/src/cobalt/render_tree/node_visitor.h
+++ b/src/cobalt/render_tree/node_visitor.h
@@ -18,6 +18,7 @@
 namespace cobalt {
 namespace render_tree {
 
+class ClearRectNode;
 class CompositionNode;
 class FilterNode;
 class ImageNode;
@@ -38,6 +39,7 @@
 class NodeVisitor {
  public:
   virtual void Visit(animations::AnimateNode* animate) = 0;
+  virtual void Visit(ClearRectNode* clear_rect) = 0;
   virtual void Visit(CompositionNode* composition) = 0;
   virtual void Visit(FilterNode* text) = 0;
   virtual void Visit(ImageNode* image) = 0;
diff --git a/src/cobalt/render_tree/node_visitor_test.cc b/src/cobalt/render_tree/node_visitor_test.cc
index 1058a78..6e10353 100644
--- a/src/cobalt/render_tree/node_visitor_test.cc
+++ b/src/cobalt/render_tree/node_visitor_test.cc
@@ -20,6 +20,7 @@
 #include "cobalt/math/rect_f.h"
 #include "cobalt/math/size.h"
 #include "cobalt/render_tree/animations/animate_node.h"
+#include "cobalt/render_tree/clear_rect_node.h"
 #include "cobalt/render_tree/composition_node.h"
 #include "cobalt/render_tree/filter_node.h"
 #include "cobalt/render_tree/font.h"
@@ -38,6 +39,7 @@
 using cobalt::render_tree::Brush;
 using cobalt::render_tree::BrushVisitor;
 using cobalt::render_tree::ColorRGBA;
+using cobalt::render_tree::ClearRectNode;
 using cobalt::render_tree::CompositionNode;
 using cobalt::render_tree::FilterNode;
 using cobalt::render_tree::Font;
@@ -57,6 +59,7 @@
 class MockNodeVisitor : public NodeVisitor {
  public:
   MOCK_METHOD1(Visit, void(AnimateNode* animate));
+  MOCK_METHOD1(Visit, void(ClearRectNode* clear_rect));
   MOCK_METHOD1(Visit, void(CompositionNode* composition));
   MOCK_METHOD1(Visit, void(FilterNode* image));
   MOCK_METHOD1(Visit, void(ImageNode* image));
@@ -68,6 +71,14 @@
   MOCK_METHOD1(Visit, void(TextNode* text));
 };
 
+TEST(NodeVisitorTest, VisitsClearRect) {
+  scoped_refptr<ClearRectNode> clear_rect(
+      new ClearRectNode(cobalt::math::RectF(), ColorRGBA(0, 0, 0, 0)));
+  MockNodeVisitor mock_visitor;
+  EXPECT_CALL(mock_visitor, Visit(clear_rect.get()));
+  clear_rect->Accept(&mock_visitor);
+}
+
 TEST(NodeVisitorTest, VisitsComposition) {
   CompositionNode::Builder builder;
   scoped_refptr<CompositionNode> composition(new CompositionNode(builder));
@@ -77,7 +88,8 @@
 }
 
 TEST(NodeVisitorTest, VisitsFilter) {
-  scoped_refptr<FilterNode> filter(new FilterNode(OpacityFilter(0.5f), NULL));
+  scoped_refptr<FilterNode> filter(
+      new FilterNode(OpacityFilter(0.5f), nullptr));
   MockNodeVisitor mock_visitor;
   EXPECT_CALL(mock_visitor, Visit(filter.get()));
   filter->Accept(&mock_visitor);
@@ -126,7 +138,7 @@
 TEST(NodeVisitorTest, VisitsMatrixTransform3D) {
   scoped_refptr<MatrixTransform3DNode> matrix_transform_3d_node(
       new MatrixTransform3DNode(
-          NULL, glm::mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)));
+          nullptr, glm::mat4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)));
   MockNodeVisitor mock_visitor;
   EXPECT_CALL(mock_visitor, Visit(matrix_transform_3d_node.get()));
   matrix_transform_3d_node->Accept(&mock_visitor);
@@ -134,7 +146,7 @@
 
 TEST(NodeVisitorTest, VisitsMatrixTransform) {
   scoped_refptr<MatrixTransformNode> matrix_transform_node(
-      new MatrixTransformNode(NULL, cobalt::math::Matrix3F::Identity()));
+      new MatrixTransformNode(nullptr, cobalt::math::Matrix3F::Identity()));
   MockNodeVisitor mock_visitor;
   EXPECT_CALL(mock_visitor, Visit(matrix_transform_node.get()));
   matrix_transform_node->Accept(&mock_visitor);
diff --git a/src/cobalt/render_tree/punch_through_video_node.h b/src/cobalt/render_tree/punch_through_video_node.h
index 8ad0da1..d31670c 100644
--- a/src/cobalt/render_tree/punch_through_video_node.h
+++ b/src/cobalt/render_tree/punch_through_video_node.h
@@ -42,6 +42,7 @@
   typedef base::Callback<bool(const math::Rect&)> SetBoundsCB;
 
   struct Builder {
+    Builder(const Builder&) = default;
     Builder(const math::RectF& rect, const SetBoundsCB& set_bounds_cb)
         : rect(rect), set_bounds_cb(set_bounds_cb) {}
 
@@ -54,7 +55,9 @@
     const SetBoundsCB set_bounds_cb;
   };
 
-  explicit PunchThroughVideoNode(const Builder& builder) : data_(builder) {}
+  // Forwarding constructor to the set of Builder constructors.
+  template <typename... Args>
+  PunchThroughVideoNode(Args&&... args) : data_(std::forward<Args>(args)...) {}
 
   void Accept(NodeVisitor* visitor) override;
   math::RectF GetBounds() const override;
diff --git a/src/cobalt/render_tree/rect_node.cc b/src/cobalt/render_tree/rect_node.cc
index b628303..8e9bf94 100644
--- a/src/cobalt/render_tree/rect_node.cc
+++ b/src/cobalt/render_tree/rect_node.cc
@@ -62,9 +62,7 @@
       border(border.Pass()),
       rounded_corners(rounded_corners.Pass()) {}
 
-RectNode::Builder::Builder(const Builder& other) {
-  rect = other.rect;
-
+RectNode::Builder::Builder(const Builder& other) : rect(other.rect) {
   if (other.background_brush) {
     background_brush = CloneBrush(other.background_brush.get());
   }
diff --git a/src/cobalt/render_tree/rect_node.h b/src/cobalt/render_tree/rect_node.h
index 5dc9560..7a3017e 100644
--- a/src/cobalt/render_tree/rect_node.h
+++ b/src/cobalt/render_tree/rect_node.h
@@ -16,6 +16,7 @@
 #define COBALT_RENDER_TREE_RECT_NODE_H_
 
 #include "base/compiler_specific.h"
+#include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "cobalt/base/type_id.h"
 #include "cobalt/math/rect_f.h"
@@ -34,6 +35,8 @@
   class Builder {
    public:
     DECLARE_AS_MOVABLE(Builder);
+    Builder(const Builder& other);
+    explicit Builder(Moved moved);
 
     explicit Builder(const math::RectF& rect);
     Builder(const math::RectF& rect, scoped_ptr<Border> border);
@@ -49,8 +52,6 @@
     Builder(const math::RectF& rect, scoped_ptr<Brush> background_brush,
             scoped_ptr<Border> border,
             scoped_ptr<RoundedCorners> rounded_corners);
-    explicit Builder(const Builder& other);
-    explicit Builder(Moved moved);
 
     bool operator==(const Builder& other) const;
 
@@ -69,41 +70,12 @@
     scoped_ptr<RoundedCorners> rounded_corners;
   };
 
-  RectNode(const math::RectF& rect, scoped_ptr<Border> border)
-      : data_(rect, border.Pass()) {
-    AssertValid();
-  }
-  RectNode(const math::RectF& rect, scoped_ptr<Border> border,
-           scoped_ptr<RoundedCorners> rounded_corners)
-      : data_(rect, border.Pass(), rounded_corners.Pass()) {
-    AssertValid();
-  }
-  RectNode(const math::RectF& rect, scoped_ptr<Brush> background_brush)
-      : data_(rect, background_brush.Pass()) {
-    AssertValid();
-  }
-  RectNode(const math::RectF& rect, scoped_ptr<Brush> background_brush,
-           scoped_ptr<Border> border)
-      : data_(rect, background_brush.Pass(), border.Pass()) {
-    AssertValid();
-  }
-  RectNode(const math::RectF& rect, scoped_ptr<Brush> background_brush,
-           scoped_ptr<RoundedCorners> rounded_corners)
-      : data_(rect, background_brush.Pass(), rounded_corners.Pass()) {
-    AssertValid();
-  }
-  RectNode(const math::RectF& rect, scoped_ptr<Brush> background_brush,
-           scoped_ptr<Border> border,
-           scoped_ptr<RoundedCorners> rounded_corners)
-      : data_(rect, background_brush.Pass(), border.Pass(),
-              rounded_corners.Pass()) {
-    AssertValid();
-  }
-  explicit RectNode(const Builder& builder) : data_(builder) {
-    AssertValid();
-  }
-  explicit RectNode(Builder::Moved builder) : data_(builder) {
-    AssertValid();
+  // Forwarding constructor to the set of Builder constructors.
+  template <typename... Args>
+  RectNode(Args&&... args) : data_(std::forward<Args>(args)...) {
+    if (DCHECK_IS_ON()) {
+      AssertValid();
+    }
   }
 
   void Accept(NodeVisitor* visitor) override;
diff --git a/src/cobalt/render_tree/rect_shadow_node.h b/src/cobalt/render_tree/rect_shadow_node.h
index 99e3f17..e28ee4e 100644
--- a/src/cobalt/render_tree/rect_shadow_node.h
+++ b/src/cobalt/render_tree/rect_shadow_node.h
@@ -16,6 +16,7 @@
 #define COBALT_RENDER_TREE_RECT_SHADOW_NODE_H_
 
 #include "base/compiler_specific.h"
+#include "base/logging.h"
 #include "base/optional.h"
 #include "cobalt/base/type_id.h"
 #include "cobalt/math/rect_f.h"
@@ -31,6 +32,7 @@
  public:
   class Builder {
    public:
+    Builder(const Builder&) = default;
     Builder(const math::RectF& rect, const Shadow& shadow)
         : rect(rect), shadow(shadow), inset(false), spread(0.0f) {}
 
@@ -65,17 +67,14 @@
     float spread;
   };
 
-  explicit RectShadowNode(const Builder& builder) : data_(builder) {
-    AssertValid();
+  // Forwarding constructor to the set of Builder constructors.
+  template <typename... Args>
+  RectShadowNode(Args&&... args) : data_(std::forward<Args>(args)...) {
+    if (DCHECK_IS_ON()) {
+      AssertValid();
+    }
   }
 
-  RectShadowNode(const math::RectF& rect, const Shadow& shadow)
-      : data_(rect, shadow) { AssertValid(); }
-
-  RectShadowNode(const math::RectF& rect, const Shadow& shadow, bool inset,
-                 float spread)
-      : data_(rect, shadow, inset, spread) { AssertValid(); }
-
   void Accept(NodeVisitor* visitor) override;
   math::RectF GetBounds() const override;
 
diff --git a/src/cobalt/render_tree/render_tree.gyp b/src/cobalt/render_tree/render_tree.gyp
index 2be2a1c..98a33be 100644
--- a/src/cobalt/render_tree/render_tree.gyp
+++ b/src/cobalt/render_tree/render_tree.gyp
@@ -33,6 +33,8 @@
         'brush_visitor.h',
         'child_iterator.h',
         'color_rgba.h',
+        'clear_rect_node.cc',
+        'clear_rect_node.h',
         'composition_node.cc',
         'composition_node.h',
         'dump_render_tree_to_string.cc',
diff --git a/src/cobalt/render_tree/rounded_corners.cc b/src/cobalt/render_tree/rounded_corners.cc
index ad460fc..bcf18d7 100644
--- a/src/cobalt/render_tree/rounded_corners.cc
+++ b/src/cobalt/render_tree/rounded_corners.cc
@@ -17,6 +17,14 @@
 namespace cobalt {
 namespace render_tree {
 
+namespace {
+const float kEpsilon = 0.0001f;
+}
+
+bool RoundedCorner::IsSquare() const {
+  return horizontal <= kEpsilon || vertical <= kEpsilon;
+}
+
 RoundedCorners RoundedCorners::Scale(float sx, float sy) const {
   return RoundedCorners(RoundedCorner(top_left.horizontal * sx,
                                       top_left.vertical * sy),
@@ -66,7 +74,6 @@
 bool RoundedCorners::IsNormalized(const math::RectF& rect) const {
   // Introduce a fuzz epsilon so that we are not strict about rounding errors
   // when computing Normalize().
-  const float kEpsilon = 0.0001f;
   const float fuzzed_width = rect.width() + kEpsilon;
   const float fuzzed_height = rect.height() + kEpsilon;
 
diff --git a/src/cobalt/render_tree/rounded_corners.h b/src/cobalt/render_tree/rounded_corners.h
index ef3bf38..70ef042 100644
--- a/src/cobalt/render_tree/rounded_corners.h
+++ b/src/cobalt/render_tree/rounded_corners.h
@@ -31,8 +31,8 @@
   RoundedCorner(float horizontal, float vertical)
       : horizontal(horizontal), vertical(vertical) {}
 
-  //  If either length is zero, the corner is square, not rounded.
-  bool IsSquare() const { return horizontal == 0.0f || vertical == 0.0f; }
+  //  If either length is zero-ish, the corner is square, not rounded.
+  bool IsSquare() const;
 
   RoundedCorner Inset(float x, float y) const {
     return RoundedCorner(std::max(0.0f, horizontal - x),
diff --git a/src/cobalt/render_tree/text_node.h b/src/cobalt/render_tree/text_node.h
index 98c9c7b..23a9c5b 100644
--- a/src/cobalt/render_tree/text_node.h
+++ b/src/cobalt/render_tree/text_node.h
@@ -42,6 +42,7 @@
 class TextNode : public Node {
  public:
   struct Builder {
+    Builder(const Builder&) = default;
     Builder(const math::Vector2dF& offset,
             const scoped_refptr<GlyphBuffer>& glyph_buffer,
             const ColorRGBA& color);
@@ -64,11 +65,9 @@
     base::optional<std::vector<Shadow> > shadows;
   };
 
-  explicit TextNode(const Builder& builder) : data_(builder) {}
-  TextNode(const math::Vector2dF& offset,
-           const scoped_refptr<GlyphBuffer>& glyph_buffer,
-           const ColorRGBA& color)
-      : data_(offset, glyph_buffer, color) {}
+  // Forwarding constructor to the set of Builder constructors.
+  template <typename... Args>
+  TextNode(Args&&... args) : data_(std::forward<Args>(args)...) {}
 
   void Accept(NodeVisitor* visitor) override;
   math::RectF GetBounds() const override;
diff --git a/src/cobalt/renderer/rasterizer/blitter/render_tree_node_visitor.cc b/src/cobalt/renderer/rasterizer/blitter/render_tree_node_visitor.cc
index 54f5534..9019783 100644
--- a/src/cobalt/renderer/rasterizer/blitter/render_tree_node_visitor.cc
+++ b/src/cobalt/renderer/rasterizer/blitter/render_tree_node_visitor.cc
@@ -75,6 +75,29 @@
       software_surface_cache_(software_surface_cache),
       linear_gradient_cache_(linear_gradient_cache) {}
 
+namespace {
+void DrawClearRect(SbBlitterContext context, SbBlitterRect rect,
+                   SbBlitterColor color) {
+  SbBlitterSetColor(context, color);
+  SbBlitterSetBlending(context, false);
+  SbBlitterFillRect(context, rect);
+}
+
+SbBlitterColor RenderTreeToBlitterColor(const ColorRGBA& color) {
+  return SbBlitterColorFromRGBA(color.r() * 255, color.g() * 255,
+                                color.b() * 255, color.a() * 255);
+}
+}  // namespace
+
+void RenderTreeNodeVisitor::Visit(render_tree::ClearRectNode* clear_rect_node) {
+  TRACE_EVENT0_IF_ENABLED("Visit(ClearRectNode)");
+  SbBlitterRect blitter_rect = RectFToBlitterRect(
+      render_state_.transform.TransformRect(clear_rect_node->data().rect));
+
+  DrawClearRect(context_, blitter_rect,
+                RenderTreeToBlitterColor(clear_rect_node->data().color));
+}
+
 void RenderTreeNodeVisitor::Visit(
     render_tree::CompositionNode* composition_node) {
   TRACE_EVENT0_IF_ENABLED("Visit(CompositionNode)");
@@ -294,9 +317,7 @@
       math::Rect(blitter_rect.x, blitter_rect.y, blitter_rect.width,
                  blitter_rect.height));
 
-  SbBlitterSetColor(context_, SbBlitterColorFromRGBA(0, 0, 0, 0));
-  SbBlitterSetBlending(context_, false);
-  SbBlitterFillRect(context_, blitter_rect);
+  DrawClearRect(context_, blitter_rect, SbBlitterColorFromRGBA(0, 0, 0, 0));
 }
 
 namespace {
@@ -309,11 +330,6 @@
          border.left.color == border.bottom.color;
 }
 
-SbBlitterColor RenderTreeToBlitterColor(const ColorRGBA& color) {
-  return SbBlitterColorFromRGBA(color.r() * 255, color.g() * 255,
-                                color.b() * 255, color.a() * 255);
-}
-
 void RenderRectNodeBorder(SbBlitterContext context, ColorRGBA color, float left,
                           float right, float top, float bottom,
                           const RectF& rect) {
diff --git a/src/cobalt/renderer/rasterizer/blitter/render_tree_node_visitor.h b/src/cobalt/renderer/rasterizer/blitter/render_tree_node_visitor.h
index 01be690..273d6f7 100644
--- a/src/cobalt/renderer/rasterizer/blitter/render_tree_node_visitor.h
+++ b/src/cobalt/renderer/rasterizer/blitter/render_tree_node_visitor.h
@@ -21,6 +21,7 @@
 #include "base/compiler_specific.h"
 #include "base/optional.h"
 #include "cobalt/math/rect.h"
+#include "cobalt/render_tree/clear_rect_node.h"
 #include "cobalt/render_tree/composition_node.h"
 #include "cobalt/render_tree/filter_node.h"
 #include "cobalt/render_tree/image_node.h"
@@ -68,6 +69,7 @@
   void Visit(render_tree::animations::AnimateNode* animate_node) override {
     NOTREACHED();
   }
+  void Visit(render_tree::ClearRectNode* clear_rect_node) override;
   void Visit(render_tree::CompositionNode* composition_node) override;
   void Visit(render_tree::FilterNode* filter_node) override;
   void Visit(render_tree::ImageNode* image_node) override;
diff --git a/src/cobalt/renderer/rasterizer/common/find_node.cc b/src/cobalt/renderer/rasterizer/common/find_node.cc
index d9be17a..afce844 100644
--- a/src/cobalt/renderer/rasterizer/common/find_node.cc
+++ b/src/cobalt/renderer/rasterizer/common/find_node.cc
@@ -33,6 +33,9 @@
   void Visit(render_tree::animations::AnimateNode* animate) override {
     VisitNode(animate);
   }
+  void Visit(render_tree::ClearRectNode* clear_rect_node) override {
+    VisitNode(clear_rect_node);
+  }
   void Visit(render_tree::CompositionNode* composition_node) override {
     VisitNode(composition_node);
   }
diff --git a/src/cobalt/renderer/rasterizer/egl/draw_clear.cc b/src/cobalt/renderer/rasterizer/egl/draw_clear.cc
index ae883b1..f7692bd 100644
--- a/src/cobalt/renderer/rasterizer/egl/draw_clear.cc
+++ b/src/cobalt/renderer/rasterizer/egl/draw_clear.cc
@@ -23,10 +23,9 @@
 namespace rasterizer {
 namespace egl {
 
-DrawClear::DrawClear(GraphicsState* graphics_state,
-    const BaseState& base_state, const render_tree::ColorRGBA& clear_color)
-    : DrawObject(base_state),
-      clear_color_(clear_color) {}
+DrawClear::DrawClear(GraphicsState* graphics_state, const BaseState& base_state,
+                     const render_tree::ColorRGBA& clear_color)
+    : DrawObject(base_state), clear_color_(GetDrawColor(clear_color)) {}
 
 void DrawClear::ExecuteUpdateVertexBuffer(
     GraphicsState* graphics_state,
@@ -42,6 +41,7 @@
 
   graphics_state->Scissor(base_state_.scissor.x(), base_state_.scissor.y(),
       base_state_.scissor.width(), base_state_.scissor.height());
+
   graphics_state->Clear(clear_color_.r(), clear_color_.g(), clear_color_.b(),
       clear_color_.a());
 }
diff --git a/src/cobalt/renderer/rasterizer/egl/draw_object.cc b/src/cobalt/renderer/rasterizer/egl/draw_object.cc
index 2e84809..881e423 100644
--- a/src/cobalt/renderer/rasterizer/egl/draw_object.cc
+++ b/src/cobalt/renderer/rasterizer/egl/draw_object.cc
@@ -80,20 +80,11 @@
     : base_state_(base_state),
       merge_type_(base::GetTypeId<DrawObject>()) {}
 
-math::Vector2dF DrawObject::GetScale() const {
-  float m00 = base_state_.transform(0, 0);
-  float m01 = base_state_.transform(0, 1);
-  float m10 = base_state_.transform(1, 0);
-  float m11 = base_state_.transform(1, 1);
-  return math::Vector2dF(std::sqrt(m00 * m00 + m10 * m10),
-                         std::sqrt(m01 * m01 + m11 * m11));
-}
-
 math::Vector2dF DrawObject::RemoveScaleFromTransform() {
   // Avoid division by zero.
   const float kEpsilon = 0.00001f;
 
-  math::Vector2dF scale = GetScale();
+  math::Vector2dF scale = math::GetScale2d(base_state_.transform);
   base_state_.transform = base_state_.transform *
       math::ScaleMatrix(1.0f / std::max(scale.x(), kEpsilon),
                         1.0f / std::max(scale.y(), kEpsilon));
@@ -197,6 +188,26 @@
 // static
 void DrawObject::GetRCornerValues(math::RectF* rect,
     render_tree::RoundedCorners* corners, RRectAttributes out_rcorners[4]) {
+  // Ensure that square corners have dimensions of 0, otherwise they may be
+  // rendered as skewed ellipses (in the case where one dimension is 0 but
+  // not the other).
+  if (corners->top_left.IsSquare()) {
+    corners->top_left.horizontal = 0.0f;
+    corners->top_left.vertical = 0.0f;
+  }
+  if (corners->top_right.IsSquare()) {
+    corners->top_right.horizontal = 0.0f;
+    corners->top_right.vertical = 0.0f;
+  }
+  if (corners->bottom_right.IsSquare()) {
+    corners->bottom_right.horizontal = 0.0f;
+    corners->bottom_right.vertical = 0.0f;
+  }
+  if (corners->bottom_left.IsSquare()) {
+    corners->bottom_left.horizontal = 0.0f;
+    corners->bottom_right.horizontal = 0.0f;
+  }
+
   // Ensure corner sizes are non-zero to allow generic handling of square and
   // rounded corners. Corner radii must be at least 1 pixel for antialiasing
   // to work well.
diff --git a/src/cobalt/renderer/rasterizer/egl/draw_object.h b/src/cobalt/renderer/rasterizer/egl/draw_object.h
index 21ac722..75cfc32 100644
--- a/src/cobalt/renderer/rasterizer/egl/draw_object.h
+++ b/src/cobalt/renderer/rasterizer/egl/draw_object.h
@@ -115,9 +115,6 @@
   DrawObject();
   explicit DrawObject(const BaseState& base_state);
 
-  // Extract the scale vector from this object's transform.
-  math::Vector2dF GetScale() const;
-
   // Remove scale from the transform, and return the scale vector.
   math::Vector2dF RemoveScaleFromTransform();
 
diff --git a/src/cobalt/renderer/rasterizer/egl/draw_rect_border.cc b/src/cobalt/renderer/rasterizer/egl/draw_rect_border.cc
index 4951c14..33d5e8c 100644
--- a/src/cobalt/renderer/rasterizer/egl/draw_rect_border.cc
+++ b/src/cobalt/renderer/rasterizer/egl/draw_rect_border.cc
@@ -18,6 +18,7 @@
 
 #include "base/logging.h"
 #include "cobalt/math/insets_f.h"
+#include "cobalt/math/transform_2d.h"
 #include "cobalt/renderer/backend/egl/utils.h"
 #include "egl/generated_shader_impl.h"
 #include "starboard/memory.h"
@@ -151,7 +152,7 @@
     const render_tree::ColorRGBA& border_color,
     const render_tree::ColorRGBA& content_color) {
   // If the scaled border rect is too small, then don't bother rendering.
-  math::Vector2dF scale = GetScale();
+  math::Vector2dF scale = math::GetScale2d(base_state_.transform);
   if (border_rect.width() * scale.x() <