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() < 1.0f ||
       border_rect.height() * scale.y() < 1.0f) {
     return true;
diff --git a/src/cobalt/renderer/rasterizer/egl/hardware_rasterizer.cc b/src/cobalt/renderer/rasterizer/egl/hardware_rasterizer.cc
index 189a4fe..bb19f52 100644
--- a/src/cobalt/renderer/rasterizer/egl/hardware_rasterizer.cc
+++ b/src/cobalt/renderer/rasterizer/egl/hardware_rasterizer.cc
@@ -79,7 +79,7 @@
 
   void RasterizeTree(const scoped_refptr<render_tree::Node>& render_tree,
                      backend::RenderTargetEGL* render_target,
-                     const math::Rect& content_rect);
+                     const math::Rect& content_rect, bool clear_first);
 
   sk_sp<SkSurface> CreateFallbackSurface(
       bool force_deterministic_rendering,
@@ -157,14 +157,16 @@
 
   // Update only the dirty pixels if the render target contents are preserved
   // between frames.
+  bool clear_first = options.flags & Rasterizer::kSubmitFlags_Clear;
   math::Rect content_rect(render_target->GetSize());
-  if (options.dirty && render_target_egl->ContentWasPreservedAfterSwap()) {
+  if (!clear_first && options.dirty &&
+      render_target_egl->ContentWasPreservedAfterSwap()) {
     content_rect = *options.dirty;
   }
 
   offscreen_target_manager_->Update(render_target->GetSize());
 
-  RasterizeTree(render_tree, render_target_egl, content_rect);
+  RasterizeTree(render_tree, render_target_egl, content_rect, clear_first);
 
   graphics_context_->SwapBuffers(render_target_egl);
 
@@ -230,8 +232,8 @@
 
 void HardwareRasterizer::Impl::RasterizeTree(
     const scoped_refptr<render_tree::Node>& render_tree,
-    backend::RenderTargetEGL* render_target,
-    const math::Rect& content_rect) {
+    backend::RenderTargetEGL* render_target, const math::Rect& content_rect,
+    bool clear_first) {
   DrawObjectManager draw_object_manager(
       base::Bind(&HardwareRasterizer::Impl::ResetFallbackContextDuringFrame,
                  base::Unretained(this)),
@@ -270,7 +272,9 @@
                             render_target->GetSize().height());
   graphics_state_->Scissor(content_rect.x(), content_rect.y(),
                            content_rect.width(), content_rect.height());
-  graphics_state_->Clear();
+  if (clear_first) {
+    graphics_state_->Clear();
+  }
 
   {
     TRACE_EVENT0("cobalt::renderer", "OnscreenRasterize");
diff --git a/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.cc b/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.cc
index b8ae6ce..4a22a52 100644
--- a/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.cc
+++ b/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.cc
@@ -55,6 +55,16 @@
   return opacity >= 0.999f;
 }
 
+bool IsUniformSolidColor(const render_tree::Border& border) {
+  return border.left.style == render_tree::kBorderStyleSolid &&
+         border.right.style == render_tree::kBorderStyleSolid &&
+         border.top.style == render_tree::kBorderStyleSolid &&
+         border.bottom.style == render_tree::kBorderStyleSolid &&
+         border.left.color == border.right.color &&
+         border.top.color == border.bottom.color &&
+         border.left.color == border.top.color;
+}
+
 math::RectF RoundOut(const math::RectF& input, float pad) {
   float left = std::floor(input.x() - pad);
   float right = std::ceil(input.right() + pad);
@@ -84,7 +94,26 @@
   return false;
 }
 
-bool RoundedViewportSupportedForSource(render_tree::Node* source) {
+bool RoundedRectContainsRoundedRect(
+    const math::RectF& orect, const render_tree::RoundedCorners& ocorners,
+    const math::RectF& irect, const render_tree::RoundedCorners& icorners) {
+  // Just use a quick and simple comparison. This may return false negatives,
+  // but never return false positives.
+  return orect.Contains(irect) &&
+         ocorners.top_left.horizontal <= icorners.top_left.horizontal &&
+         ocorners.top_left.vertical <= icorners.top_left.vertical &&
+         ocorners.top_right.horizontal <= icorners.top_right.horizontal &&
+         ocorners.top_right.vertical <= icorners.top_right.vertical &&
+         ocorners.bottom_right.horizontal <= icorners.bottom_right.horizontal &&
+         ocorners.bottom_right.vertical <= icorners.bottom_right.vertical &&
+         ocorners.bottom_left.horizontal <= icorners.bottom_left.horizontal &&
+         ocorners.bottom_left.vertical <= icorners.bottom_left.vertical;
+}
+
+bool RoundedViewportSupportedForSource(
+    render_tree::Node* source,
+    math::Vector2dF offset,
+    const render_tree::ViewportFilter& filter) {
   base::TypeId source_type = source->GetTypeId();
   if (source_type == base::GetTypeId<render_tree::ImageNode>()) {
     render_tree::ImageNode* image_node =
@@ -97,14 +126,35 @@
         base::polymorphic_downcast<render_tree::CompositionNode*>(source);
     typedef render_tree::CompositionNode::Children Children;
     const Children& children = composition_node->data().children();
+    offset += composition_node->data().offset();
 
     for (Children::const_iterator iter = children.begin();
          iter != children.end(); ++iter) {
-      if (!RoundedViewportSupportedForSource(iter->get())) {
+      if (!RoundedViewportSupportedForSource(iter->get(), offset, filter)) {
         return false;
       }
     }
     return true;
+  } else if (source_type == base::GetTypeId<render_tree::FilterNode>()) {
+    const render_tree::FilterNode::Builder& filter_data =
+        base::polymorphic_downcast<render_tree::FilterNode*>(source)->data();
+    // If the inner rounded viewport filter is contained by the outer
+    // rounded viewport filter, then just render the inner filter.
+    if (filter_data.viewport_filter &&
+        filter_data.viewport_filter->has_rounded_corners() &&
+        !filter_data.opacity_filter &&
+        !filter_data.blur_filter &&
+        !filter_data.map_to_mesh_filter) {
+      math::RectF viewport_rect = filter_data.viewport_filter->viewport();
+      viewport_rect.Offset(offset);
+      return RoundedRectContainsRoundedRect(
+                 filter.viewport(), filter.rounded_corners(), viewport_rect,
+                 filter_data.viewport_filter->rounded_corners()) &&
+             RoundedViewportSupportedForSource(
+                 filter_data.source, math::Vector2dF(),
+                 *filter_data.viewport_filter);
+    }
+    return false;
   }
 
   return false;
@@ -164,6 +214,15 @@
   draw_state_.scissor.Intersect(content_rect);
 }
 
+void RenderTreeNodeVisitor::Visit(render_tree::ClearRectNode* clear_rect_node) {
+  if (!IsVisible(clear_rect_node->GetBounds())) {
+    return;
+  }
+
+  DCHECK_EQ(clear_rect_node->data().rect, clear_rect_node->GetBounds());
+  AddClear(clear_rect_node->data().rect, clear_rect_node->data().color);
+}
+
 void RenderTreeNodeVisitor::Visit(
     render_tree::CompositionNode* composition_node) {
   const render_tree::CompositionNode::Builder& data = composition_node->data();
@@ -212,13 +271,17 @@
     if (data.viewport_filter->has_rounded_corners()) {
       // Certain source nodes have an optimized path for rendering inside
       // rounded viewports.
-      if (RoundedViewportSupportedForSource(data.source)) {
-        DCHECK(!draw_state_.rounded_scissor_corners);
+      if (RoundedViewportSupportedForSource(
+          data.source, math::Vector2dF(), *data.viewport_filter)) {
+        math::RectF old_scissor_rect = draw_state_.rounded_scissor_rect;
+        DrawObject::OptionalRoundedCorners old_scissor_corners =
+            draw_state_.rounded_scissor_corners;
         draw_state_.rounded_scissor_rect = data.viewport_filter->viewport();
         draw_state_.rounded_scissor_corners =
             data.viewport_filter->rounded_corners();
         data.source->Accept(this);
-        draw_state_.rounded_scissor_corners = base::nullopt;
+        draw_state_.rounded_scissor_rect = old_scissor_rect;
+        draw_state_.rounded_scissor_corners = old_scissor_corners;
         return;
       }
     } else if (cobalt::math::IsOnlyScaleAndTranslate(transform)) {
@@ -437,9 +500,8 @@
   math::Rect mapped_rect = math::Rect::RoundFromRectF(mapped_rect_float);
   data.set_bounds_cb.Run(mapped_rect);
 
-  scoped_ptr<DrawObject> draw(new DrawPolyColor(graphics_state_,
-      draw_state_, data.rect, kTransparentBlack));
-  AddDraw(draw.Pass(), video_node->GetBounds(), DrawObjectManager::kBlendNone);
+  DCHECK_EQ(data.rect, video_node->GetBounds());
+  AddClear(data.rect, kTransparentBlack);
 }
 
 void RenderTreeNodeVisitor::Visit(render_tree::RectNode* rect_node) {
@@ -450,7 +512,13 @@
 
   const render_tree::RectNode::Builder& data = rect_node->data();
   const scoped_ptr<render_tree::Brush>& brush = data.background_brush;
+  base::optional<render_tree::RoundedCorners> content_corners;
   math::RectF content_rect(data.rect);
+  bool content_rect_drawn = false;
+
+  if (data.rounded_corners) {
+    content_corners = *data.rounded_corners;
+  }
 
   // Only solid color brushes are natively supported with rounded corners.
   if (data.rounded_corners && brush &&
@@ -461,16 +529,39 @@
 
   // Determine whether the RectNode's border attribute is supported. Update
   // the content and bounds if so.
-  scoped_ptr<DrawRectBorder> draw_border;
+  scoped_ptr<DrawObject> draw_border;
   if (data.border) {
-    draw_border.reset(new DrawRectBorder(graphics_state_, draw_state_,
-        rect_node));
-    if (draw_border->IsValid()) {
-      content_rect = draw_border->GetContentRect();
-      node_bounds = draw_border->GetBounds();
+    scoped_ptr<DrawRectBorder> rect_border(
+        new DrawRectBorder(graphics_state_, draw_state_, rect_node));
+    if (rect_border->IsValid()) {
+      node_bounds = rect_border->GetBounds();
+      content_rect = rect_border->GetContentRect();
+      content_rect_drawn = rect_border->DrawsContentRect();
+      draw_border.reset(rect_border.release());
+    } else if (data.rounded_corners) {
+      // Handle the special case of uniform rounded borders.
+      math::Vector2dF scale = math::GetScale2d(draw_state_.transform);
+      bool border_is_subpixel =
+          data.border->left.width * scale.x() < 1.0f ||
+          data.border->right.width * scale.x() < 1.0f ||
+          data.border->top.width * scale.y() < 1.0f ||
+          data.border->bottom.width * scale.y() < 1.0f;
+      if (IsUniformSolidColor(*data.border) && !border_is_subpixel) {
+        math::RectF border_rect(content_rect);
+        render_tree::RoundedCorners border_corners = *data.rounded_corners;
+        content_rect.Inset(data.border->left.width, data.border->top.width,
+            data.border->right.width, data.border->bottom.width);
+        content_corners = data.rounded_corners->Inset(data.border->left.width,
+            data.border->top.width, data.border->right.width,
+            data.border->bottom.width);
+        content_corners = content_corners->Normalize(content_rect);
+        draw_border.reset(new DrawRectShadowSpread(graphics_state_,
+            draw_state_, content_rect, content_corners,
+            border_rect, border_corners, data.border->top.color));
+      }
     }
   }
-  const bool border_supported = !data.border || draw_border->IsValid();
+  const bool border_supported = !data.border || draw_border;
 
   // Determine whether the RectNode's background brush is supported.
   base::TypeId brush_type = brush ? brush->GetTypeId() :
@@ -503,12 +594,10 @@
   }
 
   if (draw_border) {
-    bool content_rect_drawn = draw_border->DrawsContentRect();
-    AddDraw(draw_border.PassAs<DrawObject>(), node_bounds,
-            DrawObjectManager::kBlendSrcAlpha);
-    if (content_rect_drawn) {
-      return;
-    }
+    AddDraw(draw_border.Pass(), node_bounds, DrawObjectManager::kBlendSrcAlpha);
+  }
+  if (content_rect_drawn) {
+    return;
   }
 
   // Handle drawing the content.
@@ -516,10 +605,9 @@
     const render_tree::SolidColorBrush* solid_brush =
         base::polymorphic_downcast<const render_tree::SolidColorBrush*>
             (brush.get());
-    if (data.rounded_corners) {
+    if (content_corners) {
       scoped_ptr<DrawObject> draw(new DrawRRectColor(graphics_state_,
-          draw_state_, content_rect, *data.rounded_corners,
-          solid_brush->color()));
+          draw_state_, content_rect, *content_corners, solid_brush->color()));
       // Transparency is used for anti-aliasing.
       AddDraw(draw.Pass(), node_bounds, DrawObjectManager::kBlendSrcAlpha);
     } else {
@@ -886,6 +974,27 @@
   }
 }
 
+void RenderTreeNodeVisitor::AddClear(const math::RectF& rect,
+                                     const render_tree::ColorRGBA& color) {
+  // Check to see if we're simply trying to clear a non-transformed rectangle
+  // on the screen with no filters or effects applied, and if so, issue a
+  // clear command instead of a more general draw command, to give the GL
+  // driver a better chance to optimize.
+  if (!draw_state_.rounded_scissor_corners &&
+      draw_state_.transform.IsIdentity() && draw_state_.opacity == 1.0f) {
+    math::Rect old_scissor = draw_state_.scissor;
+    draw_state_.scissor.Intersect(math::Rect::RoundFromRectF(rect));
+    scoped_ptr<DrawObject> draw_clear(
+        new DrawClear(graphics_state_, draw_state_, color));
+    AddDraw(draw_clear.Pass(), rect, DrawObjectManager::kBlendNone);
+    draw_state_.scissor = old_scissor;
+  } else {
+    scoped_ptr<DrawObject> draw(
+        new DrawPolyColor(graphics_state_, draw_state_, rect, color));
+    AddDraw(draw.Pass(), rect, DrawObjectManager::kBlendNone);
+  }
+}
+
 }  // namespace egl
 }  // namespace rasterizer
 }  // namespace renderer
diff --git a/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.h b/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.h
index 9bd28a1..a8ec38d 100644
--- a/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.h
+++ b/src/cobalt/renderer/rasterizer/egl/render_tree_node_visitor.h
@@ -22,6 +22,7 @@
 #include "cobalt/math/matrix3_f.h"
 #include "cobalt/math/rect_f.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/image_node.h"
@@ -70,6 +71,7 @@
   void Visit(render_tree::animations::AnimateNode* /* animate */) override {
     NOTREACHED();
   }
+  void Visit(render_tree::ClearRectNode* clear_rect_node) override;
   void Visit(render_tree::CompositionNode* composition_node) override;
   void Visit(render_tree::MatrixTransform3DNode* transform_3d_node) override;
   void Visit(render_tree::MatrixTransformNode* transform_node) override;
@@ -104,6 +106,10 @@
   void AddExternalDraw(scoped_ptr<DrawObject> object,
                        const math::RectF& world_bounds, base::TypeId draw_type);
 
+  // Helper function to clear the specified |rect| with the specified |color|,
+  // with blending disabled.
+  void AddClear(const math::RectF& rect, const render_tree::ColorRGBA& color);
+
   GraphicsState* graphics_state_;
   DrawObjectManager* draw_object_manager_;
   OffscreenTargetManager* offscreen_target_manager_;
diff --git a/src/cobalt/renderer/rasterizer/egl/shaders/function_is_outside_rcorner.inc b/src/cobalt/renderer/rasterizer/egl/shaders/function_is_outside_rcorner.inc
index 5233ae9..027c5c2 100644
--- a/src/cobalt/renderer/rasterizer/egl/shaders/function_is_outside_rcorner.inc
+++ b/src/cobalt/renderer/rasterizer/egl/shaders/function_is_outside_rcorner.inc
@@ -22,15 +22,15 @@
   // Estimate the distance to an implicit function using

   //   dist = f(x,y) / length(gradient(f(x,y)))

   // For an ellipse, f(x,y) = x^2 / a^2 + y^2 / b^2 - 1.

-  vec2 scaled = max(rcorner.xy, 0.0);

-  float implicit = dot(scaled, scaled) - 1.0;

+  highp vec2 scaled = max(rcorner.xy, 0.0);

+  highp float implicit = dot(scaled, scaled) - 1.0;

 

   // NOTE: To accommodate large radius values using mediump floats, rcorner.zw

   //   was scaled by kRCornerGradientScale in the vertex attribute data.

   //   Multiply inv_gradient by kRCornerGradientScale to undo that scaling.

-  const float kRCornerGradientScale = 16.0;

-  vec2 gradient = 2.0 * scaled * rcorner.zw;

-  float inv_gradient = kRCornerGradientScale *

+  const highp float kRCornerGradientScale = 16.0;

+  highp vec2 gradient = 2.0 * scaled * rcorner.zw;

+  highp float inv_gradient = kRCornerGradientScale *

       inversesqrt(max(dot(gradient, gradient), 0.0001));

 

   return clamp(0.5 + implicit * inv_gradient, 0.0, 1.0);

diff --git a/src/cobalt/renderer/rasterizer/egl/textured_mesh_renderer.cc b/src/cobalt/renderer/rasterizer/egl/textured_mesh_renderer.cc
index c563200..0358c93 100644
--- a/src/cobalt/renderer/rasterizer/egl/textured_mesh_renderer.cc
+++ b/src/cobalt/renderer/rasterizer/egl/textured_mesh_renderer.cc
@@ -188,7 +188,7 @@
 
 void TexturedMeshRenderer::RenderQuad(const Image& image,
                                       const glm::mat4& mvp_transform) {
-  RenderVBO(GetQuadVBO(), 4, GL_TRIANGLE_STRIP, image, mvp_transform);
+  RenderVBO(GetQuadVBO(), 6, GL_TRIANGLES, image, mvp_transform);
 }
 
 uint32 TexturedMeshRenderer::GetQuadVBO() {
@@ -202,11 +202,10 @@
       float tex_coord_u;
       float tex_coord_v;
     };
-    const QuadVertex kBlitQuadVerts[4] = {
-        {-1.0f, -1.0f, 0.0f, 0.0f, 0.0f},
-        {1.0f, -1.0f, 0.0f, 1.0f, 0.0f},
-        {-1.0f, 1.0f, 0.0f, 0.0f, 1.0f},
-        {1.0f, 1.0, 0.0f, 1.0f, 1.0f},
+    const QuadVertex kBlitQuadVerts[6] = {
+        {-1.0f, -1.0f, 0.0f, 0.0f, 0.0f}, {1.0f, -1.0f, 0.0f, 1.0f, 0.0f},
+        {-1.0f, 1.0f, 0.0f, 0.0f, 1.0f},  {-1.0f, 1.0f, 0.0f, 0.0f, 1.0f},
+        {1.0f, -1.0f, 0.0f, 1.0f, 0.0f},  {1.0f, 1.0, 0.0f, 1.0f, 1.0f},
     };
 
     quad_vbo_ = 0;
diff --git a/src/cobalt/renderer/rasterizer/pixel_test.cc b/src/cobalt/renderer/rasterizer/pixel_test.cc
index 193baa0..d2f5546 100644
--- a/src/cobalt/renderer/rasterizer/pixel_test.cc
+++ b/src/cobalt/renderer/rasterizer/pixel_test.cc
@@ -23,6 +23,7 @@
 #include "cobalt/render_tree/blur_filter.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/composition_node.h"
 #include "cobalt/render_tree/filter_node.h"
@@ -76,6 +77,7 @@
 using cobalt::render_tree::Border;
 using cobalt::render_tree::BorderSide;
 using cobalt::render_tree::Brush;
+using cobalt::render_tree::ClearRectNode;
 using cobalt::render_tree::ColorRGBA;
 using cobalt::render_tree::ColorStop;
 using cobalt::render_tree::ColorStopList;
@@ -2470,6 +2472,41 @@
                         make_scoped_ptr(new RoundedCorners(rounded_corners))));
 }
 
+TEST_F(PixelTest, RoundedCornersEachDifferentThickBorderSolidBrush) {
+  RoundedCorners rounded_corners(
+      RoundedCorner(10.0f, 20.0f), RoundedCorner(20.0f, 30.0f),
+      RoundedCorner(30.0f, 40.0f), RoundedCorner(50.0f, 40.0f));
+  BorderSide border_side(
+      20.0f, render_tree::kBorderStyleSolid, ColorRGBA(1.0f, 0.0f, 0.5f, 1.0f));
+  scoped_ptr<Brush> content_brush(new SolidColorBrush(
+      ColorRGBA(0.0f, 1.0f, 0.0f, 1.0f)));
+  TestTree(new RectNode(
+      RectF(30, 30, 100, 100),
+      content_brush.Pass(),
+      make_scoped_ptr(new Border(border_side)),
+      make_scoped_ptr(new RoundedCorners(rounded_corners))));
+}
+
+TEST_F(PixelTest, RoundedCornersDifferentCornersDifferentThicknessSolidBrush) {
+  RoundedCorners rounded_corners(
+      RoundedCorner(10.0f, 20.0f), RoundedCorner(20.0f, 30.0f),
+      RoundedCorner(30.0f, 40.0f), RoundedCorner(50.0f, 40.0f));
+  BorderSide border_side_template(
+      0.0f, render_tree::kBorderStyleSolid, ColorRGBA(1.0f, 0.0f, 0.5f, 1.0f));
+  Border border(border_side_template);
+  border.left.width = 10.0f;
+  border.top.width = 15.0f;
+  border.right.width = 20.0f;
+  border.bottom.width = 25.0f;
+  scoped_ptr<Brush> content_brush(new SolidColorBrush(
+      ColorRGBA(0.0f, 1.0f, 0.0f, 1.0f)));
+  TestTree(new RectNode(
+      RectF(30, 30, 100, 100),
+      content_brush.Pass(),
+      make_scoped_ptr(new Border(border)),
+      make_scoped_ptr(new RoundedCorners(rounded_corners))));
+}
+
 TEST_F(PixelTest, RoundedCornersThickBlueBorder) {
   TestTree(new MatrixTransformNode(
       CreateRoundedBorderRect(ScaleSize(output_surface_size(), 0.5f, 0.5f),
@@ -3932,7 +3969,37 @@
 TEST_F(PixelTest, DrawNullImage) {
   // An ImageNode with no source is legal, though it should result in nothing
   // being drawn.
-  TestTree(new ImageNode(NULL, math::RectF(output_surface_size())));
+  TestTree(new ImageNode(nullptr, math::RectF(output_surface_size())));
+}
+
+TEST_F(PixelTest, ClearRectNodeTest) {
+  CompositionNode::Builder composition_node_builder;
+  composition_node_builder.AddChild(new RectNode(
+      RectF(output_surface_size()), scoped_ptr<Brush>(new SolidColorBrush(
+                                        ColorRGBA(1.0f, 0.0f, 0.0f, 1.0f)))));
+  RectF clear_rect(output_surface_size());
+  clear_rect.Inset(15, 15);
+  composition_node_builder.AddChild(
+      new ClearRectNode(clear_rect, ColorRGBA(0.0f, 0.0f, 0.0f, 0.0f)));
+
+  RectF inner_rect(clear_rect);
+  inner_rect.Inset(15, 15);
+  composition_node_builder.AddChild(new RectNode(
+      inner_rect, scoped_ptr<Brush>(
+                      new SolidColorBrush(ColorRGBA(0.0f, 1.0f, 0.0f, 0.5f)))));
+
+  RectF inner_clear_rect(inner_rect);
+  inner_clear_rect.Inset(15, 15);
+  composition_node_builder.AddChild(
+      new ClearRectNode(inner_clear_rect, ColorRGBA(0.0f, 0.0f, 1.0f, 0.75f)));
+
+  RectF inner_inner_rect(inner_clear_rect);
+  inner_inner_rect.Inset(15, 15);
+  composition_node_builder.AddChild(
+      new RectNode(inner_inner_rect, scoped_ptr<Brush>(new SolidColorBrush(
+                                         ColorRGBA(1.0f, 0.0f, 0.0f, 0.5f)))));
+
+  TestTree(new CompositionNode(composition_node_builder.Pass()));
 }
 
 }  // namespace rasterizer
diff --git a/src/cobalt/renderer/rasterizer/skia/render_tree_node_visitor.cc b/src/cobalt/renderer/rasterizer/skia/render_tree_node_visitor.cc
index 9dae26d..7ab19ee 100644
--- a/src/cobalt/renderer/rasterizer/skia/render_tree_node_visitor.cc
+++ b/src/cobalt/renderer/rasterizer/skia/render_tree_node_visitor.cc
@@ -110,8 +110,29 @@
   // bounding rectangle.
   return sk_child_bounds_absolute.intersect(canvas_bounds);
 }
+
+void DrawClearRect(SkCanvas* canvas, const math::RectF& rect,
+                   const render_tree::ColorRGBA& color) {
+  SkRect sk_rect =
+      SkRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect.height());
+
+  SkPaint paint;
+  paint.setBlendMode(SkBlendMode::kSrc);
+  paint.setARGB(color.a() * 255, color.r() * 255, color.g() * 255,
+                color.b() * 255);
+
+  canvas->drawRect(sk_rect, paint);
+}
 }  // namespace
 
+void RenderTreeNodeVisitor::Visit(render_tree::ClearRectNode* clear_rect_node) {
+#if ENABLE_RENDER_TREE_VISITOR_TRACING && !FILTER_RENDER_TREE_VISITOR_TRACING
+  TRACE_EVENT0("cobalt::renderer", "Visit(ClearRectNode)");
+#endif
+  DrawClearRect(draw_state_.render_target, clear_rect_node->data().rect,
+                clear_rect_node->data().color);
+}
+
 void RenderTreeNodeVisitor::Visit(
     render_tree::CompositionNode* composition_node) {
 #if ENABLE_RENDER_TREE_VISITOR_TRACING && !FILTER_RENDER_TREE_VISITOR_TRACING
@@ -735,11 +756,8 @@
   math::Rect transformed_rect = math::Rect::RoundFromRectF(transformed_rectf);
   punch_through_video_node->data().set_bounds_cb.Run(transformed_rect);
 
-  SkPaint paint;
-  paint.setBlendMode(SkBlendMode::kSrc);
-  paint.setARGB(0, 0, 0, 0);
-
-  draw_state_.render_target->drawRect(sk_rect, paint);
+  DrawClearRect(draw_state_.render_target, math_rect,
+                render_tree::ColorRGBA(0, 0, 0, 0));
 
 #if ENABLE_FLUSH_AFTER_EVERY_NODE
   draw_state_.render_target->flush();
diff --git a/src/cobalt/renderer/rasterizer/skia/render_tree_node_visitor.h b/src/cobalt/renderer/rasterizer/skia/render_tree_node_visitor.h
index bc81721..bedde9f 100644
--- a/src/cobalt/renderer/rasterizer/skia/render_tree_node_visitor.h
+++ b/src/cobalt/renderer/rasterizer/skia/render_tree_node_visitor.h
@@ -18,6 +18,7 @@
 #include "base/callback.h"
 #include "base/compiler_specific.h"
 #include "base/optional.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"
@@ -93,6 +94,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/testdata/ClearRectNodeTest-expected.png b/src/cobalt/renderer/rasterizer/testdata/ClearRectNodeTest-expected.png
new file mode 100644
index 0000000..d180775
--- /dev/null
+++ b/src/cobalt/renderer/rasterizer/testdata/ClearRectNodeTest-expected.png
Binary files differ
diff --git a/src/cobalt/renderer/rasterizer/testdata/RoundedCornersDifferentCornersDifferentThicknessSolidBrush-expected.png b/src/cobalt/renderer/rasterizer/testdata/RoundedCornersDifferentCornersDifferentThicknessSolidBrush-expected.png
new file mode 100644
index 0000000..c08aab1
--- /dev/null
+++ b/src/cobalt/renderer/rasterizer/testdata/RoundedCornersDifferentCornersDifferentThicknessSolidBrush-expected.png
Binary files differ
diff --git a/src/cobalt/renderer/rasterizer/testdata/RoundedCornersEachDifferentThickBorderSolidBrush-expected.png b/src/cobalt/renderer/rasterizer/testdata/RoundedCornersEachDifferentThickBorderSolidBrush-expected.png
new file mode 100644
index 0000000..14dd78f
--- /dev/null
+++ b/src/cobalt/renderer/rasterizer/testdata/RoundedCornersEachDifferentThickBorderSolidBrush-expected.png
Binary files differ
diff --git a/src/cobalt/script/array_buffer.h b/src/cobalt/script/array_buffer.h
index 1e00f6f..0476baf 100644
--- a/src/cobalt/script/array_buffer.h
+++ b/src/cobalt/script/array_buffer.h
@@ -16,6 +16,7 @@
 #define COBALT_SCRIPT_ARRAY_BUFFER_H_
 
 #include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
 #include "cobalt/script/exception_message.h"
 #include "cobalt/script/script_exception.h"
 #include "cobalt/script/script_value.h"
@@ -37,7 +38,7 @@
   // |byte_length|, and then copy |data| (which must be an allocation of size
   // |byte_length|) into the array buffer.
   static Handle<ArrayBuffer> New(GlobalEnvironment* global_environment,
-                                 void* data, size_t byte_length) {
+                                 const void* data, size_t byte_length) {
     Handle<ArrayBuffer> array_buffer = New(global_environment, byte_length);
     SbMemoryCopy(array_buffer->Data(), data, byte_length);
     return array_buffer;
@@ -46,7 +47,7 @@
   // Create a new |ArrayBuffer| from existing block of memory.  See
   // |PreallocatedArrayBufferData| for details.
   static Handle<ArrayBuffer> New(GlobalEnvironment* global_environment,
-                                 PreallocatedArrayBufferData* data);
+                                 scoped_ptr<PreallocatedArrayBufferData> data);
 
   virtual ~ArrayBuffer() {}
 
diff --git a/src/cobalt/script/array_buffer_view.h b/src/cobalt/script/array_buffer_view.h
index 6a4657e..50250ff 100644
--- a/src/cobalt/script/array_buffer_view.h
+++ b/src/cobalt/script/array_buffer_view.h
@@ -24,6 +24,11 @@
 // https://heycam.github.io/webidl/#ArrayBufferView
 class ArrayBufferView {
  public:
+  // This constructor is only used for the purpose of creating an empty class
+  // that has a valid ScriptValue*.
+  static Handle<ArrayBufferView> New(GlobalEnvironment* global_environment,
+                                     ArrayBufferView* copy_target);
+
   virtual ~ArrayBufferView() {}
 
   virtual Handle<ArrayBuffer> Buffer() const = 0;
diff --git a/src/cobalt/script/javascript_engine.h b/src/cobalt/script/javascript_engine.h
index 69a8f14..6dd06e5 100644
--- a/src/cobalt/script/javascript_engine.h
+++ b/src/cobalt/script/javascript_engine.h
@@ -58,6 +58,9 @@
       const Options& options = Options());
 
   // Create a new JavaScript global object proxy.
+  // Note that in order to use (as in execute code, or create/interact with
+  // JavaScript objects) the newly created GlobalEnvironment, you must call
+  // CreateGlobalObject() on it.
   virtual scoped_refptr<GlobalEnvironment> CreateGlobalEnvironment() = 0;
 
   // Kick off the engine's garbage collection synchronously.
diff --git a/src/cobalt/script/mozjs-45/conversion_helpers.h b/src/cobalt/script/mozjs-45/conversion_helpers.h
index e5e57a2..78cc1e1 100644
--- a/src/cobalt/script/mozjs-45/conversion_helpers.h
+++ b/src/cobalt/script/mozjs-45/conversion_helpers.h
@@ -27,9 +27,13 @@
 #include "cobalt/base/compiler.h"
 #include "cobalt/base/enable_if.h"
 #include "cobalt/base/token.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_interface_holder.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_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/type_traits.h"
@@ -707,6 +711,27 @@
   ToJSValue(context, handle.GetScriptValue(), out_value);
 }
 
+// script::Handle<JSValue> -> object
+template <typename T>
+inline void FromJSValue(JSContext* context, JS::HandleValue value,
+                        int conversion_flags, ExceptionState* exception_state,
+                        Handle<T>* out_object) {
+  DCHECK_EQ(conversion_flags & ~kConversionFlagsObject, 0)
+      << "Unexpected conversion flags found.";
+
+  if (value.isNullOrUndefined()) {
+    if (!(conversion_flags & kConversionFlagNullable)) {
+      exception_state->SetSimpleException(kNotNullableType);
+    }
+    return;
+  }
+
+  typename TypeTraits<T>::ConversionType temporary_holder;
+  FromJSValue(context, value, conversion_flags, exception_state,
+              &temporary_holder);
+  *out_object = std::move(Handle<T>(temporary_holder));
+}
+
 }  // namespace mozjs
 }  // namespace script
 }  // namespace cobalt
diff --git a/src/cobalt/script/mozjs-45/mozjs-45.gyp b/src/cobalt/script/mozjs-45/mozjs-45.gyp
index e0ea8ed..7c72598 100644
--- a/src/cobalt/script/mozjs-45/mozjs-45.gyp
+++ b/src/cobalt/script/mozjs-45/mozjs-45.gyp
@@ -25,6 +25,7 @@
         'interface_data.h',
         'mozjs_array_buffer.cc',
         'mozjs_array_buffer.h',
+        'mozjs_array_buffer_view.cc',
         'mozjs_array_buffer_view.h',
         'mozjs_callback_function.h',
         'mozjs_callback_interface.cc',
diff --git a/src/cobalt/script/mozjs-45/mozjs_array_buffer.cc b/src/cobalt/script/mozjs-45/mozjs_array_buffer.cc
index 0fc3e48..b7ec62f 100644
--- a/src/cobalt/script/mozjs-45/mozjs_array_buffer.cc
+++ b/src/cobalt/script/mozjs-45/mozjs_array_buffer.cc
@@ -54,8 +54,9 @@
 }
 
 // static
-Handle<ArrayBuffer> ArrayBuffer::New(GlobalEnvironment* global_environment,
-                                     PreallocatedArrayBufferData* data) {
+Handle<ArrayBuffer> ArrayBuffer::New(
+    GlobalEnvironment* global_environment,
+    scoped_ptr<PreallocatedArrayBufferData> data) {
   auto* mozjs_global_environment =
       base::polymorphic_downcast<mozjs::MozjsGlobalEnvironment*>(
           global_environment);
diff --git a/src/cobalt/script/mozjs-45/mozjs_array_buffer_view.cc b/src/cobalt/script/mozjs-45/mozjs_array_buffer_view.cc
new file mode 100644
index 0000000..e9b8def
--- /dev/null
+++ b/src/cobalt/script/mozjs-45/mozjs_array_buffer_view.cc
@@ -0,0 +1,40 @@
+// 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/script/mozjs-45/mozjs_array_buffer_view.h"
+
+#include "cobalt/base/polymorphic_downcast.h"
+
+namespace cobalt {
+namespace script {
+
+// static
+Handle<ArrayBufferView> ArrayBufferView::New(
+    GlobalEnvironment* global_environment, ArrayBufferView* copy_target) {
+  DCHECK(copy_target);
+  auto* mozjs_global_environment =
+      base::polymorphic_downcast<mozjs::MozjsGlobalEnvironment*>(
+          global_environment);
+  JSContext* context = mozjs_global_environment->context();
+  JSAutoRequest auto_request(context);
+  auto* mozjs_copy_target =
+      static_cast<mozjs::MozjsArrayBufferView*>(copy_target);
+  JS::RootedValue rooted_value(context, mozjs_copy_target->value());
+  return Handle<ArrayBufferView>(
+      new mozjs::MozjsUserObjectHolder<mozjs::MozjsArrayBufferView>(
+          context, rooted_value));
+}
+
+}  // namespace script
+}  // namespace cobalt
diff --git a/src/cobalt/script/mozjs-45/mozjs_array_buffer_view.h b/src/cobalt/script/mozjs-45/mozjs_array_buffer_view.h
index 1927d3a..4bf6b0e 100644
--- a/src/cobalt/script/mozjs-45/mozjs_array_buffer_view.h
+++ b/src/cobalt/script/mozjs-45/mozjs_array_buffer_view.h
@@ -17,6 +17,7 @@
 
 #include "base/logging.h"
 #include "cobalt/script/array_buffer_view.h"
+#include "cobalt/script/mozjs-45/mozjs_array_buffer.h"
 #include "cobalt/script/mozjs-45/mozjs_exception_state.h"
 #include "cobalt/script/mozjs-45/mozjs_user_object_holder.h"
 #include "cobalt/script/mozjs-45/type_traits.h"
diff --git a/src/cobalt/script/mozjs-45/mozjs_global_environment.cc b/src/cobalt/script/mozjs-45/mozjs_global_environment.cc
index fa7a127..1e301ad 100644
--- a/src/cobalt/script/mozjs-45/mozjs_global_environment.cc
+++ b/src/cobalt/script/mozjs-45/mozjs_global_environment.cc
@@ -288,6 +288,14 @@
   JS::CompileOptions options(context_);
   options.setFileAndLine(location.file_path.c_str(), location.line_number)
       .setMutedErrors(mozjs_source_code->is_muted());
+  // In addition to muting errors in the MozJS compile options, we also
+  // set a member indicating whether errors should be muted, and rely on the
+  // fact that errors will be handled on the same thread as this one.  This
+  // is necessary because the JSErrorReport passed to the error callback by
+  // SpiderMonkey doesn't always respect the muted errors setting of the
+  // compile options.
+  are_errors_muted_ = mozjs_source_code->is_muted();
+
   bool success =
       JS::Evaluate(context_, options, inflated_buffer, length, out_result);
   if (!success && context_->isExceptionPending()) {
@@ -295,6 +303,9 @@
   }
   js_free(inflated_buffer);
 
+  // Reset the mute variable.
+  are_errors_muted_ = false;
+
   return success;
 }
 
@@ -561,6 +572,7 @@
 
 void MozjsGlobalEnvironment::ReportError(const char* message,
                                          JSErrorReport* report) {
+  DCHECK(thread_checker_.CalledOnValidThread());
   JS::RootedValue exception(context_);
   ::JS_GetPendingException(context_, &exception);
 
@@ -586,7 +598,7 @@
   if (exception.isObject()) {
     error_report.error.reset(new MozjsValueHandleHolder(context_, exception));
   }
-  error_report.is_muted = report->isMuted;
+  error_report.is_muted = report->isMuted || are_errors_muted_;
 
   // If this isn't simply a warning, and the error wasn't caused by JS running
   // out of memory (in which case the callback will fail as well), then run
@@ -602,12 +614,13 @@
 
   // If the error is not handled, then the error may be reported to the user.
   //   https://www.w3.org/TR/html5/webappapis.html#runtime-script-errors-in-documents
+  std::string new_error_message = base::StringPrintf(
+      "%s:%u:%u: %s", error_report.filename.c_str(), error_report.line_number,
+      error_report.column_number, error_report.message.c_str());
   if (last_error_message_) {
-    *last_error_message_ = error_report.message;
+    *last_error_message_ = new_error_message;
   } else {
-    LOG(ERROR) << "JS Error: " << error_report.filename << ":"
-               << error_report.line_number << ":" << error_report.column_number
-               << ": " << error_report.message;
+    LOG(ERROR) << "JS Error: " << new_error_message;
   }
 }
 
diff --git a/src/cobalt/script/mozjs-45/mozjs_global_environment.h b/src/cobalt/script/mozjs-45/mozjs_global_environment.h
index b184ec0..6485ae7 100644
--- a/src/cobalt/script/mozjs-45/mozjs_global_environment.h
+++ b/src/cobalt/script/mozjs-45/mozjs_global_environment.h
@@ -212,6 +212,8 @@
   base::Closure report_eval_;
   ReportErrorCallback report_error_callback_;
 
+  bool are_errors_muted_ = false;
+
   friend class GlobalObjectProxy;
 };
 
diff --git a/src/cobalt/script/mozjs-45/union_type_conversion_impl.h b/src/cobalt/script/mozjs-45/union_type_conversion_impl.h
index 6ba61a9..af68ceb 100644
--- a/src/cobalt/script/mozjs-45/union_type_conversion_impl.h
+++ b/src/cobalt/script/mozjs-45/union_type_conversion_impl.h
@@ -218,7 +218,40 @@
     return;
   }
 
-  // 17. Throw a TypeError.
+  // 17. If |types| includes an ArrayBufferView type, then return the result of
+  //     converting |V| to ArrayBufferView type.
+  //     This step has to be before 18 to catch array_buffer_view types.
+  if (value.isObject() && JS_IsArrayBufferViewObject(&value.toObject())) {
+    if (UnionTypeTraitsT1::is_array_buffer_view_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t1);
+      *out_union = script::UnionType2<T1, T2>(t1);
+      return;
+    }
+
+    if (UnionTypeTraitsT2::is_array_buffer_view_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t2);
+      *out_union = script::UnionType2<T1, T2>(t2);
+      return;
+    }
+  }
+
+  // 18. If |types| includes any ScriptValue type, then return the result of
+  //     converting |V| to that ScriptValue type.
+  if (value.isObject() && JS_IsArrayBufferObject(&value.toObject())) {
+    if (UnionTypeTraitsT1::is_script_value_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t1);
+      *out_union = script::UnionType2<T1, T2>(t1);
+      return;
+    }
+
+    if (UnionTypeTraitsT2::is_script_value_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t2);
+      *out_union = script::UnionType2<T1, T2>(t2);
+      return;
+    }
+  }
+
+  // 19. Throw a TypeError.
   exception_state->SetSimpleException(kNotUnionType);
 }
 
@@ -457,7 +490,52 @@
     return;
   }
 
-  // 17. Throw a TypeError.
+  // 17. If |types| includes an ArrayBufferView type, then return the result of
+  //     converting |V| to ArrayBufferView type.
+  //     This step has to be before 18 to catch array_buffer_view types.
+  if (value.isObject() && JS_IsArrayBufferViewObject(&value.toObject())) {
+    if (UnionTypeTraitsT1::is_array_buffer_view_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t1);
+      *out_union = script::UnionType3<T1, T2, T3>(t1);
+      return;
+    }
+
+    if (UnionTypeTraitsT2::is_array_buffer_view_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t2);
+      *out_union = script::UnionType3<T1, T2, T3>(t2);
+      return;
+    }
+
+    if (UnionTypeTraitsT3::is_array_buffer_view_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t3);
+      *out_union = script::UnionType3<T1, T2, T3>(t3);
+      return;
+    }
+  }
+
+  // 18. If |types| includes any ScriptValue type, then return the result of
+  //     converting |V| to that ScriptValue type.
+  if (value.isObject() && JS_IsArrayBufferObject(&value.toObject())) {
+    if (UnionTypeTraitsT1::is_script_value_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t1);
+      *out_union = script::UnionType3<T1, T2, T3>(t1);
+      return;
+    }
+
+    if (UnionTypeTraitsT2::is_script_value_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t2);
+      *out_union = script::UnionType3<T1, T2, T3>(t2);
+      return;
+    }
+
+    if (UnionTypeTraitsT3::is_script_value_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t3);
+      *out_union = script::UnionType3<T1, T2, T3>(t3);
+      return;
+    }
+  }
+
+  // 19. Throw a TypeError.
   exception_state->SetSimpleException(kNotUnionType);
 }
 
@@ -746,7 +824,64 @@
     return;
   }
 
-  // 17. Throw a TypeError.
+  // 17. If |types| includes an ArrayBufferView type, then return the result of
+  //     converting |V| to ArrayBufferView type.
+  //     This step has to be before 18 to catch array_buffer_view types.
+  if (value.isObject() && JS_IsArrayBufferViewObject(&value.toObject())) {
+    if (UnionTypeTraitsT1::is_array_buffer_view_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t1);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t1);
+      return;
+    }
+
+    if (UnionTypeTraitsT2::is_array_buffer_view_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t2);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t2);
+      return;
+    }
+
+    if (UnionTypeTraitsT3::is_array_buffer_view_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t3);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t3);
+      return;
+    }
+
+    if (UnionTypeTraitsT4::is_array_buffer_view_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t4);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t4);
+      return;
+    }
+  }
+
+  // 18. If |types| includes any ScriptValue type, then return the result of
+  //     converting |V| to that ScriptValue type.
+  if (value.isObject() && JS_IsArrayBufferObject(&value.toObject())) {
+    if (UnionTypeTraitsT1::is_script_value_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t1);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t1);
+      return;
+    }
+
+    if (UnionTypeTraitsT2::is_script_value_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t2);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t2);
+      return;
+    }
+
+    if (UnionTypeTraitsT3::is_script_value_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t3);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t3);
+      return;
+    }
+
+    if (UnionTypeTraitsT4::is_script_value_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t4);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t4);
+      return;
+    }
+  }
+
+  // 19. Throw a TypeError.
   exception_state->SetSimpleException(kNotUnionType);
 }
 
diff --git a/src/cobalt/script/mozjs-45/union_type_conversion_impl.h.pump b/src/cobalt/script/mozjs-45/union_type_conversion_impl.h.pump
index 6b5dab9..73dd73a 100644
--- a/src/cobalt/script/mozjs-45/union_type_conversion_impl.h.pump
+++ b/src/cobalt/script/mozjs-45/union_type_conversion_impl.h.pump
@@ -218,7 +218,36 @@
 
 ]]
 
-  // 17. Throw a TypeError.
+  // 17. If |types| includes an ArrayBufferView type, then return the result of
+  //     converting |V| to ArrayBufferView type.
+  //     This step has to be before 18 to catch array_buffer_view types.
+  if (value.isObject() && JS_IsArrayBufferViewObject(&value.toObject())) {
+$for TYPE [[
+
+    if (UnionTypeTraitsT$(TYPE)::is_array_buffer_view_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t$(TYPE));
+      *out_union = script::UnionType$(NUM_MEMBERS)<$for TYPE , [[T$(TYPE)]]>(t$(TYPE));
+      return;
+    }
+
+]]
+  }
+
+  // 18. If |types| includes any ScriptValue type, then return the result of
+  //     converting |V| to that ScriptValue type.
+  if (value.isObject() && JS_IsArrayBufferObject(&value.toObject())) {
+$for TYPE [[
+
+    if (UnionTypeTraitsT$(TYPE)::is_script_value_type) {
+      FromJSValue(context, value, conversion_flags, exception_state, &t$(TYPE));
+      *out_union = script::UnionType$(NUM_MEMBERS)<$for TYPE , [[T$(TYPE)]]>(t$(TYPE));
+      return;
+    }
+
+]]
+  }
+
+  // 19. Throw a TypeError.
   exception_state->SetSimpleException(kNotUnionType);
 }
 
diff --git a/src/cobalt/script/script_value.h b/src/cobalt/script/script_value.h
index 2a9af9d..5648c5e 100644
--- a/src/cobalt/script/script_value.h
+++ b/src/cobalt/script/script_value.h
@@ -60,14 +60,14 @@
    public:
     Reference(Wrappable* wrappable, const ScriptValue& script_value)
         : owner_(wrappable), referenced_value_(script_value.MakeCopy()) {
-      DCHECK(referenced_value_);
+      DCHECK(!referenced_value_->IsNull());
       referenced_value_->RegisterOwner(owner_);
     }
 
     Reference(Wrappable* wrappable, const Handle<T>& local)
         : owner_(wrappable),
           referenced_value_(local.GetScriptValue()->MakeCopy()) {
-      DCHECK(referenced_value_);
+      DCHECK(!referenced_value_->IsNull());
       referenced_value_->RegisterOwner(owner_);
     }
 
@@ -167,6 +167,9 @@
     script_value_->PreventGarbageCollection();
     script_value_->reference_count_++;
   }
+  // We need the default constructor for nullable ScriptValue.
+  Handle() = default;
+
   Handle& operator=(const Handle& other) {
     // Increment |other|'s value first to allow for self assignment.
     if (other.script_value_) {
@@ -186,18 +189,18 @@
     return *this;
   }
 
+  bool IsEmpty() const { return script_value_ == nullptr; }
+
   ~Handle() { Clear(); }
 
   T* operator*() { return script_value_->GetValue(); }
-  T* operator->() { return script_value_->GetValue(); }
+  T* operator->() const { return script_value_->GetValue(); }
 
   // These are primarly exposed for internals.  In most cases you don't need
   // to work with the ScriptValue directly.
   ScriptValue<T>* GetScriptValue() { return script_value_; }
   const ScriptValue<T>* GetScriptValue() const { return script_value_; }
 
-  bool IsEmpty() const { return script_value_ == nullptr; }
-
  private:
   void Clear() {
     if (script_value_) {
@@ -210,7 +213,7 @@
     script_value_ = nullptr;
   }
 
-  ScriptValue<T>* script_value_;
+  ScriptValue<T>* script_value_ = nullptr;
 };
 
 }  // namespace script
diff --git a/src/cobalt/script/script_value_factory.h b/src/cobalt/script/script_value_factory.h
index 06f09ec..f8a0da0 100644
--- a/src/cobalt/script/script_value_factory.h
+++ b/src/cobalt/script/script_value_factory.h
@@ -16,9 +16,9 @@
 #define COBALT_SCRIPT_SCRIPT_VALUE_FACTORY_H_
 
 #include "base/memory/scoped_ptr.h"
+#include "cobalt/script/array_buffer.h"
 #include "cobalt/script/promise.h"
 #include "cobalt/script/script_value.h"
-
 namespace cobalt {
 namespace script {
 
diff --git a/src/cobalt/script/typed_arrays.h b/src/cobalt/script/typed_arrays.h
index e77b985..663fdee 100644
--- a/src/cobalt/script/typed_arrays.h
+++ b/src/cobalt/script/typed_arrays.h
@@ -44,6 +44,15 @@
     return New(global_environment, array_buffer, 0, length);
   }
 
+  // Custom constructor that will not be exposed. It constructs a new empty
+  // ArrayBuffer along with the new typed array.
+  static Handle<TypedArrayImpl> New(GlobalEnvironment* global_environment,
+                                    const void* data, size_t length) {
+    Handle<ArrayBuffer> array_buffer =
+        ArrayBuffer::New(global_environment, data, length * sizeof(CType));
+    return New(global_environment, array_buffer, 0, length);
+  }
+
   virtual CType* Data() const = 0;
 };
 
diff --git a/src/cobalt/script/union_type_internal.h b/src/cobalt/script/union_type_internal.h
index c22e7e9..673030b 100644
--- a/src/cobalt/script/union_type_internal.h
+++ b/src/cobalt/script/union_type_internal.h
@@ -24,6 +24,7 @@
 #include "base/optional.h"
 #include "cobalt/base/enable_if.h"
 #include "cobalt/base/type_id.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/sequence.h"
 
 namespace cobalt {
@@ -41,6 +42,10 @@
   static const bool is_numeric_type = false;
   static const bool is_sequence_type = false;
   static const bool is_string_type = false;
+  // e.g. ScriptValue<Uint8Array>* needs to be casted to
+  // ScriptValue<ArrayBufferView>* manually.
+  static const bool is_array_buffer_view_type = false;
+  static const bool is_script_value_type = false;
 };
 
 // Default traits for types with no specialization
@@ -58,6 +63,18 @@
 };
 
 template <>
+struct UnionTypeTraits<Handle<ArrayBufferView>>
+    : UnionTypeDefaultTraits<Handle<ArrayBufferView>> {
+  static const bool is_array_buffer_view_type = true;
+};
+
+// script::Handle is always used to hold ScriptValues.
+template <typename T>
+struct UnionTypeTraits<Handle<T>> : UnionTypeDefaultTraits<Handle<T>> {
+  static const bool is_script_value_type = true;
+};
+
+template <>
 struct UnionTypeTraits<std::string> : UnionTypeDefaultTraits<std::string> {
   static const bool is_string_type = true;
 };
diff --git a/src/cobalt/script/v8c/conversion_helpers.h b/src/cobalt/script/v8c/conversion_helpers.h
index 004e573..d1e1ca4 100644
--- a/src/cobalt/script/v8c/conversion_helpers.h
+++ b/src/cobalt/script/v8c/conversion_helpers.h
@@ -34,8 +34,12 @@
 #include "cobalt/script/v8c/helpers.h"
 #include "cobalt/script/v8c/type_traits.h"
 #include "cobalt/script/v8c/union_type_conversion_forward.h"
+#include "cobalt/script/v8c/v8c_array_buffer.h"
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
 #include "cobalt/script/v8c/v8c_callback_interface_holder.h"
+#include "cobalt/script/v8c/v8c_data_view.h"
 #include "cobalt/script/v8c/v8c_global_environment.h"
+#include "cobalt/script/v8c/v8c_typed_arrays.h"
 #include "cobalt/script/v8c/v8c_user_object_holder.h"
 #include "cobalt/script/v8c/v8c_value_handle.h"
 #include "cobalt/script/value_handle.h"
@@ -708,6 +712,27 @@
   ToJSValue(isolate, local.GetScriptValue(), out_value);
 }
 
+// script::Handle<JSValue> -> object
+template <typename T>
+inline void FromJSValue(v8::Isolate* isolate, v8::Local<v8::Value> value,
+                        int conversion_flags, ExceptionState* exception_state,
+                        Handle<T>* out_object) {
+  DCHECK_EQ(conversion_flags & ~kConversionFlagsObject, 0)
+      << "Unexpected conversion flags found.";
+
+  if (value->IsNullOrUndefined()) {
+    if (!(conversion_flags & kConversionFlagNullable)) {
+      exception_state->SetSimpleException(kNotNullableType);
+    }
+    return;
+  }
+
+  typename TypeTraits<T>::ConversionType temporary_holder;
+  FromJSValue(isolate, value, conversion_flags, exception_state,
+              &temporary_holder);
+  *out_object = std::move(Handle<T>(temporary_holder));
+}
+
 }  // namespace v8c
 }  // namespace script
 }  // namespace cobalt
diff --git a/src/cobalt/script/v8c/union_type_conversion_impl.h b/src/cobalt/script/v8c/union_type_conversion_impl.h
index 8446e0a..9f0efea 100644
--- a/src/cobalt/script/v8c/union_type_conversion_impl.h
+++ b/src/cobalt/script/v8c/union_type_conversion_impl.h
@@ -56,8 +56,8 @@
   // JS -> IDL type conversion procedure described here:
   // http://heycam.github.io/webidl/#es-union
 
-  // TODO: Support Date, RegExp, DOMException, Error, ArrayBuffer, DataView,
-  //       TypedArrayName, callback functions, dictionary.
+  // TODO: Support Date, RegExp, DOMException, Error, callback functions,
+  // dictionary.
 
   // 1. If the union type includes a nullable type and |V| is null or undefined,
   // then return the IDL value null.
@@ -214,7 +214,40 @@
     return;
   }
 
-  // 17. Throw a TypeError.
+  // 17. If |types| includes an ArrayBufferView type, then return the result of
+  //     converting |V| to ArrayBufferView type.
+  //     This step has to be before 18 to catch array_buffer_view types.
+  if (value->IsArrayBufferView()) {
+    if (UnionTypeTraitsT1::is_array_buffer_view_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t1);
+      *out_union = script::UnionType2<T1, T2>(t1);
+      return;
+    }
+
+    if (UnionTypeTraitsT2::is_array_buffer_view_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t2);
+      *out_union = script::UnionType2<T1, T2>(t2);
+      return;
+    }
+  }
+
+  // 17. If |types| includes any ScriptValue type, then return the result of
+  //     converting |V| to that ScriptValue type.
+  if (value->IsArrayBuffer()) {
+    if (UnionTypeTraitsT1::is_script_value_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t1);
+      *out_union = script::UnionType2<T1, T2>(t1);
+      return;
+    }
+
+    if (UnionTypeTraitsT2::is_script_value_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t2);
+      *out_union = script::UnionType2<T1, T2>(t2);
+      return;
+    }
+  }
+
+  // 19. Throw a TypeError.
   exception_state->SetSimpleException(kNotUnionType);
 }
 
@@ -246,8 +279,8 @@
   // JS -> IDL type conversion procedure described here:
   // http://heycam.github.io/webidl/#es-union
 
-  // TODO: Support Date, RegExp, DOMException, Error, ArrayBuffer, DataView,
-  //       TypedArrayName, callback functions, dictionary.
+  // TODO: Support Date, RegExp, DOMException, Error, callback functions,
+  // dictionary.
 
   // 1. If the union type includes a nullable type and |V| is null or undefined,
   // then return the IDL value null.
@@ -450,7 +483,52 @@
     return;
   }
 
-  // 17. Throw a TypeError.
+  // 17. If |types| includes an ArrayBufferView type, then return the result of
+  //     converting |V| to ArrayBufferView type.
+  //     This step has to be before 18 to catch array_buffer_view types.
+  if (value->IsArrayBufferView()) {
+    if (UnionTypeTraitsT1::is_array_buffer_view_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t1);
+      *out_union = script::UnionType3<T1, T2, T3>(t1);
+      return;
+    }
+
+    if (UnionTypeTraitsT2::is_array_buffer_view_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t2);
+      *out_union = script::UnionType3<T1, T2, T3>(t2);
+      return;
+    }
+
+    if (UnionTypeTraitsT3::is_array_buffer_view_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t3);
+      *out_union = script::UnionType3<T1, T2, T3>(t3);
+      return;
+    }
+  }
+
+  // 17. If |types| includes any ScriptValue type, then return the result of
+  //     converting |V| to that ScriptValue type.
+  if (value->IsArrayBuffer()) {
+    if (UnionTypeTraitsT1::is_script_value_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t1);
+      *out_union = script::UnionType3<T1, T2, T3>(t1);
+      return;
+    }
+
+    if (UnionTypeTraitsT2::is_script_value_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t2);
+      *out_union = script::UnionType3<T1, T2, T3>(t2);
+      return;
+    }
+
+    if (UnionTypeTraitsT3::is_script_value_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t3);
+      *out_union = script::UnionType3<T1, T2, T3>(t3);
+      return;
+    }
+  }
+
+  // 19. Throw a TypeError.
   exception_state->SetSimpleException(kNotUnionType);
 }
 
@@ -486,8 +564,8 @@
   // JS -> IDL type conversion procedure described here:
   // http://heycam.github.io/webidl/#es-union
 
-  // TODO: Support Date, RegExp, DOMException, Error, ArrayBuffer, DataView,
-  //       TypedArrayName, callback functions, dictionary.
+  // TODO: Support Date, RegExp, DOMException, Error, callback functions,
+  // dictionary.
 
   // 1. If the union type includes a nullable type and |V| is null or undefined,
   // then return the IDL value null.
@@ -736,7 +814,64 @@
     return;
   }
 
-  // 17. Throw a TypeError.
+  // 17. If |types| includes an ArrayBufferView type, then return the result of
+  //     converting |V| to ArrayBufferView type.
+  //     This step has to be before 18 to catch array_buffer_view types.
+  if (value->IsArrayBufferView()) {
+    if (UnionTypeTraitsT1::is_array_buffer_view_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t1);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t1);
+      return;
+    }
+
+    if (UnionTypeTraitsT2::is_array_buffer_view_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t2);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t2);
+      return;
+    }
+
+    if (UnionTypeTraitsT3::is_array_buffer_view_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t3);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t3);
+      return;
+    }
+
+    if (UnionTypeTraitsT4::is_array_buffer_view_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t4);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t4);
+      return;
+    }
+  }
+
+  // 17. If |types| includes any ScriptValue type, then return the result of
+  //     converting |V| to that ScriptValue type.
+  if (value->IsArrayBuffer()) {
+    if (UnionTypeTraitsT1::is_script_value_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t1);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t1);
+      return;
+    }
+
+    if (UnionTypeTraitsT2::is_script_value_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t2);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t2);
+      return;
+    }
+
+    if (UnionTypeTraitsT3::is_script_value_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t3);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t3);
+      return;
+    }
+
+    if (UnionTypeTraitsT4::is_script_value_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t4);
+      *out_union = script::UnionType4<T1, T2, T3, T4>(t4);
+      return;
+    }
+  }
+
+  // 19. Throw a TypeError.
   exception_state->SetSimpleException(kNotUnionType);
 }
 
diff --git a/src/cobalt/script/v8c/union_type_conversion_impl.h.pump b/src/cobalt/script/v8c/union_type_conversion_impl.h.pump
index 71b0ffd..3e9750e 100644
--- a/src/cobalt/script/v8c/union_type_conversion_impl.h.pump
+++ b/src/cobalt/script/v8c/union_type_conversion_impl.h.pump
@@ -68,8 +68,8 @@
   // JS -> IDL type conversion procedure described here:
   // http://heycam.github.io/webidl/#es-union
 
-  // TODO: Support Date, RegExp, DOMException, Error, ArrayBuffer, DataView,
-  //       TypedArrayName, callback functions, dictionary.
+  // TODO: Support Date, RegExp, DOMException, Error, callback functions,
+  // dictionary.
 
   // 1. If the union type includes a nullable type and |V| is null or undefined,
   // then return the IDL value null.
@@ -214,7 +214,36 @@
 
 ]]
 
-  // 17. Throw a TypeError.
+  // 17. If |types| includes an ArrayBufferView type, then return the result of
+  //     converting |V| to ArrayBufferView type.
+  //     This step has to be before 18 to catch array_buffer_view types.
+  if (value->IsArrayBufferView()) {
+$for TYPE [[
+
+    if (UnionTypeTraitsT$(TYPE)::is_array_buffer_view_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t$(TYPE));
+      *out_union = script::UnionType$(NUM_MEMBERS)<$for TYPE , [[T$(TYPE)]]>(t$(TYPE));
+      return;
+    }
+
+]]
+  }
+
+  // 18. If |types| includes any ScriptValue type, then return the result of
+  //     converting |V| to that ScriptValue type.
+  if (value->IsArrayBuffer()) {
+$for TYPE [[
+
+    if (UnionTypeTraitsT$(TYPE)::is_script_value_type) {
+      FromJSValue(isolate, value, conversion_flags, exception_state, &t$(TYPE));
+      *out_union = script::UnionType$(NUM_MEMBERS)<$for TYPE , [[T$(TYPE)]]>(t$(TYPE));
+      return;
+    }
+
+]]
+  }
+
+  // 19. Throw a TypeError.
   exception_state->SetSimpleException(kNotUnionType);
 }
 
diff --git a/src/cobalt/script/v8c/v8c.gyp b/src/cobalt/script/v8c/v8c.gyp
index 6493718..5acb352 100644
--- a/src/cobalt/script/v8c/v8c.gyp
+++ b/src/cobalt/script/v8c/v8c.gyp
@@ -35,6 +35,7 @@
         'union_type_conversion_impl.h',
         'v8c_array_buffer.cc',
         'v8c_array_buffer.h',
+        'v8c_array_buffer_view.cc',
         'v8c_array_buffer_view.h',
         'v8c_callback_function.h',
         'v8c_callback_interface.cc',
diff --git a/src/cobalt/script/v8c/v8c_array_buffer.cc b/src/cobalt/script/v8c/v8c_array_buffer.cc
index 9e00afc..5f639f9 100644
--- a/src/cobalt/script/v8c/v8c_array_buffer.cc
+++ b/src/cobalt/script/v8c/v8c_array_buffer.cc
@@ -47,8 +47,9 @@
 }
 
 // static
-Handle<ArrayBuffer> ArrayBuffer::New(GlobalEnvironment* global_environment,
-                                     PreallocatedArrayBufferData* data) {
+Handle<ArrayBuffer> ArrayBuffer::New(
+    GlobalEnvironment* global_environment,
+    scoped_ptr<PreallocatedArrayBufferData> data) {
   auto* v8c_global_environment =
       base::polymorphic_downcast<v8c::V8cGlobalEnvironment*>(
           global_environment);
diff --git a/src/cobalt/script/v8c/v8c_array_buffer.h b/src/cobalt/script/v8c/v8c_array_buffer.h
index a878ef7..7f1cde0 100644
--- a/src/cobalt/script/v8c/v8c_array_buffer.h
+++ b/src/cobalt/script/v8c/v8c_array_buffer.h
@@ -33,6 +33,8 @@
  public:
   using BaseType = ArrayBuffer;
 
+  V8cArrayBuffer() = default;
+
   V8cArrayBuffer(v8::Isolate* isolate, v8::Local<v8::Value> value)
       : isolate_(isolate), ScopedPersistent(isolate, value) {
     DCHECK(value->IsArrayBuffer());
@@ -93,7 +95,8 @@
     return;
   }
 
-  *out_array_buffer = V8cUserObjectHolder<V8cArrayBuffer>(isolate, value);
+  *out_array_buffer =
+      std::move(V8cUserObjectHolder<V8cArrayBuffer>(isolate, value));
 }
 
 }  // namespace v8c
diff --git a/src/cobalt/script/v8c/v8c_array_buffer_view.cc b/src/cobalt/script/v8c/v8c_array_buffer_view.cc
new file mode 100644
index 0000000..e25ab16
--- /dev/null
+++ b/src/cobalt/script/v8c/v8c_array_buffer_view.cc
@@ -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.
+
+#include "cobalt/script/v8c/v8c_array_buffer_view.h"
+
+#include "cobalt/base/polymorphic_downcast.h"
+
+namespace cobalt {
+namespace script {
+
+// static
+Handle<ArrayBufferView> ArrayBufferView::New(
+    GlobalEnvironment* global_environment, ArrayBufferView* copy_target) {
+  auto* v8c_global_environment =
+      base::polymorphic_downcast<v8c::V8cGlobalEnvironment*>(
+          global_environment);
+  v8::Isolate* isolate = v8c_global_environment->isolate();
+  v8c::EntryScope entry_scope(isolate);
+  auto* v8c_copy_target = static_cast<v8c::V8cArrayBufferView*>(copy_target);
+  return Handle<ArrayBufferView>(
+      new v8c::V8cUserObjectHolder<v8c::V8cArrayBufferView>(
+          isolate, v8c_copy_target->NewLocal(isolate)));
+}
+
+}  // namespace script
+}  // namespace cobalt
diff --git a/src/cobalt/script/v8c/v8c_array_buffer_view.h b/src/cobalt/script/v8c/v8c_array_buffer_view.h
index 207b4c9..1599e78 100644
--- a/src/cobalt/script/v8c/v8c_array_buffer_view.h
+++ b/src/cobalt/script/v8c/v8c_array_buffer_view.h
@@ -18,6 +18,7 @@
 #include "base/logging.h"
 #include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/v8c/entry_scope.h"
+#include "cobalt/script/v8c/scoped_persistent.h"
 #include "cobalt/script/v8c/type_traits.h"
 #include "cobalt/script/v8c/v8c_array_buffer.h"
 #include "cobalt/script/v8c/v8c_exception_state.h"
@@ -32,6 +33,8 @@
  public:
   using BaseType = ArrayBufferView;
 
+  // Default constructor should only be used by bindings code.
+  V8cArrayBufferView() = default;
   V8cArrayBufferView(v8::Isolate* isolate, v8::Local<v8::Value> value)
       : isolate_(isolate), ScopedPersistent(isolate, value) {
     DCHECK(value->IsArrayBufferView());
@@ -109,7 +112,7 @@
   }
 
   *out_array_buffer_view =
-      V8cUserObjectHolder<V8cArrayBufferView>(isolate, value);
+      std::move(V8cUserObjectHolder<V8cArrayBufferView>(isolate, value));
 }
 
 }  // namespace v8c
diff --git a/src/cobalt/script/v8c/v8c_data_view.h b/src/cobalt/script/v8c/v8c_data_view.h
index 896b83ed..ca7e377d 100644
--- a/src/cobalt/script/v8c/v8c_data_view.h
+++ b/src/cobalt/script/v8c/v8c_data_view.h
@@ -32,6 +32,8 @@
  public:
   using BaseType = DataView;
 
+  // Default constructor should only be used by bindings code.
+  V8cDataView() = default;
   V8cDataView(v8::Isolate* isolate, v8::Local<v8::Value> value)
       : isolate_(isolate), ScopedPersistent(isolate, value) {
     DCHECK(value->IsDataView());
@@ -108,7 +110,8 @@
     return;
   }
 
-  *out_array_buffer_view = V8cUserObjectHolder<V8cDataView>(isolate, value);
+  *out_array_buffer_view =
+      std::move(V8cUserObjectHolder<V8cDataView>(isolate, value));
 }
 
 }  // namespace v8c
diff --git a/src/cobalt/script/v8c/v8c_global_environment.cc b/src/cobalt/script/v8c/v8c_global_environment.cc
index c8d4f49..2199a05 100644
--- a/src/cobalt/script/v8c/v8c_global_environment.cc
+++ b/src/cobalt/script/v8c/v8c_global_environment.cc
@@ -414,7 +414,7 @@
       /*resource_column_offset=*/
       v8::Integer::New(isolate_, source_location.column_number - 1),
       /*resource_is_shared_cross_origin=*/
-      v8::Boolean::New(isolate_, !v8c_source_code->is_muted()));
+      v8::Boolean::New(isolate_, v8c_source_code->is_muted()));
 
   v8::Local<v8::String> source;
   if (!v8::String::NewFromUtf8(isolate_, v8c_source_code->source_utf8().c_str(),
diff --git a/src/cobalt/script/v8c/v8c_typed_arrays.h b/src/cobalt/script/v8c/v8c_typed_arrays.h
index b0d3496..3222ac2 100644
--- a/src/cobalt/script/v8c/v8c_typed_arrays.h
+++ b/src/cobalt/script/v8c/v8c_typed_arrays.h
@@ -34,6 +34,8 @@
  public:
   using BaseType = TypedArray;
 
+  // Default constructor should only be used by bindings code.
+  V8cTypedArray() = default;
   V8cTypedArray(v8::Isolate* isolate, v8::Local<v8::Value> value)
       : isolate_(isolate), ScopedPersistent(isolate, value) {
     DCHECK(value->IsTypedArray());
@@ -113,8 +115,8 @@
     return;
   }
 
-  *out_typed_array =
-      V8cUserObjectHolder<V8cTypedArray>(isolate, value.As<v8::TypedArray>());
+  *out_typed_array = std::move(
+      V8cUserObjectHolder<V8cTypedArray>(isolate, value.As<v8::TypedArray>()));
 }
 
 template <typename CType, typename BaseTypeName, typename V8Type,
@@ -124,6 +126,8 @@
  public:
   using BaseType = BaseTypeName;
 
+  // Default constructor should only be used by bindings code.
+  V8cTypedArrayImpl() = default;
   V8cTypedArrayImpl(v8::Isolate* isolate, v8::Local<v8::Value> value)
       : isolate_(isolate), ScopedPersistent(isolate, value) {
     DCHECK(((**value).*(V8ValueIsTypeFunction))());
@@ -174,42 +178,42 @@
 COBALT_SCRIPT_TYPED_ARRAY_LIST(COBALT_SCRIPT_USING_V8C_ARRAY)
 #undef COBALT_SCRIPT_USING_V8C_ARRAY
 
-#define COBALT_SCRIPT_CONVERSION_BOILERPLATE(array, ctype)                  \
-  template <>                                                               \
-  struct TypeTraits<array> {                                                \
-    using ConversionType = V8cUserObjectHolder<V8c##array>;                 \
-    using ReturnType = const ScriptValue<array>*;                           \
-  };                                                                        \
-                                                                            \
-  inline void ToJSValue(v8::Isolate* isolate,                               \
-                        const ScriptValue<array>* array_value,              \
-                        v8::Local<v8::Value>* out_value) {                  \
-    if (!array_value) {                                                     \
-      *out_value = v8::Null(isolate);                                       \
-      return;                                                               \
-    }                                                                       \
-    const auto* v8c_array_value =                                           \
-        base::polymorphic_downcast<const V8cUserObjectHolder<V8c##array>*>( \
-            array_value);                                                   \
-    *out_value = v8c_array_value->v8_value();                               \
-  }                                                                         \
-                                                                            \
-  inline void FromJSValue(v8::Isolate* isolate, v8::Local<v8::Value> value, \
-                          int conversion_flags,                             \
-                          ExceptionState* exception_state,                  \
-                          V8cUserObjectHolder<V8c##array>* out_array) {     \
-    DCHECK_EQ(0, conversion_flags);                                         \
-    DCHECK(out_array);                                                      \
-    if (!value->IsObject()) {                                               \
-      exception_state->SetSimpleException(kNotObjectType);                  \
-      return;                                                               \
-    }                                                                       \
-    if (!value->Is##array()) {                                              \
-      exception_state->SetSimpleException(kTypeError,                       \
-                                          "Expected object of type array"); \
-      return;                                                               \
-    }                                                                       \
-    *out_array = V8cUserObjectHolder<V8c##array>(isolate, value);           \
+#define COBALT_SCRIPT_CONVERSION_BOILERPLATE(array, ctype)                   \
+  template <>                                                                \
+  struct TypeTraits<array> {                                                 \
+    using ConversionType = V8cUserObjectHolder<V8c##array>;                  \
+    using ReturnType = const ScriptValue<array>*;                            \
+  };                                                                         \
+                                                                             \
+  inline void ToJSValue(v8::Isolate* isolate,                                \
+                        const ScriptValue<array>* array_value,               \
+                        v8::Local<v8::Value>* out_value) {                   \
+    if (!array_value) {                                                      \
+      *out_value = v8::Null(isolate);                                        \
+      return;                                                                \
+    }                                                                        \
+    const auto* v8c_array_value =                                            \
+        base::polymorphic_downcast<const V8cUserObjectHolder<V8c##array>*>(  \
+            array_value);                                                    \
+    *out_value = v8c_array_value->v8_value();                                \
+  }                                                                          \
+                                                                             \
+  inline void FromJSValue(v8::Isolate* isolate, v8::Local<v8::Value> value,  \
+                          int conversion_flags,                              \
+                          ExceptionState* exception_state,                   \
+                          V8cUserObjectHolder<V8c##array>* out_array) {      \
+    DCHECK_EQ(0, conversion_flags);                                          \
+    DCHECK(out_array);                                                       \
+    if (!value->IsObject()) {                                                \
+      exception_state->SetSimpleException(kNotObjectType);                   \
+      return;                                                                \
+    }                                                                        \
+    if (!value->Is##array()) {                                               \
+      exception_state->SetSimpleException(kTypeError,                        \
+                                          "Expected object of type array");  \
+      return;                                                                \
+    }                                                                        \
+    *out_array = std::move(V8cUserObjectHolder<V8c##array>(isolate, value)); \
   }
 COBALT_SCRIPT_TYPED_ARRAY_LIST(COBALT_SCRIPT_CONVERSION_BOILERPLATE)
 #undef COBALT_SCRIPT_CONVERSION_BOILERPLATE
diff --git a/src/cobalt/script/v8c/v8c_user_object_holder.h b/src/cobalt/script/v8c/v8c_user_object_holder.h
index 532a874..0e6050f 100644
--- a/src/cobalt/script/v8c/v8c_user_object_holder.h
+++ b/src/cobalt/script/v8c/v8c_user_object_holder.h
@@ -137,4 +137,4 @@
 }  // namespace script
 }  // namespace cobalt
 
-#endif  // COBALT_SCRIPT_V8C_V8C_USER_OBJECT_HOLDER_H_
+#endif  // COBALT_SCRIPT_V8C_V8C_USER_OBJECT_HOLDER_H_
\ No newline at end of file
diff --git a/src/cobalt/storage/store/memory_store.cc b/src/cobalt/storage/store/memory_store.cc
index c92f419..d61c122 100644
--- a/src/cobalt/storage/store/memory_store.cc
+++ b/src/cobalt/storage/store/memory_store.cc
@@ -56,13 +56,14 @@
   void DeleteCookie(const net::CanonicalCookie& cc);
 
   // Local Storage
-  void ReadAllLocalStorage(const std::string& id,
+  void ReadAllLocalStorage(const loader::Origin& origin,
                            LocalStorageMap* local_storage_map) const;
 
-  void WriteToLocalStorage(const std::string& id, const std::string& key,
+  void WriteToLocalStorage(const loader::Origin& origin, const std::string& key,
                            const std::string& value);
-  void DeleteFromLocalStorage(const std::string& id, const std::string& key);
-  void ClearLocalStorage(const std::string& id);
+  void DeleteFromLocalStorage(const loader::Origin& origin,
+                              const std::string& key);
+  void ClearLocalStorage(const loader::Origin& origin);
 
   // Disable copying
   Impl(const Impl& store) = delete;
@@ -73,9 +74,10 @@
   std::map<CookieKey, Cookie> cookies_map_;
 
   typedef std::map<std::string, std::string> LocalStorageKeyValueMap;
-  typedef std::map<std::string, LocalStorageKeyValueMap> LocalStorageByIdMap;
+  typedef std::map<std::string, LocalStorageKeyValueMap>
+      LocalStorageByOriginMap;
 
-  LocalStorageByIdMap local_storage_by_id_map_;
+  LocalStorageByOriginMap local_storage_by_origin_map_;
 };
 
 MemoryStore::Impl::Impl() {}
@@ -100,8 +102,16 @@
   for (const auto& local_storages : storage_data.local_storages()) {
     for (const auto& local_storage_entry :
          local_storages.local_storage_entries()) {
-      local_storage_by_id_map_[local_storages.id()][local_storage_entry.key()] =
-          local_storage_entry.value();
+      GURL gurl(local_storages.serialized_origin());
+      loader::Origin origin(gurl);
+      if (origin.is_opaque()) {
+        LOG(WARNING) << "Ignoring storage for opaque origin "
+                     << local_storages.serialized_origin();
+        continue;
+      }
+      local_storage_by_origin_map_[origin.SerializedOrigin()]
+                                  [local_storage_entry.key()] =
+                                      local_storage_entry.value();
     }
   }
   return true;
@@ -113,10 +123,10 @@
   for (const auto& cookie_pair : cookies_map_) {
     *(storage_data.add_cookies()) = cookie_pair.second;
   }
-  for (const auto& id_storage_pair : local_storage_by_id_map_) {
+  for (const auto& origin_storage_pair : local_storage_by_origin_map_) {
     LocalStorage* local_storage = storage_data.add_local_storages();
-    local_storage->set_id(id_storage_pair.first);
-    for (const auto& key_value_pair : id_storage_pair.second) {
+    local_storage->set_serialized_origin(origin_storage_pair.first);
+    for (const auto& key_value_pair : origin_storage_pair.second) {
       LocalStorageEntry* local_storage_entry =
           local_storage->add_local_storage_entries();
       local_storage_entry->set_key(key_value_pair.first);
@@ -187,31 +197,31 @@
 }
 
 void MemoryStore::Impl::ReadAllLocalStorage(
-    const std::string& id, LocalStorageMap* local_storage_map) const {
+    const loader::Origin& origin, LocalStorageMap* local_storage_map) const {
   TRACK_MEMORY_SCOPE("Storage");
-  const auto& it = local_storage_by_id_map_.find(id);
+  const auto& it = local_storage_by_origin_map_.find(origin.SerializedOrigin());
 
-  if (it != local_storage_by_id_map_.end()) {
+  if (it != local_storage_by_origin_map_.end()) {
     local_storage_map->insert(it->second.begin(), it->second.end());
   }
 }
 
-void MemoryStore::Impl::WriteToLocalStorage(const std::string& id,
+void MemoryStore::Impl::WriteToLocalStorage(const loader::Origin& origin,
                                             const std::string& key,
                                             const std::string& value) {
   TRACK_MEMORY_SCOPE("Storage");
-  local_storage_by_id_map_[id][key] = value;
+  local_storage_by_origin_map_[origin.SerializedOrigin()][key] = value;
 }
 
-void MemoryStore::Impl::DeleteFromLocalStorage(const std::string& id,
+void MemoryStore::Impl::DeleteFromLocalStorage(const loader::Origin& origin,
                                                const std::string& key) {
   TRACK_MEMORY_SCOPE("Storage");
-  local_storage_by_id_map_[id].erase(key);
+  local_storage_by_origin_map_[origin.SerializedOrigin()].erase(key);
 }
 
-void MemoryStore::Impl::ClearLocalStorage(const std::string& id) {
+void MemoryStore::Impl::ClearLocalStorage(const loader::Origin& origin) {
   TRACK_MEMORY_SCOPE("Storage");
-  local_storage_by_id_map_[id].clear();
+  local_storage_by_origin_map_[origin.SerializedOrigin()].clear();
 }
 
 MemoryStore::MemoryStore() { impl_.reset(new Impl()); }
@@ -244,23 +254,23 @@
 }
 
 void MemoryStore::ReadAllLocalStorage(
-    const std::string& id, LocalStorageMap* local_storage_map) const {
-  impl_->ReadAllLocalStorage(id, local_storage_map);
+    const loader::Origin& origin, LocalStorageMap* local_storage_map) const {
+  impl_->ReadAllLocalStorage(origin, local_storage_map);
 }
 
-void MemoryStore::WriteToLocalStorage(const std::string& id,
+void MemoryStore::WriteToLocalStorage(const loader::Origin& origin,
                                       const std::string& key,
                                       const std::string& value) {
-  impl_->WriteToLocalStorage(id, key, value);
+  impl_->WriteToLocalStorage(origin, key, value);
 }
 
-void MemoryStore::DeleteFromLocalStorage(const std::string& id,
+void MemoryStore::DeleteFromLocalStorage(const loader::Origin& origin,
                                          const std::string& key) {
-  impl_->DeleteFromLocalStorage(id, key);
+  impl_->DeleteFromLocalStorage(origin, key);
 }
 
-void MemoryStore::ClearLocalStorage(const std::string& id) {
-  impl_->ClearLocalStorage(id);
+void MemoryStore::ClearLocalStorage(const loader::Origin& origin) {
+  impl_->ClearLocalStorage(origin);
 }
 
 MemoryStore::~MemoryStore() {}
diff --git a/src/cobalt/storage/store/memory_store.h b/src/cobalt/storage/store/memory_store.h
index a5f3ccc..c29d486 100644
--- a/src/cobalt/storage/store/memory_store.h
+++ b/src/cobalt/storage/store/memory_store.h
@@ -16,10 +16,12 @@
 #define COBALT_STORAGE_STORE_MEMORY_STORE_H_
 
 #include <string>
+#include <tuple>
 #include <vector>
 
 #include "base/hash_tables.h"
 #include "base/memory/scoped_ptr.h"
+#include "cobalt/loader/origin.h"
 #include "net/cookies/canonical_cookie.h"
 
 namespace cobalt {
@@ -43,14 +45,16 @@
   void UpdateCookieAccessTime(const net::CanonicalCookie& cc, int64 time_us);
   void DeleteCookie(const net::CanonicalCookie& cc);
 
+
   // Local Storage
-  void ReadAllLocalStorage(const std::string& id,
+  void ReadAllLocalStorage(const loader::Origin& origin,
                            LocalStorageMap* local_storage_map) const;
 
-  void WriteToLocalStorage(const std::string& id, const std::string& key,
+  void WriteToLocalStorage(const loader::Origin& origin, const std::string& key,
                            const std::string& value);
-  void DeleteFromLocalStorage(const std::string& id, const std::string& key);
-  void ClearLocalStorage(const std::string& id);
+  void DeleteFromLocalStorage(const loader::Origin& origin,
+                              const std::string& key);
+  void ClearLocalStorage(const loader::Origin& origin);
 
   // Disable copying
   MemoryStore(const MemoryStore& store) = delete;
diff --git a/src/cobalt/storage/store/memory_store_test.cc b/src/cobalt/storage/store/memory_store_test.cc
index ab7f8cb..4ac9d8a 100644
--- a/src/cobalt/storage/store/memory_store_test.cc
+++ b/src/cobalt/storage/store/memory_store_test.cc
@@ -27,7 +27,9 @@
 
 class MemoryStoreTest : public ::testing::Test {
  protected:
-  MemoryStoreTest() : id1_("a_site_id1"), id2_("a_site_id2") {
+  MemoryStoreTest()
+      : origin1_(GURL("https://www.example1.com")),
+        origin2_(GURL("https://www.example2.com")) {
     base::Time current_time = base::Time::FromInternalValue(12345);
     expiration_time_ = current_time + base::TimeDelta::FromDays(1);
 
@@ -70,8 +72,8 @@
   }
   ~MemoryStoreTest() {}
 
-  std::string id1_;
-  std::string id2_;
+  loader::Origin origin1_;
+  loader::Origin origin2_;
   Storage storage_proto_;
   std::vector<uint8> storage_data_;
   scoped_ptr<net::CanonicalCookie> cookie_;
@@ -161,12 +163,12 @@
   test_vals["key1"] = "value1";
 
   for (const auto& it : test_vals) {
-    memory_store_.WriteToLocalStorage(id1_, it.first, it.second);
+    memory_store_.WriteToLocalStorage(origin1_, it.first, it.second);
   }
 
-  memory_store_.WriteToLocalStorage(id2_, "key0", "value0");
+  memory_store_.WriteToLocalStorage(origin2_, "key0", "value0");
   MemoryStore::LocalStorageMap read_vals;
-  memory_store_.ReadAllLocalStorage(id1_, &read_vals);
+  memory_store_.ReadAllLocalStorage(origin1_, &read_vals);
   EXPECT_EQ(test_vals, read_vals);
 }
 
@@ -176,14 +178,14 @@
   test_vals["key1"] = "value1";
 
   for (const auto& it : test_vals) {
-    memory_store_.WriteToLocalStorage(id1_, it.first, it.second);
+    memory_store_.WriteToLocalStorage(origin1_, it.first, it.second);
   }
 
-  memory_store_.DeleteFromLocalStorage(id1_, "key0");
+  memory_store_.DeleteFromLocalStorage(origin1_, "key0");
   test_vals.erase("key0");
 
   MemoryStore::LocalStorageMap read_vals;
-  memory_store_.ReadAllLocalStorage(id1_, &read_vals);
+  memory_store_.ReadAllLocalStorage(origin1_, &read_vals);
 
   EXPECT_EQ(test_vals, read_vals);
 }
@@ -194,13 +196,13 @@
   test_vals["key1"] = "value1";
 
   for (const auto& it : test_vals) {
-    memory_store_.WriteToLocalStorage(id1_, it.first, it.second);
+    memory_store_.WriteToLocalStorage(origin1_, it.first, it.second);
   }
 
-  memory_store_.ClearLocalStorage(id1_);
+  memory_store_.ClearLocalStorage(origin1_);
 
   MemoryStore::LocalStorageMap read_vals;
-  memory_store_.ReadAllLocalStorage(id1_, &read_vals);
+  memory_store_.ReadAllLocalStorage(origin1_, &read_vals);
 
   EXPECT_TRUE(read_vals.empty());
 }
diff --git a/src/cobalt/storage/store/storage.pb.cc b/src/cobalt/storage/store/storage.pb.cc
index b96170c..b47d179 100644
--- a/src/cobalt/storage/store/storage.pb.cc
+++ b/src/cobalt/storage/store/storage.pb.cc
@@ -1,8 +1,8 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: storage.proto
+// source: cobalt/storage/store/storage.proto
 
 #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
-#include "storage.pb.h"
+#include "cobalt/storage/store/storage.pb.h"
 
 #include <algorithm>
 
@@ -17,7 +17,7 @@
 namespace cobalt {
 namespace storage {
 
-void protobuf_ShutdownFile_storage_2eproto() {
+void protobuf_ShutdownFile_cobalt_2fstorage_2fstore_2fstorage_2eproto() {
   delete Cookie::default_instance_;
   delete LocalStorageEntry::default_instance_;
   delete LocalStorage::default_instance_;
@@ -25,11 +25,11 @@
 }
 
 #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
-void protobuf_AddDesc_storage_2eproto_impl() {
+void protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto_impl() {
   GOOGLE_PROTOBUF_VERIFY_VERSION;
 
 #else
-void protobuf_AddDesc_storage_2eproto() {
+void protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto() {
   static bool already_here = false;
   if (already_here) return;
   already_here = true;
@@ -44,22 +44,22 @@
   LocalStorageEntry::default_instance_->InitAsDefaultInstance();
   LocalStorage::default_instance_->InitAsDefaultInstance();
   Storage::default_instance_->InitAsDefaultInstance();
-  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_storage_2eproto);
+  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_cobalt_2fstorage_2fstore_2fstorage_2eproto);
 }
 
 #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
-GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_storage_2eproto_once_);
-void protobuf_AddDesc_storage_2eproto() {
-  ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_storage_2eproto_once_,
-                 &protobuf_AddDesc_storage_2eproto_impl);
+GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto_once_);
+void protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto() {
+  ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto_once_,
+                 &protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto_impl);
 }
 #else
 // Force AddDescriptors() to be called at static initialization time.
-struct StaticDescriptorInitializer_storage_2eproto {
-  StaticDescriptorInitializer_storage_2eproto() {
-    protobuf_AddDesc_storage_2eproto();
+struct StaticDescriptorInitializer_cobalt_2fstorage_2fstore_2fstorage_2eproto {
+  StaticDescriptorInitializer_cobalt_2fstorage_2fstore_2fstorage_2eproto() {
+    protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
   }
-} static_descriptor_initializer_storage_2eproto_;
+} static_descriptor_initializer_cobalt_2fstorage_2fstore_2fstorage_2eproto_;
 #endif
 
 namespace {
@@ -144,9 +144,9 @@
 }
 const Cookie& Cookie::default_instance() {
 #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
-  protobuf_AddDesc_storage_2eproto();
+  protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
 #else
-  if (default_instance_ == NULL) protobuf_AddDesc_storage_2eproto();
+  if (default_instance_ == NULL) protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
 #endif
   return *default_instance_;
 }
@@ -886,9 +886,9 @@
 }
 const LocalStorageEntry& LocalStorageEntry::default_instance() {
 #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
-  protobuf_AddDesc_storage_2eproto();
+  protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
 #else
-  if (default_instance_ == NULL) protobuf_AddDesc_storage_2eproto();
+  if (default_instance_ == NULL) protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
 #endif
   return *default_instance_;
 }
@@ -1164,7 +1164,7 @@
 // ===================================================================
 
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
-const int LocalStorage::kIdFieldNumber;
+const int LocalStorage::kSerializedOriginFieldNumber;
 const int LocalStorage::kLocalStorageEntriesFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
@@ -1190,7 +1190,7 @@
     _is_default_instance_ = false;
   ::google::protobuf::internal::GetEmptyString();
   _cached_size_ = 0;
-  id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  serialized_origin_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
 
 LocalStorage::~LocalStorage() {
@@ -1199,7 +1199,7 @@
 }
 
 void LocalStorage::SharedDtor() {
-  id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  serialized_origin_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
   #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
   if (this != &default_instance()) {
   #else
@@ -1215,9 +1215,9 @@
 }
 const LocalStorage& LocalStorage::default_instance() {
 #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
-  protobuf_AddDesc_storage_2eproto();
+  protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
 #else
-  if (default_instance_ == NULL) protobuf_AddDesc_storage_2eproto();
+  if (default_instance_ == NULL) protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
 #endif
   return *default_instance_;
 }
@@ -1234,7 +1234,7 @@
 
 void LocalStorage::Clear() {
 // @@protoc_insertion_point(message_clear_start:cobalt.storage.LocalStorage)
-  id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  serialized_origin_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
   local_storage_entries_.Clear();
 }
 
@@ -1248,15 +1248,15 @@
     tag = p.first;
     if (!p.second) goto handle_unusual;
     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
-      // optional string id = 1;
+      // optional string serialized_origin = 1;
       case 1: {
         if (tag == 10) {
           DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-                input, this->mutable_id()));
+                input, this->mutable_serialized_origin()));
           DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-            this->id().data(), this->id().length(),
+            this->serialized_origin().data(), this->serialized_origin().length(),
             ::google::protobuf::internal::WireFormatLite::PARSE,
-            "cobalt.storage.LocalStorage.id"));
+            "cobalt.storage.LocalStorage.serialized_origin"));
         } else {
           goto handle_unusual;
         }
@@ -1305,14 +1305,14 @@
 void LocalStorage::SerializeWithCachedSizes(
     ::google::protobuf::io::CodedOutputStream* output) const {
   // @@protoc_insertion_point(serialize_start:cobalt.storage.LocalStorage)
-  // optional string id = 1;
-  if (this->id().size() > 0) {
+  // optional string serialized_origin = 1;
+  if (this->serialized_origin().size() > 0) {
     ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
-      this->id().data(), this->id().length(),
+      this->serialized_origin().data(), this->serialized_origin().length(),
       ::google::protobuf::internal::WireFormatLite::SERIALIZE,
-      "cobalt.storage.LocalStorage.id");
+      "cobalt.storage.LocalStorage.serialized_origin");
     ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
-      1, this->id(), output);
+      1, this->serialized_origin(), output);
   }
 
   // repeated .cobalt.storage.LocalStorageEntry local_storage_entries = 2;
@@ -1328,11 +1328,11 @@
 // @@protoc_insertion_point(message_byte_size_start:cobalt.storage.LocalStorage)
   int total_size = 0;
 
-  // optional string id = 1;
-  if (this->id().size() > 0) {
+  // optional string serialized_origin = 1;
+  if (this->serialized_origin().size() > 0) {
     total_size += 1 +
       ::google::protobuf::internal::WireFormatLite::StringSize(
-        this->id());
+        this->serialized_origin());
   }
 
   // repeated .cobalt.storage.LocalStorageEntry local_storage_entries = 2;
@@ -1358,9 +1358,9 @@
 // @@protoc_insertion_point(class_specific_merge_from_start:cobalt.storage.LocalStorage)
   if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
   local_storage_entries_.MergeFrom(from.local_storage_entries_);
-  if (from.id().size() > 0) {
+  if (from.serialized_origin().size() > 0) {
 
-    id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.id_);
+    serialized_origin_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.serialized_origin_);
   }
 }
 
@@ -1381,7 +1381,7 @@
   InternalSwap(other);
 }
 void LocalStorage::InternalSwap(LocalStorage* other) {
-  id_.Swap(&other->id_);
+  serialized_origin_.Swap(&other->serialized_origin_);
   local_storage_entries_.UnsafeArenaSwap(&other->local_storage_entries_);
   _unknown_fields_.Swap(&other->_unknown_fields_);
   std::swap(_cached_size_, other->_cached_size_);
@@ -1394,48 +1394,48 @@
 #if PROTOBUF_INLINE_NOT_IN_HEADERS
 // LocalStorage
 
-// optional string id = 1;
-void LocalStorage::clear_id() {
-  id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+// optional string serialized_origin = 1;
+void LocalStorage::clear_serialized_origin() {
+  serialized_origin_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
- const ::std::string& LocalStorage::id() const {
-  // @@protoc_insertion_point(field_get:cobalt.storage.LocalStorage.id)
-  return id_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+ const ::std::string& LocalStorage::serialized_origin() const {
+  // @@protoc_insertion_point(field_get:cobalt.storage.LocalStorage.serialized_origin)
+  return serialized_origin_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
- void LocalStorage::set_id(const ::std::string& value) {
+ void LocalStorage::set_serialized_origin(const ::std::string& value) {
   
-  id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
-  // @@protoc_insertion_point(field_set:cobalt.storage.LocalStorage.id)
+  serialized_origin_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+  // @@protoc_insertion_point(field_set:cobalt.storage.LocalStorage.serialized_origin)
 }
- void LocalStorage::set_id(const char* value) {
+ void LocalStorage::set_serialized_origin(const char* value) {
   
-  id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:cobalt.storage.LocalStorage.id)
+  serialized_origin_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+  // @@protoc_insertion_point(field_set_char:cobalt.storage.LocalStorage.serialized_origin)
 }
- void LocalStorage::set_id(const char* value, size_t size) {
+ void LocalStorage::set_serialized_origin(const char* value, size_t size) {
   
-  id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+  serialized_origin_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
       ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:cobalt.storage.LocalStorage.id)
+  // @@protoc_insertion_point(field_set_pointer:cobalt.storage.LocalStorage.serialized_origin)
 }
- ::std::string* LocalStorage::mutable_id() {
+ ::std::string* LocalStorage::mutable_serialized_origin() {
   
-  // @@protoc_insertion_point(field_mutable:cobalt.storage.LocalStorage.id)
-  return id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  // @@protoc_insertion_point(field_mutable:cobalt.storage.LocalStorage.serialized_origin)
+  return serialized_origin_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
- ::std::string* LocalStorage::release_id() {
-  // @@protoc_insertion_point(field_release:cobalt.storage.LocalStorage.id)
+ ::std::string* LocalStorage::release_serialized_origin() {
+  // @@protoc_insertion_point(field_release:cobalt.storage.LocalStorage.serialized_origin)
   
-  return id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return serialized_origin_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
- void LocalStorage::set_allocated_id(::std::string* id) {
-  if (id != NULL) {
+ void LocalStorage::set_allocated_serialized_origin(::std::string* serialized_origin) {
+  if (serialized_origin != NULL) {
     
   } else {
     
   }
-  id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), id);
-  // @@protoc_insertion_point(field_set_allocated:cobalt.storage.LocalStorage.id)
+  serialized_origin_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), serialized_origin);
+  // @@protoc_insertion_point(field_set_allocated:cobalt.storage.LocalStorage.serialized_origin)
 }
 
 // repeated .cobalt.storage.LocalStorageEntry local_storage_entries = 2;
@@ -1521,9 +1521,9 @@
 }
 const Storage& Storage::default_instance() {
 #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
-  protobuf_AddDesc_storage_2eproto();
+  protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
 #else
-  if (default_instance_ == NULL) protobuf_AddDesc_storage_2eproto();
+  if (default_instance_ == NULL) protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
 #endif
   return *default_instance_;
 }
diff --git a/src/cobalt/storage/store/storage.pb.h b/src/cobalt/storage/store/storage.pb.h
index fe0a29a..e12090c 100644
--- a/src/cobalt/storage/store/storage.pb.h
+++ b/src/cobalt/storage/store/storage.pb.h
@@ -1,8 +1,8 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: storage.proto
+// source: cobalt/storage/store/storage.proto
 
-#ifndef PROTOBUF_storage_2eproto__INCLUDED
-#define PROTOBUF_storage_2eproto__INCLUDED
+#ifndef PROTOBUF_cobalt_2fstorage_2fstore_2fstorage_2eproto__INCLUDED
+#define PROTOBUF_cobalt_2fstorage_2fstore_2fstorage_2eproto__INCLUDED
 
 #include <string>
 
@@ -31,9 +31,9 @@
 namespace storage {
 
 // Internal implementation detail -- do not call these.
-void protobuf_AddDesc_storage_2eproto();
-void protobuf_AssignDesc_storage_2eproto();
-void protobuf_ShutdownFile_storage_2eproto();
+void protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
+void protobuf_AssignDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
+void protobuf_ShutdownFile_cobalt_2fstorage_2fstore_2fstorage_2eproto();
 
 class Cookie;
 class LocalStorage;
@@ -198,12 +198,12 @@
   bool http_only_;
   mutable int _cached_size_;
   #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
-  friend void  protobuf_AddDesc_storage_2eproto_impl();
+  friend void  protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto_impl();
   #else
-  friend void  protobuf_AddDesc_storage_2eproto();
+  friend void  protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
   #endif
-  friend void protobuf_AssignDesc_storage_2eproto();
-  friend void protobuf_ShutdownFile_storage_2eproto();
+  friend void protobuf_AssignDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
+  friend void protobuf_ShutdownFile_cobalt_2fstorage_2fstore_2fstorage_2eproto();
 
   void InitAsDefaultInstance();
   static Cookie* default_instance_;
@@ -307,12 +307,12 @@
   ::google::protobuf::internal::ArenaStringPtr value_;
   mutable int _cached_size_;
   #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
-  friend void  protobuf_AddDesc_storage_2eproto_impl();
+  friend void  protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto_impl();
   #else
-  friend void  protobuf_AddDesc_storage_2eproto();
+  friend void  protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
   #endif
-  friend void protobuf_AssignDesc_storage_2eproto();
-  friend void protobuf_ShutdownFile_storage_2eproto();
+  friend void protobuf_AssignDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
+  friend void protobuf_ShutdownFile_cobalt_2fstorage_2fstore_2fstorage_2eproto();
 
   void InitAsDefaultInstance();
   static LocalStorageEntry* default_instance_;
@@ -383,16 +383,16 @@
 
   // accessors -------------------------------------------------------
 
-  // optional string id = 1;
-  void clear_id();
-  static const int kIdFieldNumber = 1;
-  const ::std::string& id() const;
-  void set_id(const ::std::string& value);
-  void set_id(const char* value);
-  void set_id(const char* value, size_t size);
-  ::std::string* mutable_id();
-  ::std::string* release_id();
-  void set_allocated_id(::std::string* id);
+  // optional string serialized_origin = 1;
+  void clear_serialized_origin();
+  static const int kSerializedOriginFieldNumber = 1;
+  const ::std::string& serialized_origin() const;
+  void set_serialized_origin(const ::std::string& value);
+  void set_serialized_origin(const char* value);
+  void set_serialized_origin(const char* value, size_t size);
+  ::std::string* mutable_serialized_origin();
+  ::std::string* release_serialized_origin();
+  void set_allocated_serialized_origin(::std::string* serialized_origin);
 
   // repeated .cobalt.storage.LocalStorageEntry local_storage_entries = 2;
   int local_storage_entries_size() const;
@@ -413,16 +413,16 @@
   ::google::protobuf::Arena* _arena_ptr_;
 
   bool _is_default_instance_;
-  ::google::protobuf::internal::ArenaStringPtr id_;
+  ::google::protobuf::internal::ArenaStringPtr serialized_origin_;
   ::google::protobuf::RepeatedPtrField< ::cobalt::storage::LocalStorageEntry > local_storage_entries_;
   mutable int _cached_size_;
   #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
-  friend void  protobuf_AddDesc_storage_2eproto_impl();
+  friend void  protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto_impl();
   #else
-  friend void  protobuf_AddDesc_storage_2eproto();
+  friend void  protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
   #endif
-  friend void protobuf_AssignDesc_storage_2eproto();
-  friend void protobuf_ShutdownFile_storage_2eproto();
+  friend void protobuf_AssignDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
+  friend void protobuf_ShutdownFile_cobalt_2fstorage_2fstore_2fstorage_2eproto();
 
   void InitAsDefaultInstance();
   static LocalStorage* default_instance_;
@@ -528,12 +528,12 @@
   ::google::protobuf::RepeatedPtrField< ::cobalt::storage::LocalStorage > local_storages_;
   mutable int _cached_size_;
   #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
-  friend void  protobuf_AddDesc_storage_2eproto_impl();
+  friend void  protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto_impl();
   #else
-  friend void  protobuf_AddDesc_storage_2eproto();
+  friend void  protobuf_AddDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
   #endif
-  friend void protobuf_AssignDesc_storage_2eproto();
-  friend void protobuf_ShutdownFile_storage_2eproto();
+  friend void protobuf_AssignDesc_cobalt_2fstorage_2fstore_2fstorage_2eproto();
+  friend void protobuf_ShutdownFile_cobalt_2fstorage_2fstore_2fstorage_2eproto();
 
   void InitAsDefaultInstance();
   static Storage* default_instance_;
@@ -888,48 +888,48 @@
 
 // LocalStorage
 
-// optional string id = 1;
-inline void LocalStorage::clear_id() {
-  id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+// optional string serialized_origin = 1;
+inline void LocalStorage::clear_serialized_origin() {
+  serialized_origin_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
-inline const ::std::string& LocalStorage::id() const {
-  // @@protoc_insertion_point(field_get:cobalt.storage.LocalStorage.id)
-  return id_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline const ::std::string& LocalStorage::serialized_origin() const {
+  // @@protoc_insertion_point(field_get:cobalt.storage.LocalStorage.serialized_origin)
+  return serialized_origin_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
-inline void LocalStorage::set_id(const ::std::string& value) {
+inline void LocalStorage::set_serialized_origin(const ::std::string& value) {
   
-  id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
-  // @@protoc_insertion_point(field_set:cobalt.storage.LocalStorage.id)
+  serialized_origin_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+  // @@protoc_insertion_point(field_set:cobalt.storage.LocalStorage.serialized_origin)
 }
-inline void LocalStorage::set_id(const char* value) {
+inline void LocalStorage::set_serialized_origin(const char* value) {
   
-  id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:cobalt.storage.LocalStorage.id)
+  serialized_origin_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+  // @@protoc_insertion_point(field_set_char:cobalt.storage.LocalStorage.serialized_origin)
 }
-inline void LocalStorage::set_id(const char* value, size_t size) {
+inline void LocalStorage::set_serialized_origin(const char* value, size_t size) {
   
-  id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+  serialized_origin_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
       ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:cobalt.storage.LocalStorage.id)
+  // @@protoc_insertion_point(field_set_pointer:cobalt.storage.LocalStorage.serialized_origin)
 }
-inline ::std::string* LocalStorage::mutable_id() {
+inline ::std::string* LocalStorage::mutable_serialized_origin() {
   
-  // @@protoc_insertion_point(field_mutable:cobalt.storage.LocalStorage.id)
-  return id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  // @@protoc_insertion_point(field_mutable:cobalt.storage.LocalStorage.serialized_origin)
+  return serialized_origin_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
-inline ::std::string* LocalStorage::release_id() {
-  // @@protoc_insertion_point(field_release:cobalt.storage.LocalStorage.id)
+inline ::std::string* LocalStorage::release_serialized_origin() {
+  // @@protoc_insertion_point(field_release:cobalt.storage.LocalStorage.serialized_origin)
   
-  return id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  return serialized_origin_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
-inline void LocalStorage::set_allocated_id(::std::string* id) {
-  if (id != NULL) {
+inline void LocalStorage::set_allocated_serialized_origin(::std::string* serialized_origin) {
+  if (serialized_origin != NULL) {
     
   } else {
     
   }
-  id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), id);
-  // @@protoc_insertion_point(field_set_allocated:cobalt.storage.LocalStorage.id)
+  serialized_origin_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), serialized_origin);
+  // @@protoc_insertion_point(field_set_allocated:cobalt.storage.LocalStorage.serialized_origin)
 }
 
 // repeated .cobalt.storage.LocalStorageEntry local_storage_entries = 2;
@@ -1041,4 +1041,4 @@
 
 // @@protoc_insertion_point(global_scope)
 
-#endif  // PROTOBUF_storage_2eproto__INCLUDED
+#endif  // PROTOBUF_cobalt_2fstorage_2fstore_2fstorage_2eproto__INCLUDED
diff --git a/src/cobalt/storage/store/storage.proto b/src/cobalt/storage/store/storage.proto
index 8ec28af..d1efbbd 100644
--- a/src/cobalt/storage/store/storage.proto
+++ b/src/cobalt/storage/store/storage.proto
@@ -65,8 +65,11 @@
 
 // Multiple local storages identified by unique id.
 message LocalStorage {
-  // A site id of the local storage.
-  string id = 1;
+  // A serialzied origin as defined in:
+  // https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin.
+  // For example: "https://www.youtube.com"
+  string serialized_origin = 1;
+
   // The local storage entries for individual local storage.
   repeated LocalStorageEntry local_storage_entries = 2;
 }
diff --git a/src/cobalt/storage/store/store.gyp b/src/cobalt/storage/store/store.gyp
index ecc7b44..6b5fd18 100644
--- a/src/cobalt/storage/store/store.gyp
+++ b/src/cobalt/storage/store/store.gyp
@@ -24,6 +24,7 @@
         'storage.pb.h',
       ],
       'dependencies': [
+        '<(DEPTH)/cobalt/loader/origin.gyp:origin',
         '<(DEPTH)/cobalt/storage/storage_constants.gyp:storage_constants',
         '<(DEPTH)/cobalt/base/base.gyp:base',
         '<(DEPTH)/net/net.gyp:net',
diff --git a/src/cobalt/storage/store_upgrade/upgrade.cc b/src/cobalt/storage/store_upgrade/upgrade.cc
index 7318104..9c49c07 100644
--- a/src/cobalt/storage/store_upgrade/upgrade.cc
+++ b/src/cobalt/storage/store_upgrade/upgrade.cc
@@ -21,7 +21,10 @@
 
 #include "base/debug/trace_event.h"
 #include "base/file_path.h"
+#include "base/optional.h"
+#include "base/string_split.h"
 #include "cobalt/storage/storage_constants.h"
+#include "cobalt/storage/store/memory_store.h"
 #include "cobalt/storage/store/storage.pb.h"
 #include "cobalt/storage/store_upgrade/sql_vfs.h"
 #include "cobalt/storage/store_upgrade/virtual_file.h"
@@ -95,6 +98,35 @@
   }
 }
 
+base::optional<loader::Origin> ParseLocalStorageId(const std::string& id) {
+  std::vector<std::string> id_tokens;
+  base::SplitString(id, '_', &id_tokens);
+  if (id_tokens.size() != 3) {
+    DLOG(WARNING) << "Failed to parse id=" << id;
+    return base::nullopt;
+  }
+  std::string url = id_tokens[0];
+  url += "://";
+  url += id_tokens[1];
+
+  std::vector<std::string> port_tokens;
+  base::SplitString(id_tokens[2], '.', &port_tokens);
+  if (port_tokens.size() != 2) {
+    return base::nullopt;
+  }
+  if (port_tokens[0] != "0") {
+    url += ":";
+    url += port_tokens[0];
+  }
+  GURL gurl(url);
+  loader::Origin origin(gurl);
+  if (origin.is_opaque()) {
+    DLOG(WARNING) << "Missing Serialized Origin for id=" << id;
+    return base::nullopt;
+  }
+  return origin;
+}
+
 void GetLocalStorage(sql::Connection* conn, Storage* storage) {
   sql::Statement get_all(conn->GetCachedStatement(
       SQL_FROM_HERE,
@@ -102,14 +134,18 @@
   std::map<std::string, LocalStorage*> map_storage;
   while (get_all.Step()) {
     std::string id(get_all.ColumnString(0));
+    base::optional<loader::Origin> origin = ParseLocalStorageId(id);
+    if (!origin) {
+      continue;
+    }
     DLOG(INFO) << "GetLocalStorage: id=" << id;
-    if (map_storage[id] == nullptr) {
+    if (map_storage[origin->SerializedOrigin()] == nullptr) {
       LocalStorage* local_storage = storage->add_local_storages();
-      local_storage->set_id(id);
-      map_storage[id] = local_storage;
+      local_storage->set_serialized_origin(origin->SerializedOrigin());
+      map_storage[origin->SerializedOrigin()] = local_storage;
     }
     LocalStorageEntry* local_storage_entry =
-        map_storage[id]->add_local_storage_entries();
+        map_storage[origin->SerializedOrigin()]->add_local_storage_entries();
     local_storage_entry->set_key(get_all.ColumnString(1));
     local_storage_entry->set_value(get_all.ColumnString(2));
     DLOG(INFO) << "GetLocalStorage: key=" << local_storage_entry->key()
diff --git a/src/cobalt/storage/store_upgrade/upgrade_test.cc b/src/cobalt/storage/store_upgrade/upgrade_test.cc
index b97eb91..14cee97 100644
--- a/src/cobalt/storage/store_upgrade/upgrade_test.cc
+++ b/src/cobalt/storage/store_upgrade/upgrade_test.cc
@@ -86,7 +86,8 @@
                    true);
   }
 
-  EXPECT_EQ(storage.local_storages(0).id(), "http_localhost_8000.localstorage");
+  EXPECT_EQ(storage.local_storages(0).serialized_origin(),
+            "http://localhost:8000");
   if (storage.local_storages(0).local_storage_entries(0).key() == "foo") {
     ValidateLocalStorageEntry(
         storage.local_storages(0).local_storage_entries(0), "foo", "bar");
diff --git a/src/cobalt/streams/embedded_scripts/readable_stream.js b/src/cobalt/streams/embedded_scripts/readable_stream.js
index 837f0b7..f91aac3 100644
--- a/src/cobalt/streams/embedded_scripts/readable_stream.js
+++ b/src/cobalt/streams/embedded_scripts/readable_stream.js
@@ -1,20 +1,20 @@
-'use strict';(function(d){function O(a){return function(b){return a.apply(b,la.call(arguments,1))}}function P(){var a=this;ca.call(this,function(b,m){a[E]=b;a[Q]=m})}function V(a){try{F(a,e,function(){})}catch(b){}}function q(){this.back=this.front={elements:new da,next:e};this.size=this.cursor=0}function v(a,b,m){a=a===e?{}:a;var c=b===e?{}:b;b=c.size;c=c.highWaterMark;c===e&&(c=1);this[p]=0;this[p]=this[p]&-7|0;this[u]=e;this[K]=e;this[y]=e;var d=a.type;if("bytes"===String(d))throw new G("bytes type is not yet implemented");
-if(d!==e)throw new G("Invalid type is specified");this[y]=new L(this,a,b,c,m)}function L(a,b,m,d){if(!1===B(a))throw new c("Illegal constructor");if(a[y]!==e)throw new c("Illegal constructor");this[k]=a;this[W]=b;this[z]=new q;this[H]=0;this[g]=0;m=ma(m,d);this[ea]=m.size;this[fa]=m.highWaterMark;var R=this;b=na(b,"start",this,"underlyingSource.start");F(C(b),function(){R[g]|=1;M(R)},function(b){0===h(a)&&A(R,b)})}function oa(a,b){a[z]=new q;return ga(a[W],"cancel",b,"underlyingSource.cancel")}function N(a){if(!1===
-B(a))throw new c("ReadableStreamReader constructor argument is not a readable stream");if(!0===I(a))throw new c("ReadableStreamReader constructor can only accept readable streams that are not yet locked to a reader");this[x]=a;a[u]=this;switch(h(a)){case 0:this[t]=new P;break;case 1:this[t]=C(e);break;case 2:this[t]=n(a[K]),V(this[t])}this[r]=new q}function X(a){return new N(a)}function S(a,b){a[p]|=1;var m=h(a);if(1===m)return C(e);if(2===m)return n(a[K]);Y(a);a=oa(a[y],b);return F(a,function(){return e})}
-function T(a){var b=a[k];a[g]|=2;0===a[z].length&&Y(b)}function U(a,b){var m=a[k];if(!0===I(m)&&0<m[u][r].length)m[u][r].shift()[E]({value:b,done:!1});else{var c=1,d=a[ea];if(d!==e)try{c=d(b)}catch(w){throw 0===h(m)&&A(a,w),w;}try{c=Z(c);if(ha(c)||c===+pa||0>c)throw new G("The return value of a queuing strategy's size function must be a finite, non-NaN, non-negative number");a[H]+=c;a[z].push({value:b,size:c})}catch(w){throw 0===h(m)&&A(a,w),w;}}M(a)}function h(a){return(a[p]&6)>>1}function A(a,b){a[z]=
-new q;qa(a[k],b)}function qa(a,b){a[K]=b;a[p]=a[p]&-7|4;a=a[u];if(a===e)return e;!0===D(a)&&(a[r].forEach(function(a){a[Q](b)}),a[r]=new q);a[t][Q](b);V(a[t])}function Y(a){a[p]=a[p]&-7|2;a=a[u];if(a===e)return e;!0===D(a)&&(a[r].forEach(function(a){a[E]({value:e,done:!0})}),a[r]=new q);a[t][E](e)}function aa(a){var b=h(a[k]);return 1===b?0:2===b?null:a[fa]-a[H]}function B(a){return J(a,y)}function I(a){return a[u]!==e}function D(a){return J(a,r)}function ba(a){a=a[x];a[p]|=1;if(1===h(a))return C({value:e,
-done:!0});if(2===h(a))return n(a[K]);a=a[y];var b=a[k];if(0<a[z].length){var c=a[z].shift();a[H]-=c.size;c=c.value;a[g]&2&&0===a[z].length?Y(b):M(a);a=C({value:c,done:!1})}else c=new P,b[u][r].push(c),M(a),a=c;return a}function M(a){if(!1===ra(a))return e;if(a[g]&4)return a[g]|=8,e;a[g]|=4;var b=ga(a[W],"pull",a,"underlyingSource.pull");F(b,function(){a[g]&=-5;a[g]&8&&(a[g]&=-9,M(a))},function(b){0===h(a[k])&&A(a,b)})}function ra(a){var b=a[k],c=h(b);return 1===c||2===c||a[g]&2||!(a[g]&1)?!1:!0===
-I(b)&&0<b[u][r].length||0<aa(a)?!0:!1}function ia(a){function b(){return F(ba(c),function(a){var b=a.value;!0===a.done&&!1===d&&(!1===f&&T(q),!1===g&&T(r),d=!0);!0!==d&&(!1===f&&U(q,b),!1===g&&U(r,b))})}var c=X(a),d=!1,f=!1,g=!1,h,l,k=new P,n=new v({pull:b,cancel:function(b){f=!0;h=b;!0===g&&(b=S(a,[h,l]),k[E](b));return k}}),p=new v({pull:b,cancel:function(b){g=!0;l=b;!0===f&&(b=S(a,[h,l]),k[E](b));return k}}),q=n[y],r=p[y];F(c[t],e,function(a){!0!==d&&(A(q,a),A(r,a),d=!0)});return[n,p]}function ma(a,
-b){if(a!==e&&"function"!==typeof a)throw new c("A queuing strategy's size property must be a function");b=Z(b);if(ha(b))throw new G("A queueing strategy's highWaterMark property must be a nonnegative, non-NaN number");if(0>b)throw new G("A queueing strategy's highWaterMark property must be a nonnegative, non-NaN number");return{size:a,highWaterMark:b}}function na(a,b,d,f){b=a[b];if(b===e)return e;if("function"!==typeof b)throw new c(ja(f));return ka(b,a,d)}function ga(a,b,d,f){try{var g=a[b]}catch(w){return n(w)}if(g===
-e)return C(e);if("function"!==typeof g)return n(new c(ja(f)));try{return C(ka(g,a,d))}catch(w){return n(w)}}var l=d.Object.defineProperty,da=d.Array,f=d.Symbol,la=d.Array.prototype.slice,ca=d.Promise,E=f("[[Resolve]]"),Q=f("[[Reject]]");P.prototype=ca.prototype;l(q.prototype,"length",{get:function(){return this.size}});q.prototype.push=function(a){++this.size;if(16384===this.back.elements.length){var b=this.back;this.back={elements:new da,next:e};b.next=this.back}this.back.elements.push(a)};q.prototype.shift=
-function(){--this.size;this.front.elements.length===this.cursor&&(this.front=this.front.next,this.cursor=0);var a=this.front.elements[this.cursor];this.front.elements[this.cursor]=e;++this.cursor;return a};q.prototype.forEach=function(a){for(var b=this.cursor,c=this.front,d=c.elements;b!==d.length||c.next!==e;)b===d.length&&(c=c.next,d=c.elements,b=0),a(d[b]),++b};q.prototype.peek=function(){return this.front.elements.length===this.cursor?this.front.next.elements[0]:this.front.elements[this.cursor]};
-var u=f("[[reader]]"),K=f("[[storedError]]"),y=f("[[controller]]"),t=f("[[closedPromise]]"),x=f("[[ownerReadableStream]]"),r=f("[[readRequests]]"),p=f("bit field for [[state]] and [[disturbed]]"),W=f("[[underlyingSource]]"),k=f("[[controlledReadableStream]]"),z=f("[[queue]]"),H=f("[[totalQueuedSize]]"),ea=f("[[strategySize]]"),fa=f("[[strategyHWM]]"),g=f("bit field for [[started]], [[closeRequested]], [[pulling]], [[pullAgain]]"),e=d.undefined,pa=d.Infinity,J=O(d.Object.hasOwnProperty),ka=O(d.Function.prototype.call);
-O(d.Function.prototype.apply);var c=d.TypeError,G=d.RangeError,Z=d.Number,ha=Z.isNaN,f=d.Promise,F=O(f.prototype.then),C=f.resolve.bind(f),n=f.reject.bind(f),ja=function(a){return a+" must be a function or undefined"};l(v.prototype,"locked",{enumerable:!1,configurable:!0,get:function(){if(!1===B(this))throw new c("Illegal invocation");return I(this)}});l(v.prototype,"cancel",{enumerable:!1,configurable:!0,writable:!0,value:function(a){return!1===B(this)?n(new c("Illegal invocation")):!0===I(this)?
-n(new c("Cannot cancel a readable stream that is locked to a reader")):S(this,a)}});l(v.prototype,"getReader",{enumerable:!1,configurable:!0,writable:!0,value:function(a){a=(a===e?{}:a).mode;if(!1===B(this))throw new c("Illegal invocation");if("byob"===a)throw new c("This readable stream does not support BYOB readers");if(a===e)return X(this);throw new G('Invalid reader mode given: expected undefined or "byob"');}});l(v.prototype,"pipeThrough",{enumerable:!1,configurable:!0,writable:!0,value:function(a,
-b){throw new c("pipeThrough not implemented");}});l(v.prototype,"pipeTo",{enumerable:!1,configurable:!0,writable:!0,value:function(a){throw new c("pipeTo not implemented");}});l(v.prototype,"tee",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!1===B(this))throw new c("Illegal invocation");return ia(this)}});l(L.prototype,"desiredSize",{enumerable:!1,configurable:!0,get:function(){if(!1===J(this,k))throw new c("Illegal invocation");return aa(this)}});l(L.prototype,"close",{enumerable:!1,
-configurable:!0,writable:!0,value:function(){if(!1===J(this,k))throw new c("Illegal invocation");var a=this[k];if(this[g]&2)throw new c("Cannot close a readable stream that has already been requested to be closed");a=h(a);if(2===a)throw new c("Cannot close an errored readable stream");if(1===a)throw new c("Cannot close a closed readable stream");return T(this)}});l(L.prototype,"enqueue",{enumerable:!1,configurable:!0,writable:!0,value:function(a){if(!1===J(this,k))throw new c("Illegal invocation");
-var b=this[k];if(this[g]&2)throw new c("Cannot enqueue a chunk into a readable stream that is closed or has been requested to be closed");b=h(b);if(2===b)throw new c("Cannot enqueue a chunk into an errored readable stream");if(1===b)throw new c("Cannot enqueue a chunk into a closed readable stream");return U(this,a)}});l(L.prototype,"error",{enumerable:!1,configurable:!0,writable:!0,value:function(a){if(!1===J(this,k))throw new c("Illegal invocation");var b=h(this[k]);if(2===b)throw new c("Cannot error a readable stream that is already errored");
-if(1===b)throw new c("Cannot error a close readable stream");return A(this,a)}});l(N.prototype,"closed",{enumerable:!1,configurable:!0,get:function(){return!1===D(this)?n(new c("Illegal invocation")):this[t]}});l(N.prototype,"cancel",{enumerable:!1,configurable:!0,writable:!0,value:function(a){return!1===D(this)?n(new c("Illegal invocation")):this[x]===e?n(new c("This readable stream reader has been released and cannot be used to cancel its previous owner stream")):S(this[x],a)}});l(N.prototype,"read",
-{enumerable:!1,configurable:!0,writable:!0,value:function(){return!1===D(this)?n(new c("Illegal invocation")):this[x]===e?n(new c("This readable stream reader has been released and cannot be used to read from its previous owner stream")):ba(this)}});l(N.prototype,"releaseLock",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!1===D(this))throw new c("Illegal invocation");if(this[x]===e)return e;if(0<this[r].length)throw new c("Cannot release a readable stream reader when it still has outstanding read() calls that have not yet settled");
-if(0===h(this[x])){var a=new c("This readable stream reader has been released and cannot be used to monitor the stream's state");this[t][Q](a)}else this[t]=n(new c("This readable stream reader has been released and cannot be used to monitor the stream's state"));V(this[t]);this[x][u]=e;this[x]=e}});l(d,"ReadableStream",{value:v,enumerable:!1,configurable:!0,writable:!0});d.AcquireReadableStreamDefaultReader=X;d.IsReadableStream=B;d.IsReadableStreamDisturbed=function(a){return a[p]&1};d.IsReadableStreamLocked=
-I;d.IsReadableStreamReadable=function(a){return 0===h(a)};d.IsReadableStreamClosed=function(a){return 1===h(a)};d.IsReadableStreamErrored=function(a){return 2===h(a)};d.IsReadableStreamDefaultReader=D;d.ReadableStreamDefaultReaderRead=ba;d.ReadableStreamTee=ia;d.ReadableStreamDefaultControllerClose=T;d.ReadableStreamDefaultControllerGetDesiredSize=aa;d.ReadableStreamDefaultControllerEnqueue=U;d.ReadableStreamDefaultControllerError=A})(this);
\ No newline at end of file
+'use strict';(function(d){function O(a){return function(b){return a.apply(b,la.call(arguments,1))}}function U(){var a,b,g=new ma(function(g,e){a=g;b=e});g[E]=a;g[Q]=b;return g}function V(a){try{F(a,e,function(){})}catch(b){}}function q(){this.back=this.front={elements:new ca,next:e};this.size=this.cursor=0}function v(a,b,g){a=a===e?{}:a;var c=b===e?{}:b;b=c.size;c=c.highWaterMark;c===e&&(c=1);this[p]=0;this[p]=this[p]&-7|0;this[u]=e;this[K]=e;this[y]=e;var d=a.type;if("bytes"===String(d))throw new G("bytes type is not yet implemented");
+if(d!==e)throw new G("Invalid type is specified");this[y]=new L(this,a,b,c,g)}function L(a,b,g,d){if(!1===B(a))throw new c("Illegal constructor");if(a[y]!==e)throw new c("Illegal constructor");this[l]=a;this[W]=b;this[z]=new q;this[H]=0;this[h]=0;g=na(g,d);this[da]=g.size;this[ea]=g.highWaterMark;var P=this;b=oa(b,"start",this,"underlyingSource.start");F(C(b),function(){P[h]|=1;M(P)},function(b){0===k(a)&&A(P,b)})}function pa(a,b){a[z]=new q;return fa(a[W],"cancel",b,"underlyingSource.cancel")}function N(a){if(!1===
+B(a))throw new c("ReadableStreamReader constructor argument is not a readable stream");if(!0===I(a))throw new c("ReadableStreamReader constructor can only accept readable streams that are not yet locked to a reader");this[x]=a;a[u]=this;switch(k(a)){case 0:this[t]=U();break;case 1:this[t]=C(e);break;case 2:this[t]=n(a[K]),V(this[t])}this[r]=new q}function X(a){return new N(a)}function R(a,b){a[p]|=1;var g=k(a);if(1===g)return C(e);if(2===g)return n(a[K]);Y(a);a=pa(a[y],b);return F(a,function(){return e})}
+function S(a){var b=a[l];a[h]|=2;0===a[z].length&&Y(b)}function T(a,b){var g=a[l];if(!0===I(g)&&0<g[u][r].length)g[u][r].shift()[E]({value:b,done:!1});else{var c=1,d=a[da];if(d!==e)try{c=d(b)}catch(w){throw 0===k(g)&&A(a,w),w;}try{c=Z(c);if(ha(c)||c===+qa||0>c)throw new G("The return value of a queuing strategy's size function must be a finite, non-NaN, non-negative number");a[H]+=c;a[z].push({value:b,size:c})}catch(w){throw 0===k(g)&&A(a,w),w;}}M(a)}function k(a){return(a[p]&6)>>1}function A(a,b){a[z]=
+new q;ra(a[l],b)}function ra(a,b){a[K]=b;a[p]=a[p]&-7|4;a=a[u];if(a===e)return e;!0===D(a)&&(a[r].forEach(function(a){a[Q](b)}),a[r]=new q);a[t][Q](b);V(a[t])}function Y(a){a[p]=a[p]&-7|2;a=a[u];if(a===e)return e;!0===D(a)&&(a[r].forEach(function(a){a[E]({value:e,done:!0})}),a[r]=new q);a[t][E](e)}function aa(a){var b=k(a[l]);return 1===b?0:2===b?null:a[ea]-a[H]}function B(a){return J(a,y)}function I(a){return a[u]!==e}function D(a){return J(a,r)}function ba(a){a=a[x];a[p]|=1;if(1===k(a))return C({value:e,
+done:!0});if(2===k(a))return n(a[K]);a=a[y];var b=a[l];if(0<a[z].length){var c=a[z].shift();a[H]-=c.size;c=c.value;a[h]&2&&0===a[z].length?Y(b):M(a);a=C({value:c,done:!1})}else c=U(),b[u][r].push(c),M(a),a=c;return a}function M(a){if(!1===sa(a))return e;if(a[h]&4)return a[h]|=8,e;a[h]|=4;var b=fa(a[W],"pull",a,"underlyingSource.pull");F(b,function(){a[h]&=-5;a[h]&8&&(a[h]&=-9,M(a))},function(b){0===k(a[l])&&A(a,b)})}function sa(a){var b=a[l],c=k(b);return 1===c||2===c||a[h]&2||!(a[h]&1)?!1:!0===I(b)&&
+0<b[u][r].length||0<aa(a)?!0:!1}function ia(a){function b(){return F(ba(c),function(a){var b=a.value;!0===a.done&&!1===d&&(!1===f&&S(q),!1===h&&S(r),d=!0);!0!==d&&(!1===f&&T(q,b),!1===h&&T(r,b))})}var c=X(a),d=!1,f=!1,h=!1,k,m,l=U(),n=new v({pull:b,cancel:function(b){f=!0;k=b;!0===h&&(b=R(a,[k,m]),l[E](b));return l}}),p=new v({pull:b,cancel:function(b){h=!0;m=b;!0===f&&(b=R(a,[k,m]),l[E](b));return l}}),q=n[y],r=p[y];F(c[t],e,function(a){!0!==d&&(A(q,a),A(r,a),d=!0)});return[n,p]}function na(a,b){if(a!==
+e&&"function"!==typeof a)throw new c("A queuing strategy's size property must be a function");b=Z(b);if(ha(b))throw new G("A queueing strategy's highWaterMark property must be a nonnegative, non-NaN number");if(0>b)throw new G("A queueing strategy's highWaterMark property must be a nonnegative, non-NaN number");return{size:a,highWaterMark:b}}function oa(a,b,d,f){b=a[b];if(b===e)return e;if("function"!==typeof b)throw new c(ja(f));return ka(b,a,d)}function fa(a,b,d,f){try{var g=a[b]}catch(w){return n(w)}if(g===
+e)return C(e);if("function"!==typeof g)return n(new c(ja(f)));try{return C(ka(g,a,d))}catch(w){return n(w)}}var m=d.Object.defineProperty,ca=d.Array,f=d.Symbol,la=d.Array.prototype.slice,ma=d.Promise,E=f("[[Resolve]]"),Q=f("[[Reject]]");m(q.prototype,"length",{get:function(){return this.size}});q.prototype.push=function(a){++this.size;if(16384===this.back.elements.length){var b=this.back;this.back={elements:new ca,next:e};b.next=this.back}this.back.elements.push(a)};q.prototype.shift=function(){--this.size;
+this.front.elements.length===this.cursor&&(this.front=this.front.next,this.cursor=0);var a=this.front.elements[this.cursor];this.front.elements[this.cursor]=e;++this.cursor;return a};q.prototype.forEach=function(a){for(var b=this.cursor,c=this.front,d=c.elements;b!==d.length||c.next!==e;)b===d.length&&(c=c.next,d=c.elements,b=0),a(d[b]),++b};q.prototype.peek=function(){return this.front.elements.length===this.cursor?this.front.next.elements[0]:this.front.elements[this.cursor]};var u=f("[[reader]]"),
+K=f("[[storedError]]"),y=f("[[controller]]"),t=f("[[closedPromise]]"),x=f("[[ownerReadableStream]]"),r=f("[[readRequests]]"),p=f("bit field for [[state]] and [[disturbed]]"),W=f("[[underlyingSource]]"),l=f("[[controlledReadableStream]]"),z=f("[[queue]]"),H=f("[[totalQueuedSize]]"),da=f("[[strategySize]]"),ea=f("[[strategyHWM]]"),h=f("bit field for [[started]], [[closeRequested]], [[pulling]], [[pullAgain]]"),e=d.undefined,qa=d.Infinity,J=O(d.Object.hasOwnProperty),ka=O(d.Function.prototype.call);
+O(d.Function.prototype.apply);var c=d.TypeError,G=d.RangeError,Z=d.Number,ha=Z.isNaN;f=d.Promise;var F=O(f.prototype.then),C=f.resolve.bind(f),n=f.reject.bind(f),ja=function(a){return a+" must be a function or undefined"};m(v.prototype,"locked",{enumerable:!1,configurable:!0,get:function(){if(!1===B(this))throw new c("Illegal invocation");return I(this)}});m(v.prototype,"cancel",{enumerable:!1,configurable:!0,writable:!0,value:function(a){return!1===B(this)?n(new c("Illegal invocation")):!0===I(this)?
+n(new c("Cannot cancel a readable stream that is locked to a reader")):R(this,a)}});m(v.prototype,"getReader",{enumerable:!1,configurable:!0,writable:!0,value:function(a){a=(a===e?{}:a).mode;if(!1===B(this))throw new c("Illegal invocation");if("byob"===a)throw new c("This readable stream does not support BYOB readers");if(a===e)return X(this);throw new G('Invalid reader mode given: expected undefined or "byob"');}});m(v.prototype,"pipeThrough",{enumerable:!1,configurable:!0,writable:!0,value:function(a,
+b){throw new c("pipeThrough not implemented");}});m(v.prototype,"pipeTo",{enumerable:!1,configurable:!0,writable:!0,value:function(a){throw new c("pipeTo not implemented");}});m(v.prototype,"tee",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!1===B(this))throw new c("Illegal invocation");return ia(this)}});m(L.prototype,"desiredSize",{enumerable:!1,configurable:!0,get:function(){if(!1===J(this,l))throw new c("Illegal invocation");return aa(this)}});m(L.prototype,"close",{enumerable:!1,
+configurable:!0,writable:!0,value:function(){if(!1===J(this,l))throw new c("Illegal invocation");var a=this[l];if(this[h]&2)throw new c("Cannot close a readable stream that has already been requested to be closed");a=k(a);if(2===a)throw new c("Cannot close an errored readable stream");if(1===a)throw new c("Cannot close a closed readable stream");return S(this)}});m(L.prototype,"enqueue",{enumerable:!1,configurable:!0,writable:!0,value:function(a){if(!1===J(this,l))throw new c("Illegal invocation");
+var b=this[l];if(this[h]&2)throw new c("Cannot enqueue a chunk into a readable stream that is closed or has been requested to be closed");b=k(b);if(2===b)throw new c("Cannot enqueue a chunk into an errored readable stream");if(1===b)throw new c("Cannot enqueue a chunk into a closed readable stream");return T(this,a)}});m(L.prototype,"error",{enumerable:!1,configurable:!0,writable:!0,value:function(a){if(!1===J(this,l))throw new c("Illegal invocation");var b=k(this[l]);if(2===b)throw new c("Cannot error a readable stream that is already errored");
+if(1===b)throw new c("Cannot error a close readable stream");return A(this,a)}});m(N.prototype,"closed",{enumerable:!1,configurable:!0,get:function(){return!1===D(this)?n(new c("Illegal invocation")):this[t]}});m(N.prototype,"cancel",{enumerable:!1,configurable:!0,writable:!0,value:function(a){return!1===D(this)?n(new c("Illegal invocation")):this[x]===e?n(new c("This readable stream reader has been released and cannot be used to cancel its previous owner stream")):R(this[x],a)}});m(N.prototype,"read",
+{enumerable:!1,configurable:!0,writable:!0,value:function(){return!1===D(this)?n(new c("Illegal invocation")):this[x]===e?n(new c("This readable stream reader has been released and cannot be used to read from its previous owner stream")):ba(this)}});m(N.prototype,"releaseLock",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!1===D(this))throw new c("Illegal invocation");if(this[x]===e)return e;if(0<this[r].length)throw new c("Cannot release a readable stream reader when it still has outstanding read() calls that have not yet settled");
+if(0===k(this[x])){var a=new c("This readable stream reader has been released and cannot be used to monitor the stream's state");this[t][Q](a)}else this[t]=n(new c("This readable stream reader has been released and cannot be used to monitor the stream's state"));V(this[t]);this[x][u]=e;this[x]=e}});m(d,"ReadableStream",{value:v,enumerable:!1,configurable:!0,writable:!0});d.AcquireReadableStreamDefaultReader=X;d.IsReadableStream=B;d.IsReadableStreamDisturbed=function(a){return a[p]&1};d.IsReadableStreamLocked=
+I;d.IsReadableStreamReadable=function(a){return 0===k(a)};d.IsReadableStreamClosed=function(a){return 1===k(a)};d.IsReadableStreamErrored=function(a){return 2===k(a)};d.IsReadableStreamDefaultReader=D;d.ReadableStreamDefaultReaderRead=ba;d.ReadableStreamTee=ia;d.ReadableStreamDefaultControllerClose=S;d.ReadableStreamDefaultControllerGetDesiredSize=aa;d.ReadableStreamDefaultControllerEnqueue=T;d.ReadableStreamDefaultControllerError=A})(this);
\ No newline at end of file
diff --git a/src/cobalt/streams/readable_stream.js b/src/cobalt/streams/readable_stream.js
index 27915ef..611a889 100644
--- a/src/cobalt/streams/readable_stream.js
+++ b/src/cobalt/streams/readable_stream.js
@@ -29,26 +29,23 @@
     }
   }
 
-  const v8_PromiseBase = global.Promise;
+  const PromiseBase = global.Promise;
   const _promiseResolve = v8_createPrivateSymbol('[[Resolve]]');
   const _promiseReject = v8_createPrivateSymbol('[[Reject]]');
 
-  function v8_Promise() {
-    var that = this;
-    v8_PromiseBase.call(this, function(resolve, reject) {
-      that[_promiseResolve] = resolve;
-      that[_promiseReject] = reject;
-    });
-  }
-
-  v8_Promise.prototype = v8_PromiseBase.prototype;
-
   function v8_createPromise() {
-    return new v8_Promise();
+    let tempResolve, tempReject;
+    let promise = new PromiseBase(function(resolve, reject) {
+      tempResolve = resolve;
+      tempReject = reject;
+    });
+    promise[_promiseResolve] = tempResolve;
+    promise[_promiseReject] = tempReject;
+    return promise;
   }
 
   function v8_isPromise(obj) {
-    return obj instanceof v8_Promise;
+    return obj instanceof PromiseBase;
   }
 
   function v8_resolvePromise(promise, value) {
diff --git a/src/cobalt/websocket/web_socket.cc b/src/cobalt/websocket/web_socket.cc
index fd291bf..cdc9c7c 100644
--- a/src/cobalt/websocket/web_socket.cc
+++ b/src/cobalt/websocket/web_socket.cc
@@ -326,7 +326,7 @@
   }
   std::string error_message;
   bool success = impl_->SendBinary(reinterpret_cast<const char*>(blob->data()),
-                                   static_cast<std::size_t>(blob->size()),
+                                   static_cast<size_t>(blob->size()),
                                    &buffered_amount_, &error_message);
   if (!success) {
     DLOG(ERROR) << "Unable to send message: [" << error_message << "]";
@@ -334,7 +334,7 @@
 }
 
 // Implements spec at https://www.w3.org/TR/websockets/#dom-websocket-send.
-void WebSocket::Send(const scoped_refptr<dom::ArrayBuffer>& data,
+void WebSocket::Send(const script::Handle<script::ArrayBuffer>& data,
                      script::ExceptionState* exception_state) {
   DCHECK(thread_checker_.CalledOnValidThread());
   DCHECK(impl_);
@@ -342,21 +342,19 @@
     return;
   }
   std::string error_message;
-  dom::ArrayBuffer* array_buffer(data.get());
-  if (!array_buffer) {
+  if (data.IsEmpty()) {
     return;
   }
   bool success =
-      impl_->SendBinary(reinterpret_cast<const char*>(array_buffer->data()),
-                        static_cast<std::size_t>(array_buffer->byte_length()),
-                        &buffered_amount_, &error_message);
+      impl_->SendBinary(reinterpret_cast<const char*>(data->Data()),
+                        data->ByteLength(), &buffered_amount_, &error_message);
   if (!success) {
     DLOG(ERROR) << "Unable to send message: [" << error_message << "]";
   }
 }
 
 // Implements spect at https://www.w3.org/TR/websockets/#dom-websocket-send.
-void WebSocket::Send(const scoped_refptr<dom::ArrayBufferView>& data,
+void WebSocket::Send(const script::Handle<script::ArrayBufferView>& data,
                      script::ExceptionState* exception_state) {
   DCHECK(thread_checker_.CalledOnValidThread());
   DCHECK(impl_);
@@ -364,14 +362,12 @@
     return;
   }
   std::string error_message;
-  dom::ArrayBufferView* array_buffer_view(data.get());
-  if (!array_buffer_view) {
+  if (data.IsEmpty()) {
     return;
   }
-  bool success = impl_->SendBinary(
-      reinterpret_cast<const char*>(array_buffer_view->base_address()),
-      static_cast<std::size_t>(array_buffer_view->byte_length()),
-      &buffered_amount_, &error_message);
+  bool success =
+      impl_->SendBinary(reinterpret_cast<const char*>(data->RawData()),
+                        data->ByteLength(), &buffered_amount_, &error_message);
   if (!success) {
     DLOG(ERROR) << "Unable to send message: [" << error_message << "]";
   }
diff --git a/src/cobalt/websocket/web_socket.h b/src/cobalt/websocket/web_socket.h
index 1cc9630..7613d65 100644
--- a/src/cobalt/websocket/web_socket.h
+++ b/src/cobalt/websocket/web_socket.h
@@ -23,14 +23,14 @@
 #include "base/optional.h"
 #include "cobalt/base/compiler.h"
 #include "cobalt/base/tokens.h"
-#include "cobalt/dom/array_buffer.h"
-#include "cobalt/dom/array_buffer_view.h"
 #include "cobalt/dom/blob.h"
 #include "cobalt/dom/csp_delegate.h"
 #include "cobalt/dom/dom_exception.h"
 #include "cobalt/dom/dom_settings.h"
 #include "cobalt/dom/event_target.h"
 #include "cobalt/dom/message_event.h"
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/wrappable.h"
 #include "cobalt/websocket/web_socket_event_interface.h"
 #include "cobalt/websocket/web_socket_impl.h"
@@ -84,9 +84,9 @@
   void Send(const std::string& data, script::ExceptionState* exception_state);
   void Send(const scoped_refptr<dom::Blob>& data,
             script::ExceptionState* exception_state);
-  void Send(const scoped_refptr<dom::ArrayBuffer>& data,
+  void Send(const script::Handle<script::ArrayBuffer>& data,
             script::ExceptionState* exception_state);
-  void Send(const scoped_refptr<dom::ArrayBufferView>& data,
+  void Send(const script::Handle<script::ArrayBufferView>& data,
             script::ExceptionState* exception_state);
 
   // EventHandlers.
diff --git a/src/cobalt/websocket/web_socket.idl b/src/cobalt/websocket/web_socket.idl
index f4efaab..a0fbc3e 100644
--- a/src/cobalt/websocket/web_socket.idl
+++ b/src/cobalt/websocket/web_socket.idl
@@ -44,9 +44,7 @@
   [RaisesException] attribute DOMString binaryType;
   [RaisesException] void send(DOMString data);
   [RaisesException] void send(ArrayBuffer data);
-
-  // Blob is not currently supported in Cobalt.
-  // [RaisesException] void send(Blob data);
+  [RaisesException] void send(Blob data);
   // ArrayBufferViews translation is not well supported in Cobalt.
   // [RaisesException] void send(ArrayBufferView data);
 };
diff --git a/src/cobalt/xhr/xml_http_request.cc b/src/cobalt/xhr/xml_http_request.cc
index 6da2124..04f1cdc 100644
--- a/src/cobalt/xhr/xml_http_request.cc
+++ b/src/cobalt/xhr/xml_http_request.cc
@@ -194,7 +194,7 @@
   ChangeState(kUnsent);
 
   response_body_.Clear();
-  response_array_buffer_ = NULL;
+  response_array_buffer_reference_.reset();
 }
 
 // https://www.w3.org/TR/2014/WD-XMLHttpRequest-20140130/#the-open()-method
@@ -349,20 +349,21 @@
         request_headers_.SetHeader(net::HttpRequestHeaders::kContentType,
                                    "text/plain;charset=UTF-8");
       }
-    } else if (request_body->IsType<scoped_refptr<dom::ArrayBufferView> >()) {
-      scoped_refptr<dom::ArrayBufferView> view =
-          request_body->AsType<scoped_refptr<dom::ArrayBufferView> >();
-      if (view->byte_length()) {
-        const char* start = reinterpret_cast<const char*>(view->base_address());
-        request_body_text_.assign(start + view->byte_offset(),
-                                  view->byte_length());
+    } else if (request_body
+                   ->IsType<script::Handle<script::ArrayBufferView> >()) {
+      script::Handle<script::ArrayBufferView> view =
+          request_body->AsType<script::Handle<script::ArrayBufferView> >();
+      if (view->ByteLength()) {
+        const char* start = reinterpret_cast<const char*>(view->RawData());
+        request_body_text_.assign(start + view->ByteOffset(),
+                                  view->ByteLength());
       }
-    } else if (request_body->IsType<scoped_refptr<dom::ArrayBuffer> >()) {
-      scoped_refptr<dom::ArrayBuffer> array_buffer =
-          request_body->AsType<scoped_refptr<dom::ArrayBuffer> >();
-      if (array_buffer->byte_length()) {
-        const char* start = reinterpret_cast<const char*>(array_buffer->data());
-        request_body_text_.assign(start, array_buffer->byte_length());
+    } else if (request_body->IsType<script::Handle<script::ArrayBuffer> >()) {
+      script::Handle<script::ArrayBuffer> array_buffer =
+          request_body->AsType<script::Handle<script::ArrayBuffer> >();
+      if (array_buffer->ByteLength()) {
+        const char* start = reinterpret_cast<const char*>(array_buffer->Data());
+        request_body_text_.assign(start, array_buffer->ByteLength());
       }
     }
   } else {
@@ -505,8 +506,14 @@
     case kDefault:
     case kText:
       return ResponseType(response_text(exception_state));
-    case kArrayBuffer:
-      return ResponseType(response_array_buffer());
+    case kArrayBuffer: {
+      script::Handle<script::ArrayBuffer> maybe_array_buffer_response =
+          response_array_buffer();
+      if (maybe_array_buffer_response.IsEmpty()) {
+        return base::nullopt;
+      }
+      return ResponseType(maybe_array_buffer_response);
+    }
     case kJson:
     case kDocument:
     case kBlob:
@@ -706,9 +713,9 @@
   ChangeState(kLoading);
 
   if (fetch_callback_) {
-    scoped_refptr<dom::Uint8Array> data = new dom::Uint8Array(
-        settings_, reinterpret_cast<const uint8*>(download_data->data()),
-        static_cast<uint32>(download_data->size()), NULL);
+    script::Handle<script::Uint8Array> data =
+        script::Uint8Array::New(settings_->global_environment(),
+                                download_data->data(), download_data->size());
     fetch_callback_->value().Run(data);
   }
 
@@ -755,7 +762,7 @@
 void XMLHttpRequest::PrepareForNewRequest() {
   response_body_.Clear();
   request_headers_.Clear();
-  response_array_buffer_ = NULL;
+  response_array_buffer_reference_.reset();
   // Below are variables used for CORS.
   request_body_text_.clear();
   is_cross_origin_ = false;
@@ -890,7 +897,6 @@
 void XMLHttpRequest::TraceMembers(script::Tracer* tracer) {
   XMLHttpRequestEventTarget::TraceMembers(tracer);
 
-  tracer->Trace(response_array_buffer_);
   tracer->Trace(upload_);
 }
 
@@ -982,22 +988,29 @@
   }
 }
 
-scoped_refptr<dom::ArrayBuffer> XMLHttpRequest::response_array_buffer() {
+script::Handle<script::ArrayBuffer> XMLHttpRequest::response_array_buffer() {
   TRACK_MEMORY_SCOPE("XHR");
   // https://www.w3.org/TR/XMLHttpRequest/#response-entity-body
   if (error_ || state_ != kDone) {
-    return NULL;
+    // Return a handle holding a nullptr.
+    return script::Handle<script::ArrayBuffer>();
   }
-  if (!response_array_buffer_) {
+  if (!response_array_buffer_reference_) {
     // The request is done so it is safe to only keep the ArrayBuffer and clear
     // |response_body_|.  As |response_body_| will not be used unless the
     // request is re-opened.
-    response_array_buffer_ =
-        new dom::ArrayBuffer(settings_, response_body_.data(),
-                             static_cast<uint32>(response_body_.size()));
+    auto array_buffer =
+        script::ArrayBuffer::New(settings_->global_environment(),
+                                 response_body_.data(), response_body_.size());
+    response_array_buffer_reference_.reset(
+        new script::ScriptValue<script::ArrayBuffer>::Reference(this,
+                                                                array_buffer));
     response_body_.Clear();
+    return array_buffer;
+  } else {
+    return script::Handle<script::ArrayBuffer>(
+        *response_array_buffer_reference_);
   }
-  return response_array_buffer_;
 }
 
 void XMLHttpRequest::UpdateProgress() {
diff --git a/src/cobalt/xhr/xml_http_request.h b/src/cobalt/xhr/xml_http_request.h
index c7b786a..e0980ea 100644
--- a/src/cobalt/xhr/xml_http_request.h
+++ b/src/cobalt/xhr/xml_http_request.h
@@ -22,15 +22,15 @@
 #include "base/gtest_prod_util.h"
 #include "base/optional.h"
 #include "base/timer.h"
-#include "cobalt/dom/array_buffer.h"
-#include "cobalt/dom/array_buffer_view.h"
 #include "cobalt/dom/csp_delegate.h"
 #include "cobalt/dom/document.h"
 #include "cobalt/dom/dom_exception.h"
-#include "cobalt/dom/uint8_array.h"
 #include "cobalt/loader/cors_preflight.h"
 #include "cobalt/loader/net_fetcher.h"
+#include "cobalt/script/array_buffer.h"
+#include "cobalt/script/array_buffer_view.h"
 #include "cobalt/script/environment_settings.h"
+#include "cobalt/script/typed_arrays.h"
 #include "cobalt/script/union_type.h"
 #include "cobalt/xhr/xhr_response_data.h"
 #include "cobalt/xhr/xml_http_request_event_target.h"
@@ -59,11 +59,13 @@
   // EnvironmentSettings so that JSC doesn't need to know about dom.
   explicit XMLHttpRequest(script::EnvironmentSettings* settings);
 
-  typedef script::UnionType2<std::string, scoped_refptr<dom::ArrayBuffer> >
+  typedef script::UnionType2<std::string, script::Handle<script::ArrayBuffer> >
       ResponseType;
 
-  typedef script::UnionType3<std::string, scoped_refptr<dom::ArrayBufferView>,
-                             scoped_refptr<dom::ArrayBuffer> > RequestBodyType;
+  typedef script::UnionType3<std::string,
+                             script::Handle<script::ArrayBufferView>,
+                             script::Handle<script::ArrayBuffer> >
+      RequestBodyType;
 
   enum State {
     kUnsent = 0,
@@ -131,8 +133,9 @@
             script::ExceptionState* exception_state);
 
   // FetchAPI: replacement for Send() when fetch functionality is required.
-  typedef script::CallbackFunction<
-      void(const scoped_refptr<dom::Uint8Array>& data)> FetchUpdateCallback;
+  typedef script::CallbackFunction<void(
+      const script::Handle<script::Uint8Array>& data)>
+      FetchUpdateCallback;
   typedef script::CallbackFunction<void(bool)> FetchModeCallback;
   typedef script::ScriptValue<FetchUpdateCallback> FetchUpdateCallbackArg;
   typedef script::ScriptValue<FetchModeCallback> FetchModeCallbackArg;
@@ -180,9 +183,6 @@
 
   // Called from bindings layer to tie objects' lifetimes to this XHR instance.
   XMLHttpRequestUpload* upload_or_null() { return upload_.get(); }
-  dom::ArrayBuffer* response_array_buffer_or_null() {
-    return response_array_buffer_.get();
-  }
 
   friend std::ostream& operator<<(std::ostream& os, const XMLHttpRequest& xhr);
   DEFINE_WRAPPABLE_TYPE(XMLHttpRequest);
@@ -212,7 +212,7 @@
   // Update the internal ready state and fire events.
   void ChangeState(State new_state);
   // Return array buffer response body as an ArrayBuffer.
-  scoped_refptr<dom::ArrayBuffer> response_array_buffer();
+  script::Handle<script::ArrayBuffer> response_array_buffer();
 
   void UpdateProgress();
 
@@ -255,7 +255,8 @@
   scoped_ptr<net::URLFetcher> url_fetcher_;
   scoped_refptr<net::HttpResponseHeaders> http_response_headers_;
   XhrResponseData response_body_;
-  scoped_refptr<dom::ArrayBuffer> response_array_buffer_;
+  scoped_ptr<script::ScriptValue<script::ArrayBuffer>::Reference>
+      response_array_buffer_reference_;
   scoped_refptr<XMLHttpRequestUpload> upload_;
 
   std::string mime_type_override_;
diff --git a/src/net/socket/transport_client_socket_pool.cc b/src/net/socket/transport_client_socket_pool.cc
index 84e89c8..39b5970 100644
--- a/src/net/socket/transport_client_socket_pool.cc
+++ b/src/net/socket/transport_client_socket_pool.cc
@@ -171,6 +171,16 @@
 
 int TransportConnectJob::DoResolveHostComplete(int result) {
   if (result == OK) {
+#ifdef STARBOARD
+    // Preferentially connect to an IPv4 address first, if available. Some
+    // hosts may have IPv6 addresses to which we can connect, but the read
+    // may still fail if the network is not properly configured. The existing
+    // code has a fallback mechanism to try different IPs in |addresses_|
+    // when connection fails. However, in this case, a connection can be made
+    // with the IPv6 address, but the read fails.
+    MakeAddressListStartWithIPv4(&addresses_);
+#endif
+
     // Invoke callback, and abort if it fails.
     if (!params_->host_resolution_callback().is_null())
       result = params_->host_resolution_callback().Run(addresses_, net_log());
diff --git a/src/net/socket/transport_client_socket_pool_unittest.cc b/src/net/socket/transport_client_socket_pool_unittest.cc
index aefe79c..0edd219 100644
--- a/src/net/socket/transport_client_socket_pool_unittest.cc
+++ b/src/net/socket/transport_client_socket_pool_unittest.cc
@@ -1123,6 +1123,10 @@
   host_resolver_->set_synchronous_mode(false);
 }
 
+// Disable this test since the TransportConnectJob::DoResolveHostComplete
+// customization causes the IPv4 address to be tried first, thus breaking
+// the assumptions of this test.
+#ifndef STARBOARD
 // Test the case of the IPv6 address stalling, and falling back to the IPv4
 // socket which finishes first.
 TEST_F(TransportClientSocketPoolTest, IPv6FallbackSocketIPv4FinishesFirst) {
@@ -1164,7 +1168,12 @@
   EXPECT_EQ(kIPv4AddressSize, endpoint.address().size());
   EXPECT_EQ(2, client_socket_factory_.allocation_count());
 }
+#endif  // STARBOARD
 
+// Disable this test since the TransportConnectJob::DoResolveHostComplete
+// customization causes the IPv4 address to be tried first, thus breaking
+// the assumptions of this test.
+#ifndef STARBOARD
 // Test the case of the IPv6 address being slow, thus falling back to trying to
 // connect to the IPv4 address, but having the connect to the IPv6 address
 // finish first.
@@ -1209,6 +1218,7 @@
   EXPECT_EQ(kIPv6AddressSize, endpoint.address().size());
   EXPECT_EQ(2, client_socket_factory_.allocation_count());
 }
+#endif  // STARBOARD
 
 TEST_F(TransportClientSocketPoolTest, IPv6NoIPv4AddressesToFallbackTo) {
   // Create a pool without backup jobs.
diff --git a/src/starboard/CHANGELOG.md b/src/starboard/CHANGELOG.md
index 5fd84c7..d55e4d3 100644
--- a/src/starboard/CHANGELOG.md
+++ b/src/starboard/CHANGELOG.md
@@ -8,6 +8,12 @@
 
 **NOTE: Starboard versions 3 and below are no longer supported.**
 
+## Experimental Version
+
+A description of all changes currently in the experimental Starboard version
+can be found in the comments of the "Experimental Feature Defines" section of
+[configuration.h](configuration.h).
+
 ## Version 10
 
 ### Add support for multiple versions of ffmpeg
diff --git a/src/starboard/configuration.h b/src/starboard/configuration.h
index 4dcb0ff..a709251 100644
--- a/src/starboard/configuration.h
+++ b/src/starboard/configuration.h
@@ -68,38 +68,60 @@
 //   //   exposes functionality for my new feature.
 //   #define SB_MY_EXPERIMENTAL_FEATURE_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// API version where compiling player_filter_tests is required.
+// Add support for player_filter_tests.
+//   Require compiling 'player_filter_tests' test target sources on all
+//   platforms, including audio_decoder_tests.cc and video_decoder_test.cc. For
+//   this Starboard API version and beyond, SB_HAS(PLAYER_FILTER_TESTS) is true.
 #define SB_PLAYER_FILTER_TESTS_REQUIRED_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// API version where SbMediaTime is deprecated (for SbTime).
+// Deprecate SbMediaTime for SbTime.
+//   SbMediaTime, which is 90khz based, was used to represent timestamps and
+//   duration related to SbPlayer.  As most of the platforms represent video
+//   related times in milliseconds or microseconds, this causes a lot of
+//   otherwise unnecessary conversion.  Now all timestamps and duration related
+//   to SbPlayer are represented by SbTime directly.
 #define SB_DEPRECATE_SB_MEDIA_TIME_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// Minimum API version where supporting player error messages is required.
+// Add support for player error messages.
 #define SB_PLAYER_ERROR_MESSAGE_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// Minimum API version for supporting system-level closed caption settings.
+// Add support for system-level closed caption settings.
+//   SbAccessibilityGetCaptionSettings() and SbAccessibilitySetCaptionsEnabled()
+//   along with a number of supporting structure definitions have been added
+//   to accessibility.h.  Platform need to define SB_HAS_CAPTIONS to 1 in order
+//   to enable the interface.
 #define SB_ACCESSIBILITY_CAPTIONS_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// Minimum API version where supporting audioless video playback is required.
+// Add support for audioless video playback.
+//   SbPlayer can be created with only a video track, without any accompanying
+//   audio track.  The SbPlayer implementation must now be able to play back
+//   a sole video track.
 #define SB_AUDIOLESS_VIDEO_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// Minimum API version where supporting audio only video playback is required.
+// Add support for audio only video playback.
+//   SbPlayer can be created with only an audio track, without any accompanying
+//   video track.  The SbPlayer implementation must now be able to play back
+//   a sole audio track.
 #define SB_AUDIO_ONLY_VIDEO_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// Minimum API version where calling SbPlayerCreate mutiple times (without
-// calling SbPlayerDestroy in between) must not crash, and likewise calling
-// SbAudioSinkCreate multiple times (without calling SbAudioSinkDestroy in
-// between) must not crash. SbPlayerCreate may return kSbPlayerInvalid if
-// additional players are not supported. SbAudioSinkCreate may return
-// kSbAudionSinkInvalid if additional audio sinks are not supported.
+// Require support for creating multiple SbPlayer instances.
+// Formerly, there were no tests ensuring that calling SbPlayerCreate multiple
+// times (without calling SbPlayerDestroy in between) would not crash, and
+// likewise no tests ensuring that calling SbAudioSinkCreate multiple times
+// (without calling SbAudioSinkDestroy in between) would not crash.
+// SbPlayerCreate may return kSbPlayerInvalid if additional players are not
+// supported. SbAudioSinkCreate may return kSbAudionSinkInvalid if additional
+// audio sinks are not supported.
 #define SB_MULTI_PLAYER_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// API version where passing NULL callbacks to SbPlayerCreate or
-// SbPlayerCreateWithUrl or SbDrmCreateSystem must result in invalid return
-// (|kSbPlayerInvalid| or |kSbDrmSystemInvalid| appropriately).
+// Require stricter error handling on calls some SbPlayer* calls.
+// Specifically, SbPlayerCreate,  SbPlayerCreateWithUrl and SbDrmCreateSystem
+// must result in invalid return values (e.g. |kSbPlayerInvalid| or
+// |kSbDrmSystemInvalid| appropriately).
 #define SB_NULL_CALLBACKS_INVALID_RETURN_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// API version where the following DRM refinements are available.
+// Refine the DRM API.
+// Specifically, the following changes have been made:
 //   1. Add a callback to SbDrmCreateSystem that allows a DRM system to
 //      signal that a DRM session has closed from the Starboard layer.
 //      Previously, DRM sessions could only be closed from the application
@@ -110,30 +132,30 @@
 //      individualization, license renewal, and license release.
 #define SB_DRM_REFINEMENT_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// API version where kSbSystemPathSourceDirectory is removed.
+// Remove kSbSystemPathSourceDirectory.
 //   Test code looking for its static input files should instead use the `test`
 //   subdirectory in kSbSystemPathContentDirectory.
 #define SB_PATH_SOURCE_DIR_REMOVED_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// API version where kSbSystemPropertyPlatformUuid is removed.
+// Remove kSbSystemPropertyPlatformUuid.
 //   This property was only ever used in platforms using `in_app_dial`.
 //   The only usage of this system property was replaced with a
 //   self-contained mechanism.
 #define SB_PROPERTY_UUID_REMOVED_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// API version where kSbMediaAudioSampleTypeInt16 is deprecated.
+// Deprecate kSbMediaAudioSampleTypeInt16.
 //   SB_HAS_QUIRK_SUPPORT_INT16_AUDIO_SAMPLES has to be defined to continue
 //   support int16 audio samples after this version.
 #define SB_DEPRECATE_INT16_AUDIO_SAMPLE_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// API version where SbSystemSupportsResume() is supported.
+// Add support for SbSystemSupportsResume().
 //   Platforms doesn't need to resume after suspend can return false in
 //   SbSystemSupportsResume() to free up the resource used by resume after
 //   suspend.
 //   Please see the comment in system.h for more details.
 #define SB_ALLOW_DISABLE_RESUME_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// Minimum API version for supporting the kSbKeyMicrophone keycode
+// Support the kSbKeyMicrophone keycode.
 #define SB_MICROPHONE_KEY_CODE_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
 // Add support for new decode target type,
@@ -143,27 +165,35 @@
 #define SB_10_BIT_YUV_I420_DECODE_TARGET_SUPPORT_API_VERSION \
   SB_EXPERIMENTAL_API_VERSION
 
-// API version where SbAudioSinkConsumeFramesFunc() can optional take an
-//   absolute timestamp to indicate when the frames are consumed.
+// Optionally provide absolute timestamp to SbAudioSinkConsumeFramesFunc().
+//   SbAudioSinkConsumeFramesFunc() can now optionally accept an absolute
+//   timestamp parameter that indicates when the frames are consumed.
 //   Platforms that have the |frames_consumed| updated asynchronously can have
 //   more accurate audio time reporting with this extra parameter.
 //   Please see the comment in audio_sink.h for more details.
 #define SB_ASYNC_AUDIO_FRAMES_REPORTING_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// API version where SbAtomic8 type and memory access functions for it are
-//   introduced. They are required to be implemented if a platform wants to use
-//   V8 as its JavaScript engine.
+// Add support for the SbAtomic8 type and memory access functions.
 #define SB_INTRODUCE_ATOMIC8_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// API version where SbMemoryProtect was introduced.  Allows memory
-//   permissions to be changed with `SbMemoryProtect` after they are mapped
-//   with `SbMemoryMap`.
+// Introduce SbMemoryProtect().
+//   SbMemoryProtect() allows memory access permissions to be changed after they
+//   have been mapped with `SbMemoryMap`.
 #define SB_MEMORY_PROTECT_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
-// API version where SbInputData allows propagating a |timestamp| for the input
-//   event to the dom Event.
+// Add a |timestamp| field to SbInputData.
+//   This allows platforms to provide more precise information on exactly when
+//   an input event was generated.  Note that if
+//   SbSystemHasCapability(kSbSystemCapabilitySetsInputTimestamp) returns false,
+//   the |timestamp| field of SbInputData should be ignored by applications.
 #define SB_INPUT_TIMESTAMP_API_VERSION SB_EXPERIMENTAL_API_VERSION
 
+// Introduces kSbMemoryMapProtectReserved flag.
+//    kSbMemoryMapProtectReserved, which is SbMemoryMapFlags(0), when used on
+//    a memory region, only reserves its virtual address space that's not
+//    accessible.
+#define SB_MEMORY_PROTECT_RESERVED_FLAG_API_VERSION SB_EXPERIMENTAL_API_VERSION
+
 // --- Release Candidate Feature Defines -------------------------------------
 
 // --- Common Detected Features ----------------------------------------------
diff --git a/src/starboard/contrib/tizen/armv7l/atomic_public.h b/src/starboard/contrib/tizen/armv7l/atomic_public.h
index b1adbbe..294b646 100644
--- a/src/starboard/contrib/tizen/armv7l/atomic_public.h
+++ b/src/starboard/contrib/tizen/armv7l/atomic_public.h
@@ -1,18 +1,16 @@
-/*
- * Copyright 2016 Samsung Electronics. 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 Samsung Electronics. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
 
 #ifndef STARBOARD_CONTRIB_TIZEN_ARMV7L_ATOMIC_PUBLIC_H_
 #define STARBOARD_CONTRIB_TIZEN_ARMV7L_ATOMIC_PUBLIC_H_
diff --git a/src/starboard/contrib/tizen/armv7l/configuration_public.h b/src/starboard/contrib/tizen/armv7l/configuration_public.h
index e59b7ee..18ec4ea 100644
--- a/src/starboard/contrib/tizen/armv7l/configuration_public.h
+++ b/src/starboard/contrib/tizen/armv7l/configuration_public.h
@@ -12,18 +12,14 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// The Starboard configuration for armv7l Tizen. Other devices will have
-// specific Starboard implementations, even if they ultimately are running some
-// version of Tizen.
-
-// Other source files should never include this header directly, but should
-// include the generic "starboard/configuration.h" instead.
-
 #ifndef STARBOARD_CONTRIB_TIZEN_ARMV7L_CONFIGURATION_PUBLIC_H_
 #define STARBOARD_CONTRIB_TIZEN_ARMV7L_CONFIGURATION_PUBLIC_H_
 
 // The API version implemented by this platform.
-#define SB_API_VERSION 4
+#define SB_API_VERSION 6
+
+// The tizen policy version
+#define SB_TIZEN_POLICY_VERSION 4
 
 // --- Architecture Configuration --------------------------------------------
 
@@ -106,6 +102,14 @@
 
 // --- Media Configuration ---------------------------------------------------
 
+// Specifies whether this platform has support for a possibly-decrypting
+// elementary stream player for at least H.264/AAC (and AES-128-CTR, if
+// decrypting). A player is responsible for ingesting an audio and video
+// elementary stream, optionally-encrypted, and ultimately producing
+// synchronized audio/video. If a player is defined, it must choose one of the
+// supported composition methods below.
+#define SB_HAS_PLAYER 1
+
 // The maximum audio bitrate the platform can decode.  The following value
 // equals to 2M bytes per seconds which is more than enough for compressed
 // audio.
diff --git a/src/starboard/contrib/tizen/armv7l/gyp_configuration.gypi b/src/starboard/contrib/tizen/armv7l/gyp_configuration.gypi
index 1b9b6cc..6e6f6a7 100644
--- a/src/starboard/contrib/tizen/armv7l/gyp_configuration.gypi
+++ b/src/starboard/contrib/tizen/armv7l/gyp_configuration.gypi
@@ -11,43 +11,17 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
 {
   'variables': {
+    'enable_map_to_mesh%': 1,
     'target_arch': 'arm',
-
-    'gl_type': 'system_gles2',
-
-    # Tizen uses ARMv7
-    'arm_version': 7,
-    'armv7': 1,
-    'arm_neon': 0,
-
-    # Reduce garbage collection threshold from the default of 8MB in order to
-    # save on memory.  This will mean that garbage collection occurs more
-    # frequently.
-    'mozjs_garbage_collection_threshold_in_bytes%': 4 * 1024 * 1024,
-
-    # The rasterizer does not benefit much from rendering only the dirty
-    # region. Disable this option since it costs GPU time.
-    'render_dirty_region_only': 0,
-
-    'cobalt_media_buffer_storage_type': 'memory',
-    'cobalt_media_buffer_initial_capacity': 26 * 1024 * 1024,
-    'cobalt_media_buffer_allocation_unit': 0 * 1024 * 1024,
-    'cobalt_media_buffer_non_video_budget': 5 * 1024 * 1024,
-    'cobalt_media_buffer_video_budget_1080p': 16 * 1024 * 1024,
-    'cobalt_media_buffer_video_budget_4k': 60 * 1024 * 1024,
-
-    'platform_libraries': [
-      '-lasound',
-      '-lavcodec',
-      '-lavformat',
-      '-lavutil',
-      '-ldlog',
+    'gl_type%': 'system_gles2',
+    'arm_neon': 1,
+    'cobalt_platform_dependencies': [
+      # GL Linux makes some GL calls within decode_target_internal.cc.
+      '<(DEPTH)/starboard/egl_and_gles/egl_and_gles.gyp:egl_and_gles',
     ],
   },
-
   'target_defaults': {
     'default_configuration': 'tizen-armv7l_debug',
     'configurations': {
@@ -64,9 +38,24 @@
         'inherit_from': ['gold_base'],
       },
     }, # end of configurations
-  }, # end of target_defaults
+    # for libvpx arm arch support
+    'cflags': [
+      '-mfpu=neon-vfpv4',
+      '-mfloat-abi=softfp',
+    ],
+  },
 
   'includes': [
+    'libraries.gypi',
     '../shared/gyp_configuration.gypi',
   ],
+  # with flto flag, we get below error
+  # plugin needed to handle lto object
+  # so remove flto flag
+  'compiler_flags_gold!': [
+    '-flto',
+  ],
+  'linker_flags_gold!': [
+    '-flto',
+  ],
 }
diff --git a/src/starboard/contrib/tizen/armv7l/gyp_configuration.py b/src/starboard/contrib/tizen/armv7l/gyp_configuration.py
index 9fac11e..382a6ad 100644
--- a/src/starboard/contrib/tizen/armv7l/gyp_configuration.py
+++ b/src/starboard/contrib/tizen/armv7l/gyp_configuration.py
@@ -11,11 +11,11 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-"""Starboard Tizen armv7l platform configuration for gyp_cobalt."""
+"""Starboard Tizen Armv7l platform configuration for gyp_cobalt."""
 
 import logging
 
-import config.base
+import config.starboard
 
 
 def CreatePlatformConfig():
@@ -26,7 +26,7 @@
     return None
 
 
-class _PlatformConfig(config.base.PlatformConfigBase):
+class _PlatformConfig(config.starboard.PlatformConfigStarboard):
   """Starboard Tizen Armv7l platform configuration."""
 
   def __init__(self, platform):
@@ -48,11 +48,3 @@
         'CXX_host': 'armv7l-tizen-linux-gnueabi-g++',
     }
     return env_variables
-
-  def GetTestFilters(self):
-    """Gets all tests to be excluded from a unit test run.
-
-    Returns:
-      A list of initialized TestFilter objects.
-    """
-    return []
diff --git a/src/starboard/contrib/tizen/armv7l/libraries.gypi b/src/starboard/contrib/tizen/armv7l/libraries.gypi
new file mode 100644
index 0000000..1386f73
--- /dev/null
+++ b/src/starboard/contrib/tizen/armv7l/libraries.gypi
@@ -0,0 +1,32 @@
+# Copyright 2016 Samsung Electronics. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+{
+  'variables': {
+    'cobalt_platform_dependencies': [
+      # GL Linux makes some GL calls within decode_target_internal.cc.
+      '<(DEPTH)/starboard/egl_and_gles/egl_and_gles.gyp:egl_and_gles',
+    ],
+
+    'platform_libraries': [
+      '-lEGL',
+      '-lGLESv2',
+      '-lwayland-client',
+      '-lwayland-egl',
+      '-lasound',
+      '-lavcodec',
+      '-lavformat',
+      '-lavutil',
+    ],
+  },
+}
diff --git a/src/starboard/contrib/tizen/shared/main.cc b/src/starboard/contrib/tizen/armv7l/main.cc
similarity index 70%
rename from src/starboard/contrib/tizen/shared/main.cc
rename to src/starboard/contrib/tizen/armv7l/main.cc
index 0f658fa..5de9a43 100644
--- a/src/starboard/contrib/tizen/shared/main.cc
+++ b/src/starboard/contrib/tizen/armv7l/main.cc
@@ -16,31 +16,26 @@
 #include <Elementary.h>
 
 #include "starboard/configuration.h"
+#include "starboard/contrib/tizen/shared/wayland/application_tizen.h"
 #include "starboard/shared/signal/crash_signals.h"
 #include "starboard/shared/signal/suspend_signals.h"
-#include "starboard/shared/wayland/application_wayland.h"
 
-SbThread cobalt_thread_;
-bool first_launch = true;
+namespace {
 
-static void* runCobalt(void* data) {
-  // Add proper argument here. Run(argc, argv)
-  starboard::shared::starboard::Application::Get()->Run(0, NULL);
-  return NULL;
-}
+int g_argc;
+char** g_argv;
 
 int aul_handler(aul_type type, bundle* kb, void* data) {
   switch (type) {
     case AUL_START: {
       SB_DLOG(INFO) << "AUL_START";
-      if (first_launch) {
-        cobalt_thread_ =
-            SbThreadCreate(0, kSbThreadPriorityNormal, kSbThreadNoAffinity,
-                           true, "tizen_cobalt", runCobalt, NULL);
-        SB_DCHECK(SbThreadIsValid(cobalt_thread_));
-        first_launch = false;
+      starboard::shared::wayland::ApplicationWayland* app =
+          starboard::shared::wayland::ApplicationWayland::Get();
+      if (app) {
+        app->Run(g_argc, g_argv);
       } else {
-        starboard::shared::wayland::ApplicationWayland::Get()->WindowRaise();
+        SB_DLOG(ERROR) << "Get ApplicationWayland failed!";
+        elm_exit();
       }
       break;
     }
@@ -51,7 +46,6 @@
     case AUL_TERMINATE: {
       SB_DLOG(INFO) << "AUL_TERMINATE";
       starboard::shared::starboard::Application::Get()->Stop(0);
-      SbThreadJoin(cobalt_thread_, NULL);
       elm_exit();
       break;
     }
@@ -62,7 +56,12 @@
   return 0;
 }
 
+}  // namespace
+
 int main(int argc, char** argv) {
+  g_argc = argc;
+  g_argv = argv;
+
   elm_init(0, NULL);
 
   aul_launch_init(aul_handler, NULL);
@@ -70,7 +69,7 @@
 
   starboard::shared::signal::InstallCrashSignalHandlers();
   starboard::shared::signal::InstallSuspendSignalHandlers();
-  starboard::shared::wayland::ApplicationWayland application;
+  starboard::shared::wayland::ApplicationWaylandTizen application;
 
   elm_run();
 
diff --git a/src/starboard/contrib/tizen/armv7l/starboard_platform.gyp b/src/starboard/contrib/tizen/armv7l/starboard_platform.gyp
index d940f42..c645462 100644
--- a/src/starboard/contrib/tizen/armv7l/starboard_platform.gyp
+++ b/src/starboard/contrib/tizen/armv7l/starboard_platform.gyp
@@ -12,125 +12,44 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 {
+  'includes': ['../shared/starboard_platform.gypi'],
   'targets': [
     {
       'target_name': 'starboard_platform',
       'type': 'static_library',
       'sources': [
-        '<(DEPTH)/starboard/shared/dlmalloc/memory_allocate_aligned_unchecked.cc',
-        '<(DEPTH)/starboard/shared/dlmalloc/memory_allocate_unchecked.cc',
-        '<(DEPTH)/starboard/shared/dlmalloc/memory_free.cc',
-        '<(DEPTH)/starboard/shared/dlmalloc/memory_free_aligned.cc',
-        '<(DEPTH)/starboard/shared/dlmalloc/memory_map.cc',
-        '<(DEPTH)/starboard/shared/dlmalloc/memory_reallocate_unchecked.cc',
-        '<(DEPTH)/starboard/shared/dlmalloc/memory_unmap.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/codec_util.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/codec_util.h',
-        '<(DEPTH)/starboard/shared/starboard/media/media_can_play_mime_and_key_system.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/media_get_audio_configuration_stereo_only.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/media_get_audio_output_count_stereo_only.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/media_is_audio_supported_aac_only.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/media_is_output_protected.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/media_is_video_supported_h264_1080p_sfr_only.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/media_set_output_protection.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/media_util.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/media_util.h',
-        '<(DEPTH)/starboard/shared/starboard/media/mime_type.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/mime_type.h',
-        '<(DEPTH)/starboard/shared/starboard/new.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/decoded_audio_internal.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/decoded_audio_internal.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/audio_decoder_internal.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/audio_frame_tracker.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/audio_frame_tracker.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_impl_internal.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_impl_internal.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_internal.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_sink.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/audio_resampler_impl.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/audio_time_stretcher.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/audio_time_stretcher.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/decoded_audio_queue.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/decoded_audio_queue.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/player_components.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/video_decoder_internal.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/video_renderer_impl_internal.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/video_renderer_impl_internal.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/video_renderer_internal.h',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/wsola_internal.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/filter/wsola_internal.h',
-        '<(DEPTH)/starboard/shared/starboard/player/input_buffer_internal.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/input_buffer_internal.h',
-        '<(DEPTH)/starboard/shared/starboard/player/job_queue.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/job_queue.h',
-        '<(DEPTH)/starboard/shared/starboard/player/player_create.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/player_destroy.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/player_get_current_frame.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/player_get_info.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/player_output_mode_supported.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/player_internal.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/player_internal.h',
-        '<(DEPTH)/starboard/shared/starboard/player/player_seek.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/player_set_bounds.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/player_set_playback_rate.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/player_set_volume.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/player_worker.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/player_worker.h',
-        '<(DEPTH)/starboard/shared/starboard/player/player_write_end_of_stream.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/player_write_sample.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/video_frame_internal.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/video_frame_internal.h',
-        '<(DEPTH)/starboard/shared/stub/accessibility_get_display_settings.cc',
-        '<(DEPTH)/starboard/shared/stub/accessibility_get_text_to_speech_settings.cc',
-        '<(DEPTH)/starboard/shared/stub/cryptography_create_transformer.cc',
-        '<(DEPTH)/starboard/shared/stub/cryptography_destroy_transformer.cc',
-        '<(DEPTH)/starboard/shared/stub/cryptography_get_tag.cc',
-        '<(DEPTH)/starboard/shared/stub/cryptography_set_authenticated_data.cc',
-        '<(DEPTH)/starboard/shared/stub/cryptography_set_initialization_vector.cc',
-        '<(DEPTH)/starboard/shared/stub/cryptography_transform.cc',
-        '<(DEPTH)/starboard/shared/stub/decode_target_create_egl.cc',
-        '<(DEPTH)/starboard/shared/stub/decode_target_get_info.cc',
-        '<(DEPTH)/starboard/shared/stub/decode_target_release.cc',
-        '<(DEPTH)/starboard/shared/stub/drm_close_session.cc',
-        '<(DEPTH)/starboard/shared/stub/drm_create_system.cc',
-        '<(DEPTH)/starboard/shared/stub/drm_destroy_system.cc',
-        '<(DEPTH)/starboard/shared/stub/drm_generate_session_update_request.cc',
-        '<(DEPTH)/starboard/shared/stub/drm_system_internal.h',
-        '<(DEPTH)/starboard/shared/stub/drm_update_session.cc',
-        '<(DEPTH)/starboard/shared/stub/image_decode.cc',
-        '<(DEPTH)/starboard/shared/stub/image_is_decode_supported.cc',
-        '<(DEPTH)/starboard/shared/stub/media_is_supported.cc',
-        '<(DEPTH)/starboard/shared/stub/media_is_transfer_characteristics_supported.cc',
-        '<(DEPTH)/starboard/shared/wayland/application_wayland.cc',
-        '<(DEPTH)/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_audio_decoder.cc',
-        '<(DEPTH)/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_audio_decoder.h',
-        '<(DEPTH)/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_common.cc',
-        '<(DEPTH)/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_common.h',
-        '<(DEPTH)/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_video_decoder.cc',
-        '<(DEPTH)/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_video_decoder.h',
-        '<(DEPTH)/starboard/contrib/tizen/shared/main.cc',
-        '<(DEPTH)/starboard/contrib/tizen/shared/player/filter/ffmpeg_player_components_impl.cc',
-        '<(DEPTH)/starboard/contrib/tizen/shared/system_get_path.cc',
-        'atomic_public.h',
-        'configuration_public.h',
-        'system_get_property.cc',
+        '<@(starboard_platform_sources)',
+        '<(DEPTH)/starboard/contrib/tizen/armv7l/main.cc',
+        '<(DEPTH)/starboard/contrib/tizen/armv7l/system_get_property.cc',
+        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_common.cc',
+        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_common.h',
+        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_writer.cc',
+        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_writer.h',
       ],
       'defines': [
+        'SB_PLAYER_ENABLE_VIDEO_DUMPER',
         # This must be defined when building Starboard, and must not when
         # building Starboard client code.
         'STARBOARD_IMPLEMENTATION',
       ],
       'dependencies': [
-        '<(DEPTH)/starboard/common/common.gyp:common',
+        '<@(starboard_platform_dependencies)',
+        '<(DEPTH)/starboard/contrib/tizen/armv7l/system.gyp:libpulse-simple',
         '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:aul',
+        '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:capi-appfw-application',
+        '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:capi-network-connection',
+        '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:edbus',
         '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:elementary',
-        '<(DEPTH)/third_party/dlmalloc/dlmalloc.gyp:dlmalloc',
-        'starboard_common.gyp:starboard_common',
+        '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:evas',
+        '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:gles20',
+        '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:tizen-extension-client',
+        '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:wayland-egl',
       ],
     },
   ],
+  'target_defaults': {
+    'include_dirs!': [
+          '<(DEPTH)/third_party/khronos',
+    ],
+  },
 }
diff --git a/src/starboard/contrib/tizen/armv7l/system.gyp b/src/starboard/contrib/tizen/armv7l/system.gyp
new file mode 100644
index 0000000..1828b15
--- /dev/null
+++ b/src/starboard/contrib/tizen/armv7l/system.gyp
@@ -0,0 +1,27 @@
+# Copyright (c) 2018 Samsung Electronics. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+{
+  'variables': {
+    'pkg-config': 'pkg-config',
+  },
+  'targets': [
+    {
+      'target_name': 'libpulse-simple',
+      'type': 'none',
+      'direct_dependent_settings': {
+        'cflags': [
+          '<!@(<(pkg-config) --cflags libpulse-simple)',
+        ],
+      },
+      'link_settings': {
+        'ldflags': [
+          '<!@(<(pkg-config) --libs-only-L --libs-only-other libpulse-simple)',
+        ],
+        'libraries': [
+          '<!@(<(pkg-config) --libs-only-l libpulse-simple)',
+        ],
+      },
+    }, # libpulse
+  ],
+}
diff --git a/src/starboard/contrib/tizen/armv7l/system_get_property.cc b/src/starboard/contrib/tizen/armv7l/system_get_property.cc
index ee6665a..a2a69c6 100644
--- a/src/starboard/contrib/tizen/armv7l/system_get_property.cc
+++ b/src/starboard/contrib/tizen/armv7l/system_get_property.cc
@@ -20,12 +20,12 @@
 namespace {
 
 const char* kBrandName = "Samsung";
-const char* kChipsetModelNumber = "JazzM";
-const char* kFirmwareVersion = "T-JZMPAKUC";
+const char* kChipsetModelNumber = "XU3";
+const char* kFirmwareVersion = "tv-wayland-armv7l-odroidu3";
 const char* kFriendlyName = "Tizen";
-const char* kModelName = "UN49KS9000";
-const char* kModelYear = "2017";
-const char* kPlatformName = "LINUX; Tizen 3.0";
+const char* kModelName = "ODROID";
+const char* kModelYear = "2018";
+const char* kPlatformName = "LINUX; Tizen 3.0;";
 
 bool CopyStringAndTestIfSuccess(char* out_value,
                                 int value_length,
diff --git a/src/starboard/contrib/tizen/armv7l/thread_types_public.h b/src/starboard/contrib/tizen/armv7l/thread_types_public.h
index 301fc63..21e934e 100644
--- a/src/starboard/contrib/tizen/armv7l/thread_types_public.h
+++ b/src/starboard/contrib/tizen/armv7l/thread_types_public.h
@@ -12,11 +12,9 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// Includes threading primitive types and initializers.
+#ifndef STARBOARD_CONTRIB_TIZEN_ARMV7L_THREAD_TYPES_PUBLIC_H_
+#define STARBOARD_CONTRIB_TIZEN_ARMV7L_THREAD_TYPES_PUBLIC_H_
 
-#ifndef STARBOARD_TIZEN_ARMV7L_THREAD_TYPES_PUBLIC_H_
-#define STARBOARD_TIZEN_ARMV7L_THREAD_TYPES_PUBLIC_H_
+#include "starboard/contrib/tizen/shared/thread_types_public.h"
 
-#include "starboard/shared/pthread/types_public.h"
-
-#endif  // STARBOARD_TIZEN_ARMV7L_THREAD_TYPES_PUBLIC_H_
+#endif  // STARBOARD_CONTRIB_TIZEN_ARMV7L_THREAD_TYPES_PUBLIC_H_
diff --git a/src/starboard/contrib/tizen/packaging/README.md b/src/starboard/contrib/tizen/packaging/README.md
index 0049ea3..8aff330 100644
--- a/src/starboard/contrib/tizen/packaging/README.md
+++ b/src/starboard/contrib/tizen/packaging/README.md
@@ -1,7 +1,7 @@
 ## Introduction
 
 cobalt tizen is a Cobalt engine port to tizen platform. The port
-implements starboard/contrib/tizen platform APIs.
+implements starboard/tizen platform APIs.
 
 ## Precondition
 
@@ -21,6 +21,6 @@
   - armv7l
     $ gbs -c packaging/gbs.conf -v build -A armv7l -P profile.cobalt [options]
     Detail option see "gbs --help" and "gbs -v build --help"
-    ex) gbs -c src/starboard/contrib/tizen/packaging/gbs.conf -v build -A armv7l -P profile.cobalt --packaging-dir src/starboard/contrib/tizen/packaging/
+    ex) gbs -c src/starboard/contrib/tizen/packaging/gbs.conf -v build -A armv7l -P profile.cobalt --packaging-dir src/starboard/tizen/packaging/
 
 cobalt tizen code uses the BSD license, see our `LICENSE` file.
diff --git a/src/starboard/contrib/tizen/packaging/com.youtube.cobalt.spec b/src/starboard/contrib/tizen/packaging/com.youtube.cobalt.spec
index 1b4a636..e05fb54 100644
--- a/src/starboard/contrib/tizen/packaging/com.youtube.cobalt.spec
+++ b/src/starboard/contrib/tizen/packaging/com.youtube.cobalt.spec
@@ -13,11 +13,12 @@
 #####################
 # rpm require package
 #####################
-BuildRequires: cmake, bison, python, gperf
+BuildRequires: cmake, bison, python, gperf, ninja
 BuildRequires: libasound-devel
 BuildRequires: pkgconfig(aul)
 BuildRequires: pkgconfig(capi-appfw-application)
 BuildRequires: pkgconfig(capi-media-audio-io)
+BuildRequires: pkgconfig(capi-network-connection)
 BuildRequires: pkgconfig(capi-system-info)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(edbus)
@@ -30,18 +31,10 @@
 BuildRequires: pkgconfig(tizen-extension-client)
 BuildRequires: pkgconfig(wayland-client)
 BuildRequires: pkgconfig(wayland-egl)
-%if "%{?target}" == "samsungtv"
-BuildRequires: pkgconfig(appcore-common)
-BuildRequires: pkgconfig(app-control-api)
-BuildRequires: pkgconfig(capi-media-player)
-BuildRequires: pkgconfig(drmdecrypt)
-BuildRequires: pkgconfig(soc-pq-interface)
-BuildRequires: pkgconfig(vconf-internal-keys-tv)
-%else
 BuildRequires: pkgconfig(libavcodec)
 BuildRequires: pkgconfig(libavformat)
 BuildRequires: pkgconfig(libavutil)
-%endif
+BuildRequires: pkgconfig(libpulse)
 
 %description
 Youtube Engine based on Cobalt
@@ -82,12 +75,20 @@
 %define _bindir %{_pkgdir}/bin
 %define _contentdir %{_pkgdir}/content
 %define _build_create_debug 0
+
 echo "Name: %{_name} / Target: %{_target} / Chipset: %{_chipset} / Build Type: %{_build_type}"
 
 #####################
 # rpm build
 #####################
 %build
+
+# export depot_tools to provide download_from_google_storage command.
+# download_from_google_storage will be used when gyp_cobalt.
+# depot_tools should be placed under src/cobalt/build before gbs build.
+# Remove .git in depot_tools if existed.
+export PATH=${PATH}:%{_builddir}/%{name}-%{version}/src/cobalt/build/depot_tools
+
 #gyp generate
 %if 0%{?nogyp}
 echo "Skip GYP"
@@ -95,8 +96,7 @@
 ./src/cobalt/build/gyp_cobalt -v -C %{_build_type} %{_target}-%{_chipset}
 %endif
 #ninja build
-src/cobalt/build/ninja/ninja-linux32.armv7l \
--C %{_outdir} %{_name}
+ninja -C %{_outdir} %{_name}
 
 %clean
 #Don't delete src/out
@@ -106,10 +106,13 @@
 # rpm install
 #####################
 %install
+# directory
 rm -rf %{buildroot}
 install -d %{buildroot}%{_bindir}
 install -d %{buildroot}%{_manifestdir}
 install -d %{buildroot}%{_contentdir}/data/fonts/
+
+# binary
 %if "%{_name}" == "all"
 install -m 0755 %{_outdir}/accessibility_test %{_outdir}/audio_test %{_outdir}/base_test \
                 %{_outdir}/base_unittests %{_outdir}/bindings_sandbox %{_outdir}/bindings_test \
@@ -134,22 +137,23 @@
 install -m 0755 %{_outdir}/%{_name} %{buildroot}%{_bindir}
 %endif
 
-%if "%{?target}" == "samsungtv"
-cp -rd src/third_party/starboard/samsungtv/%{_chipset}/fonts/fonts.xml %{buildroot}%{_contentdir}/data/fonts/
-%else
+# font
 cp -rd %{_outdir}/content/data/fonts %{buildroot}%{_contentdir}/data/
-%endif
 
+# ssl
 cp -rd %{_outdir}/content/data/ssl %{buildroot}%{_contentdir}/data/
 
+# debug resources
 %if %{_build_type} != "gold"
 cp -rd %{_outdir}/content/data/web %{buildroot}%{_contentdir}/data/
 %endif
 
+# test contents
 %if %{_name} != "cobalt"
 cp -rd %{_outdir}/content/dir_source_root %{buildroot}%{_contentdir}/
 %endif
 
+# package xml
 cp src/starboard/contrib/tizen/packaging/%{_pkgname}.xml %{buildroot}%{_manifestdir}
 
 %post
@@ -162,11 +166,7 @@
 %files
 %manifest src/starboard/contrib/tizen/packaging/%{_pkgname}.manifest
 %defattr(-,root,root,-)
-%if "%{_name}" == "all"
 %{_bindir}/*
-%else
-%{_bindir}/%{_name}
-%endif
 %{_contentdir}/*
 %{_manifestdir}/*
 
diff --git a/src/starboard/contrib/tizen/packaging/com.youtube.cobalt.xml b/src/starboard/contrib/tizen/packaging/com.youtube.cobalt.xml
index 4eda34a..0350f86 100644
--- a/src/starboard/contrib/tizen/packaging/com.youtube.cobalt.xml
+++ b/src/starboard/contrib/tizen/packaging/com.youtube.cobalt.xml
@@ -1,14 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="com.youtube.cobalt" version="1.0.0" install-location="internal-only">
+<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" smack-label="com.youtube.cobalt" package="com.youtube.cobalt" version="1.0.0" install-location="internal-only">
   <label>Cobalt</label>
-  <!-- TODO icon -->
-    <icon>org.tizen.browser.png</icon>
-    <author email="zapati.ahn@samsung.com" href="www.samsung.com">Youngjoon Ahn</author>
-    <description>Cobalt</description>
-    <ui-application  type="capp"  multiple="false" taskmanage="true" nodisplay="false" exec="/usr/apps/com.youtube.cobalt/bin/cobalt" appid="com.youtube.cobalt" process-pool="true">
-      <icon>org.tizen.browser.png</icon>
-      <label>Cobalt</label>
-    </ui-application>
+  <author email="zapati.ahn@samsung.com" href="www.samsung.com">Youngjoon Ahn</author>
+  <description>Cobalt WebContainer</description>
+  <ui-application appid="com.youtube.cobalt" exec="/usr/apps/com.youtube.cobalt/bin/cobalt" launch_mode="single" multiple="false" nodisplay="false" taskmanage="true" type="capp" process-pool="true">
+    <label>Cobalt</label>
+  </ui-application>
   <!-- Adding needed privileges as per Tizen 3.0 guide. Some may not be required. Revisit and remove unnecessary ones -->
   <privileges>
     <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
diff --git a/src/starboard/contrib/tizen/shared/alsa/alsa_audio_sink_type.cc b/src/starboard/contrib/tizen/shared/alsa/alsa_audio_sink_type.cc
new file mode 100644
index 0000000..3a89d8d
--- /dev/null
+++ b/src/starboard/contrib/tizen/shared/alsa/alsa_audio_sink_type.cc
@@ -0,0 +1,432 @@
+// Copyright 2018 Samsung Electronics. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "starboard/shared/alsa/alsa_audio_sink_type.h"
+
+#include <algorithm>
+#include <vector>
+
+#include "starboard/condition_variable.h"
+#include "starboard/configuration.h"
+#include "starboard/contrib/tizen/shared/alsa/alsa_util.h"
+#include "starboard/memory.h"
+#include "starboard/mutex.h"
+#include "starboard/thread.h"
+#include "starboard/time.h"
+
+namespace starboard {
+namespace shared {
+namespace alsa {
+namespace {
+
+using starboard::ScopedLock;
+using starboard::ScopedTryLock;
+using starboard::shared::alsa::AlsaGetBufferedFrames;
+using starboard::shared::alsa::AlsaWriteFrames;
+
+// The maximum number of frames that can be written to ALSA once.  It must be a
+// power of 2.  It is also used as the ALSA polling size.  A small number will
+// lead to more CPU being used as the callbacks will be called more
+// frequently and also it will be more likely to cause underflow but can make
+// the audio clock more accurate.
+const int kFramesPerRequest = 512;
+// When the frames inside ALSA buffer is less than |kMinimumFramesInALSA|, the
+// class will try to write more frames.  The larger the number is, the less
+// likely an underflow will happen but to use a larger number will cause longer
+// delays after pause and stop.
+const int kMinimumFramesInALSA = 2048;
+// The size of the audio buffer ALSA allocates internally.  Ideally this value
+// should be greater than the sum of the above two constants.  Choose a value
+// that is too large can waste some memory as the extra buffer is never used.
+const int kALSABufferSizeInFrames = 8192;
+// Helper function to compute the size of the two valid starboard audio sample
+// types.
+
+size_t GetSampleSize(SbMediaAudioSampleType sample_type) {
+  switch (sample_type) {
+    case kSbMediaAudioSampleTypeFloat32:
+      return sizeof(float);
+    case kSbMediaAudioSampleTypeInt16Deprecated:
+      return sizeof(int16_t);
+  }
+  SB_NOTREACHED();
+  return 0u;
+}
+
+size_t GetBytesPerFrame(int channels, SbMediaAudioSampleType sample_type) {
+  return sizeof(uint8_t) * channels * GetSampleSize(sample_type);
+}
+
+void* IncrementPointerByBytes(void* pointer, size_t offset) {
+  return static_cast<void*>(static_cast<uint8_t*>(pointer) + offset);
+}
+
+// This class is an ALSA based audio sink with the following features:
+// 1. It doesn't cache any data internally and maintains minimum data inside
+//    the ALSA buffer.  It relies on pulling data from its source in high
+//    frequency to playback audio.
+// 2. It never stops the underlying ALSA audio sink once created.  When its
+//    source cannot provide enough data to continue playback, it simply writes
+//    silence to ALSA.
+class AlsaAudioSink : public SbAudioSinkPrivate {
+ public:
+  AlsaAudioSink(Type* type,
+                int channels,
+                int sampling_frequency_hz,
+                SbMediaAudioSampleType sample_type,
+                SbAudioSinkFrameBuffers frame_buffers,
+                int frames_per_channel,
+                SbAudioSinkUpdateSourceStatusFunc update_source_status_func,
+                SbAudioSinkConsumeFramesFunc consume_frame_func,
+                void* context);
+  ~AlsaAudioSink() override;
+
+  bool IsType(Type* type) override { return type_ == type; }
+
+  void SetPlaybackRate(double playback_rate) override {
+    ScopedLock lock(mutex_);
+    playback_rate_ = playback_rate;
+  }
+
+  void SetVolume(double volume) override {
+    ScopedLock lock(mutex_);
+    volume_ = volume;
+  }
+
+  bool is_valid() { return playback_handle_ != NULL; }
+
+ private:
+  static void* ThreadEntryPoint(void* context);
+  void AudioThreadFunc();
+  // Write silence to ALSA when there is not enough data in source or when the
+  // sink is paused.
+  // Return true to continue to play.  Return false when destroying.
+  bool IdleLoop();
+  // Keep pulling frames from source until there is no frames to keep playback.
+  // When the sink is paused or there is no frames in source, it returns true
+  // so we can continue into the IdleLoop().  It returns false when destroying.
+  bool PlaybackLoop();
+  // Helper function to write frames contained in a ring buffer to ALSA.
+  void WriteFrames(double playback_rate,
+                   int frames_to_write,
+                   int frames_in_buffer,
+                   int offset_in_frames);
+
+  Type* type_;
+  SbAudioSinkUpdateSourceStatusFunc update_source_status_func_;
+  SbAudioSinkConsumeFramesFunc consume_frame_func_;
+  void* context_;
+
+  double playback_rate_;
+  double volume_;
+  std::vector<uint8_t> resample_buffer_;
+
+  int channels_;
+  int sampling_frequency_hz_;
+  SbMediaAudioSampleType sample_type_;
+  int bytes_per_frame_;
+
+  SbThread audio_out_thread_;
+  starboard::Mutex mutex_;
+  starboard::ConditionVariable creation_signal_;
+
+  SbTime time_to_wait_;
+
+  bool destroying_;
+
+  void* frame_buffer_;
+  int frames_per_channel_;
+  void* silence_frames_;
+
+  void* playback_handle_;
+};
+
+AlsaAudioSink::AlsaAudioSink(
+    Type* type,
+    int channels,
+    int sampling_frequency_hz,
+    SbMediaAudioSampleType sample_type,
+    SbAudioSinkFrameBuffers frame_buffers,
+    int frames_per_channel,
+    SbAudioSinkUpdateSourceStatusFunc update_source_status_func,
+    SbAudioSinkConsumeFramesFunc consume_frame_func,
+    void* context)
+    : type_(type),
+      playback_rate_(1.0),
+      volume_(1.0),
+      resample_buffer_(channels * kFramesPerRequest *
+                       GetSampleSize(sample_type)),
+      channels_(channels),
+      sampling_frequency_hz_(sampling_frequency_hz),
+      sample_type_(sample_type),
+      bytes_per_frame_(GetBytesPerFrame(channels, sample_type)),
+      update_source_status_func_(update_source_status_func),
+      consume_frame_func_(consume_frame_func),
+      context_(context),
+      audio_out_thread_(kSbThreadInvalid),
+      creation_signal_(mutex_),
+      time_to_wait_(kFramesPerRequest * kSbTimeSecond / sampling_frequency_hz /
+                    2),
+      destroying_(false),
+      frame_buffer_(frame_buffers[0]),
+      frames_per_channel_(frames_per_channel),
+      silence_frames_(new uint8_t[channels * kFramesPerRequest *
+                                  GetSampleSize(sample_type)]),
+      playback_handle_(NULL) {
+  SB_DCHECK(update_source_status_func_);
+  SB_DCHECK(consume_frame_func_);
+  SB_DCHECK(frame_buffer_);
+  SB_DCHECK(SbAudioSinkIsAudioSampleTypeSupported(sample_type_));
+
+  SbMemorySet(silence_frames_, 0,
+              channels * kFramesPerRequest * GetSampleSize(sample_type));
+
+  ScopedLock lock(mutex_);
+  audio_out_thread_ =
+      SbThreadCreate(0, kSbThreadPriorityRealTime, kSbThreadNoAffinity, true,
+                     "alsa_audio_out", &AlsaAudioSink::ThreadEntryPoint, this);
+  SB_DCHECK(SbThreadIsValid(audio_out_thread_));
+  creation_signal_.Wait();
+}
+
+AlsaAudioSink::~AlsaAudioSink() {
+  {
+    ScopedLock lock(mutex_);
+    destroying_ = true;
+  }
+  SbThreadJoin(audio_out_thread_, NULL);
+
+  delete[] static_cast<uint8_t*>(silence_frames_);
+}
+
+// static
+void* AlsaAudioSink::ThreadEntryPoint(void* context) {
+  SB_DCHECK(context);
+  AlsaAudioSink* sink = reinterpret_cast<AlsaAudioSink*>(context);
+  sink->AudioThreadFunc();
+
+  return NULL;
+}
+
+void AlsaAudioSink::AudioThreadFunc() {
+  pa_sample_format alsa_sample_type =
+      sample_type_ == kSbMediaAudioSampleTypeFloat32 ? PA_SAMPLE_FLOAT32LE
+                                                     : PA_SAMPLE_S16LE;
+  playback_handle_ = starboard::shared::alsa::AlsaOpenPlaybackDevice(
+      channels_, sampling_frequency_hz_, alsa_sample_type);
+  {
+    ScopedLock lock(mutex_);
+    creation_signal_.Signal();
+  }
+
+  if (!playback_handle_) {
+    return;
+  }
+
+  for (;;) {
+    if (!IdleLoop()) {
+      break;
+    }
+    if (!PlaybackLoop()) {
+      break;
+    }
+  }
+
+  starboard::shared::alsa::AlsaCloseDevice(playback_handle_);
+  ScopedLock lock(mutex_);
+  playback_handle_ = NULL;
+}
+
+bool AlsaAudioSink::IdleLoop() {
+  SB_DLOG(INFO) << "alsa::AlsaAudioSink enters idle loop";
+
+  bool drain = true;
+
+  for (;;) {
+    double playback_rate;
+    {
+      ScopedLock lock(mutex_);
+      if (destroying_) {
+        break;
+      }
+      playback_rate = playback_rate_;
+    }
+    int frames_in_buffer, offset_in_frames;
+    bool is_playing, is_eos_reached;
+    update_source_status_func_(&frames_in_buffer, &offset_in_frames,
+                               &is_playing, &is_eos_reached, context_);
+    if (is_playing && frames_in_buffer > 0 && playback_rate > 0.0) {
+      return true;
+    }
+    if (drain) {
+      drain = false;
+      AlsaWriteFrames(playback_handle_, silence_frames_,
+                      bytes_per_frame_ * kFramesPerRequest);
+      AlsaDrain(playback_handle_);
+    }
+    SbThreadSleep(time_to_wait_);
+  }
+
+  return false;
+}
+
+bool AlsaAudioSink::PlaybackLoop() {
+  SB_DLOG(INFO) << "alsa::AlsaAudioSink enters playback loop";
+
+  // TODO: Also handle |volume_| here.
+  double playback_rate = 1.0;
+  for (;;) {
+    {
+      ScopedTryLock lock(mutex_);
+      if (lock.is_locked()) {
+        if (destroying_) {
+          break;
+        }
+        playback_rate = playback_rate_;
+      }
+    }
+
+    if (playback_rate == 0.0) {
+      return true;
+    }
+    int frames_in_buffer, offset_in_frames;
+    bool is_playing, is_eos_reached;
+    update_source_status_func_(&frames_in_buffer, &offset_in_frames,
+                               &is_playing, &is_eos_reached, context_);
+    if (!is_playing || frames_in_buffer == 0) {
+      return true;
+    }
+    WriteFrames(playback_rate, std::min(kFramesPerRequest, frames_in_buffer),
+                frames_in_buffer, offset_in_frames);
+  }
+
+  return false;
+}
+
+void AlsaAudioSink::WriteFrames(double playback_rate,
+                                int frames_to_write,
+                                int frames_in_buffer,
+                                int offset_in_frames) {
+  if (playback_rate == 1.0) {
+    SB_DCHECK(frames_to_write <= frames_in_buffer);
+
+    int frames_to_buffer_end = frames_per_channel_ - offset_in_frames;
+    if (frames_to_write > frames_to_buffer_end) {
+      int consumed = frames_to_buffer_end;
+      if (!AlsaWriteFrames(
+              playback_handle_,
+              IncrementPointerByBytes(frame_buffer_,
+                                      offset_in_frames * bytes_per_frame_),
+              frames_to_buffer_end * bytes_per_frame_))
+        consumed = 0;
+      consume_frame_func_(consumed, context_);
+      if (consumed != frames_to_buffer_end) {
+        return;
+      }
+
+      frames_to_write -= frames_to_buffer_end;
+      offset_in_frames = 0;
+    }
+
+    int consumed = frames_to_write;
+    if (!AlsaWriteFrames(
+            playback_handle_,
+            IncrementPointerByBytes(frame_buffer_,
+                                    offset_in_frames * bytes_per_frame_),
+            bytes_per_frame_ * frames_to_write)) {
+      consumed = 0;
+    }
+    consume_frame_func_(consumed, context_);
+  } else {
+    // A very low quality resampler that simply shift the audio frames to play
+    // at the right time.
+    // TODO: The playback rate adjustment should be done in AudioRenderer.  We
+    // should provide a default sinc resampler.
+    double source_frames = 0.0;
+    int buffer_size_in_frames = resample_buffer_.size() / bytes_per_frame_;
+    int target_frames = 0;
+    SB_DCHECK(buffer_size_in_frames <= frames_to_write);
+
+    // Use |playback_rate| as the granularity of increment for source buffer.
+    // For example, when |playback_rate| is 0.25, every time a frame is copied
+    // to the target buffer, the offset of source buffer will be increased by
+    // 0.25, this effectively repeat the same frame four times into the target
+    // buffer and it takes 4 times longer to finish playing the frames.
+    while (static_cast<int>(source_frames) < frames_in_buffer &&
+           target_frames < buffer_size_in_frames) {
+      const uint8_t* source_addr = static_cast<uint8_t*>(frame_buffer_);
+      source_addr += static_cast<int>(offset_in_frames + source_frames) %
+                     frames_per_channel_ * bytes_per_frame_;
+      SbMemoryCopy(&resample_buffer_[0] + bytes_per_frame_ * target_frames,
+                   source_addr, bytes_per_frame_);
+      ++target_frames;
+      source_frames += playback_rate;
+    }
+
+    int consumed = target_frames;
+    if (!AlsaWriteFrames(playback_handle_, &resample_buffer_[0],
+                         bytes_per_frame_ * target_frames)) {
+      consumed = 0;
+    }
+    consume_frame_func_(consumed * playback_rate_, context_);
+  }
+}
+
+}  // namespace
+
+SbAudioSink AlsaAudioSinkType::Create(
+    int channels,
+    int sampling_frequency_hz,
+    SbMediaAudioSampleType audio_sample_type,
+    SbMediaAudioFrameStorageType audio_frame_storage_type,
+    SbAudioSinkFrameBuffers frame_buffers,
+    int frames_per_channel,
+    SbAudioSinkUpdateSourceStatusFunc update_source_status_func,
+    SbAudioSinkConsumeFramesFunc consume_frames_func,
+    void* context) {
+  AlsaAudioSink* audio_sink = new AlsaAudioSink(
+      this, channels, sampling_frequency_hz, audio_sample_type, frame_buffers,
+      frames_per_channel, update_source_status_func, consume_frames_func,
+      context);
+  if (!audio_sink->is_valid()) {
+    delete audio_sink;
+    return kSbAudioSinkInvalid;
+  }
+
+  return audio_sink;
+}
+
+}  // namespace alsa
+}  // namespace shared
+}  // namespace starboard
+
+namespace {
+SbAudioSinkPrivate::Type* alsa_audio_sink_type_;
+}  // namespace
+
+// static
+void SbAudioSinkPrivate::PlatformInitialize() {
+  SB_DCHECK(!alsa_audio_sink_type_);
+  alsa_audio_sink_type_ = new starboard::shared::alsa::AlsaAudioSinkType;
+  SetPrimaryType(alsa_audio_sink_type_);
+  EnableFallbackToStub();
+}
+
+// static
+void SbAudioSinkPrivate::PlatformTearDown() {
+  SB_DCHECK(alsa_audio_sink_type_ == GetPrimaryType());
+  SetPrimaryType(NULL);
+  delete alsa_audio_sink_type_;
+  alsa_audio_sink_type_ = NULL;
+}
diff --git a/src/starboard/contrib/tizen/shared/alsa/alsa_util.cc b/src/starboard/contrib/tizen/shared/alsa/alsa_util.cc
new file mode 100644
index 0000000..1aee3fd
--- /dev/null
+++ b/src/starboard/contrib/tizen/shared/alsa/alsa_util.cc
@@ -0,0 +1,91 @@
+// Copyright 2018 Samsung Electronics. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "starboard/contrib/tizen/shared/alsa/alsa_util.h"
+
+#include <pulse/error.h>
+#include "starboard/log.h"
+
+namespace starboard {
+namespace shared {
+namespace alsa {
+
+void* AlsaOpenPlaybackDevice(int channel,
+                             int sample_rate,
+                             pa_sample_format sample_type) {
+  const pa_sample_spec ss = {
+      .format = sample_type, .rate = sample_rate, .channels = channel};
+  int error;
+  pa_simple* playback_handle =
+      pa_simple_new(NULL, "cobalt", PA_STREAM_PLAYBACK, NULL, "playback", &ss,
+                    NULL, NULL, &error);
+  if (!playback_handle) {
+    SB_LOG(ERROR) << " pa_simple_new failed " << pa_strerror(error);
+  }
+
+  return playback_handle;
+}
+
+bool AlsaWriteFrames(void* playback_handle, const void* buffer, size_t bytes) {
+  if (bytes == 0) {
+    return true;
+  }
+
+  int error;
+  pa_simple* handle = reinterpret_cast<pa_simple*>(playback_handle);
+  if (pa_simple_write(handle, buffer, (size_t)bytes, &error) < 0) {
+    SB_LOG(ERROR) << " pa_simple_write failed " << pa_strerror(error);
+    return false;
+  }
+
+  return true;
+}
+
+int AlsaGetBufferedFrames(void* playback_handle) {
+  pa_usec_t latency;
+  int error;
+  latency = pa_simple_get_latency(reinterpret_cast<pa_simple*>(playback_handle),
+                                  &error);
+  if (latency != (pa_usec_t)-1)
+    return (int)latency;
+  SB_LOG(ERROR) << " pa_simple_get_latency failed " << pa_strerror(error);
+  return 0;
+}
+
+void AlsaCloseDevice(void* playback_handle) {
+  if (playback_handle) {
+    int error;
+    if (pa_simple_drain(reinterpret_cast<pa_simple*>(playback_handle), &error) <
+        0) {
+      SB_LOG(ERROR) << " pa_simple_drain failed " << pa_strerror(error);
+    }
+    pa_simple_free(reinterpret_cast<pa_simple*>(playback_handle));
+  }
+}
+
+bool AlsaDrain(void* playback_handle) {
+  if (playback_handle) {
+    int error;
+    if (pa_simple_drain(reinterpret_cast<pa_simple*>(playback_handle), &error) <
+        0) {
+      SB_LOG(ERROR) << " pa_simple_drain failed " << pa_strerror(error);
+      return false;
+    }
+  }
+  return true;
+}
+
+}  // namespace alsa
+}  // namespace shared
+}  // namespace starboard
diff --git a/src/starboard/contrib/tizen/shared/alsa/alsa_util.h b/src/starboard/contrib/tizen/shared/alsa/alsa_util.h
new file mode 100644
index 0000000..48750b8
--- /dev/null
+++ b/src/starboard/contrib/tizen/shared/alsa/alsa_util.h
@@ -0,0 +1,38 @@
+// Copyright 2018 Samsung Electronics. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef STARBOARD_CONTRIB_TIZEN_SHARED_ALSA_ALSA_UTIL_H_
+#define STARBOARD_CONTRIB_TIZEN_SHARED_ALSA_ALSA_UTIL_H_
+
+#include <pulse/simple.h>
+
+#include "starboard/shared/internal_only.h"
+
+namespace starboard {
+namespace shared {
+namespace alsa {
+
+void* AlsaOpenPlaybackDevice(int channel,
+                             int sample_rate,
+                             pa_sample_format sample_type);
+bool AlsaWriteFrames(void* playback_handle, const void* buffer, size_t bytes);
+int AlsaGetBufferedFrames(void* playback_handle);
+void AlsaCloseDevice(void* playback_handle);
+bool AlsaDrain(void* playback_handle);
+
+}  // namespace alsa
+}  // namespace shared
+}  // namespace starboard
+
+#endif  // STARBOARD_CONTRIB_TIZEN_SHARED_ALSA_ALSA_UTIL_H_
diff --git a/src/cobalt/dom/array_buffer_view.idl b/src/starboard/contrib/tizen/shared/alsa/audio_sink_is_audio_sample_type_supported.cc
similarity index 64%
copy from src/cobalt/dom/array_buffer_view.idl
copy to src/starboard/contrib/tizen/shared/alsa/audio_sink_is_audio_sample_type_supported.cc
index 3b8902a..ba92110 100644
--- a/src/cobalt/dom/array_buffer_view.idl
+++ b/src/starboard/contrib/tizen/shared/alsa/audio_sink_is_audio_sample_type_supported.cc
@@ -1,4 +1,4 @@
-// Copyright 2015 Google Inc. All Rights Reserved.
+// Copyright 2018 Samsung Electronics. 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,9 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// https://www.khronos.org/registry/typedarray/specs/latest/#6
+#include "starboard/audio_sink.h"
 
-[NoInterfaceObject]
-interface ArrayBufferView {
-    readonly attribute ArrayBuffer buffer;
-    readonly attribute unsigned long byteOffset;
-    readonly attribute unsigned long byteLength;
-};
+bool SbAudioSinkIsAudioSampleTypeSupported(
+    SbMediaAudioSampleType audio_sample_type) {
+  return audio_sample_type == kSbMediaAudioSampleTypeInt16;
+}
diff --git a/src/starboard/contrib/tizen/shared/atomic_public.h b/src/starboard/contrib/tizen/shared/atomic_public.h
index 51e1cc1..6bbfa0d 100644
--- a/src/starboard/contrib/tizen/shared/atomic_public.h
+++ b/src/starboard/contrib/tizen/shared/atomic_public.h
@@ -12,11 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#ifndef STARBOARD_TIZEN_SHARED_ATOMIC_PUBLIC_H_
-#define STARBOARD_TIZEN_SHARED_ATOMIC_PUBLIC_H_
+#ifndef STARBOARD_CONTRIB_TIZEN_SHARED_ATOMIC_PUBLIC_H_
+#define STARBOARD_CONTRIB_TIZEN_SHARED_ATOMIC_PUBLIC_H_
 
 #include "starboard/atomic.h"
 
 #include "starboard/linux/shared/atomic_public.h"
 
-#endif  // STARBOARD_TIZEN_SHARED_ATOMIC_PUBLIC_H_
+#endif  // STARBOARD_CONTRIB_TIZEN_SHARED_ATOMIC_PUBLIC_H_
diff --git a/src/starboard/contrib/tizen/shared/audio/audio_sink_private.cc b/src/starboard/contrib/tizen/shared/audio/audio_sink_private.cc
index aac2939..b76c51c 100644
--- a/src/starboard/contrib/tizen/shared/audio/audio_sink_private.cc
+++ b/src/starboard/contrib/tizen/shared/audio/audio_sink_private.cc
@@ -13,9 +13,9 @@
 // limitations under the License.
 
 #include "starboard/audio_sink.h"
+#include "starboard/contrib/tizen/shared/audio/audio_sink_private.h"
 #include "starboard/log.h"
 #include "starboard/mutex.h"
-#include "starboard/contrib/tizen/shared/audio/audio_sink_private.h"
 
 #define CHECK_CAPI_AUDIO_ERROR(func)                            \
   if (capi_ret != AUDIO_IO_ERROR_NONE) {                        \
@@ -60,10 +60,6 @@
                                   &capi_audio_out_);
   CHECK_CAPI_AUDIO_ERROR(audio_out_create_new);
 
-  capi_ret = audio_out_set_interrupted_cb(capi_audio_out_,
-                                          OnCAPIAudioIOInterrupted_CB, this);
-  CHECK_CAPI_AUDIO_ERROR(audio_out_set_interrupted_cb);
-
   // Starts the thread
   audio_out_thread_ =
       SbThreadCreate(0, kSbThreadPriorityRealTime, kSbThreadNoAffinity, true,
@@ -97,26 +93,6 @@
   return SbThreadIsValid(audio_out_thread_);
 }
 
-// static callbacks
-void SbAudioSinkPrivate::OnCAPIAudioIOInterrupted_CB(
-    audio_io_interrupted_code_e code,
-    void* user_data) {
-  SbAudioSinkPrivate* audio_sink =
-      reinterpret_cast<SbAudioSinkPrivate*>(user_data);
-  if (audio_sink) {
-    audio_sink->OnCAPIAudioIOInterrupted(code);
-  }
-}
-void SbAudioSinkPrivate::OnCAPIAudioStreamWrite_CB(
-    audio_out_h handle,
-    size_t nbytes,
-    void* user_data) {  // not used
-  SbAudioSinkPrivate* audio_sink =
-      reinterpret_cast<SbAudioSinkPrivate*>(user_data);
-  if (audio_sink) {
-    audio_sink->OnCAPIAudioStreamWrite(handle, nbytes);
-  }
-}
 void* SbAudioSinkPrivate::AudioSinkThreadProc_CB(void* context) {
   SbAudioSinkPrivate* audio_sink =
       reinterpret_cast<SbAudioSinkPrivate*>(context);
@@ -131,26 +107,34 @@
   return "Unknown";
 }
 
-void SbAudioSinkPrivate::OnCAPIAudioIOInterrupted(
-    audio_io_interrupted_code_e code) {
-  SB_DLOG(WARNING) << "Play interrupted: audio_io_interrupted_code_e : "
-                   << code;
+void SbAudioSinkPrivate::ResetWaitPlay() {
+  send_frames_ = 0;
+  send_start_ = SbTimeGetMonotonicNow();
 }
 
-void SbAudioSinkPrivate::OnCAPIAudioStreamWrite(audio_out_h handle,
-                                                size_t nbytes) {
-  SB_DLOG(INFO) << "[MEDIA] OnAudioStreamWrite (not used) - request " << nbytes;
+void SbAudioSinkPrivate::WaitPlay(int consumed_frames) {
+  send_frames_ += consumed_frames;
+
+  int play_ms = send_frames_ * 1000 / sampling_frequency_hz_;
+  int pass_ms = (SbTimeGetMonotonicNow() - send_start_) / kSbTimeMillisecond;
+  int diff_ms = play_ms - pass_ms;
+
+  const int threashold_ms = 50;
+  const int margin_ms = 10;
+  if (diff_ms > threashold_ms) {
+    diff_ms -= margin_ms;
+    SbThreadSleep(diff_ms * kSbTimeMillisecond);
+  }
 }
 
 void* SbAudioSinkPrivate::AudioSinkThreadProc() {
   void* buf;
   int bytes_to_fill;
   int bytes_written;
-  int bytes_per_frame = kSampleByte;
+  int bytes_per_frame = kSampleByte * channels_;
   int consumed_frames;
 
   SB_DLOG(INFO) << "[MEDIA] sink thread started";
-
   for (;;) {
     {
       starboard::ScopedLock lock(mutex_);
@@ -178,11 +162,11 @@
         // audio_out_resume(capi_audio_out_);
         audio_out_prepare(capi_audio_out_);
         is_paused_ = false;
+        ResetWaitPlay();
         SB_DLOG(INFO) << "[MEDIA] audio_out_resume";
       }
 
       bytes_written = audio_out_write(capi_audio_out_, buf, bytes_to_fill);
-
       if (bytes_written < 0) {
         SB_DLOG(ERROR) << "[MEDIA] audio_out_write error (" << bytes_written
                        << ", " << GetCAPIErrorString(bytes_written) << ")";
@@ -190,23 +174,23 @@
       }
       consumed_frames = bytes_written / bytes_per_frame;
 
-      // This is commented : Sleep can cause 'underrun'
-      // update_source_status_func controls data's timing.
-      // SbThreadSleep(consumed_frames * kSbTimeSecond /
-      // sampling_frequency_hz_);
+      // notify to cobalt
       consume_frames_func_(consumed_frames, context_);
+
+      // waits properly
+      WaitPlay(consumed_frames);
     } else {
       if (!is_paused_) {
-        audio_out_drain(capi_audio_out_);
+        WaitPlay(0);
         audio_out_unprepare(capi_audio_out_);
+
         is_paused_ = true;
         SB_DLOG(INFO) << "[MEDIA] audio_out_pause";
       }
-      // Wait for five millisecond if we are paused.
-      SbThreadSleep(kSbTimeMillisecond * 5);
+      // Wait for some milliseconds if we are paused (or use much CPU)
+      SbThreadSleep(kSbTimeMillisecond * 10);
     }
   }
-
   SB_DLOG(INFO) << "[MEDIA] sink thread exited";
   return NULL;
 }
diff --git a/src/starboard/contrib/tizen/shared/audio/audio_sink_private.h b/src/starboard/contrib/tizen/shared/audio/audio_sink_private.h
index aa05f62..5fe3a28 100644
--- a/src/starboard/contrib/tizen/shared/audio/audio_sink_private.h
+++ b/src/starboard/contrib/tizen/shared/audio/audio_sink_private.h
@@ -12,8 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#ifndef STARBOARD_TIZEN_SHARED_AUDIO_AUDIO_SINK_PRIVATE_H_
-#define STARBOARD_TIZEN_SHARED_AUDIO_AUDIO_SINK_PRIVATE_H_
+#ifndef STARBOARD_CONTRIB_TIZEN_SHARED_AUDIO_AUDIO_SINK_PRIVATE_H_
+#define STARBOARD_CONTRIB_TIZEN_SHARED_AUDIO_AUDIO_SINK_PRIVATE_H_
 
 #include <audio_io.h>
 
@@ -40,19 +40,14 @@
   bool IsValid();
 
   // callbacks
-  static void OnCAPIAudioIOInterrupted_CB(audio_io_interrupted_code_e code,
-                                          void* user_data);
-  static void OnCAPIAudioStreamWrite_CB(audio_out_h handle,
-                                        size_t nbytes,
-                                        void* user_data);
   static void* AudioSinkThreadProc_CB(void* context);
 
  private:
   const char* GetCAPIErrorString(int capi_ret);
 
-  void OnCAPIAudioIOInterrupted(audio_io_interrupted_code_e code);
-  void OnCAPIAudioStreamWrite(audio_out_h handle, size_t nbytes);
   void* AudioSinkThreadProc();
+  void ResetWaitPlay();
+  void WaitPlay(int consumed_frames);
 
   // setting of creation
   int channels_;
@@ -66,13 +61,15 @@
   void* context_;
 
   // thread related
+  ::starboard::Mutex mutex_;
   bool destroying_;
   SbThread audio_out_thread_;
-  ::starboard::Mutex mutex_;
+  int send_frames_;
+  SbTimeMonotonic send_start_;
 
   // capi related
   audio_out_h capi_audio_out_;
   bool is_paused_;
 };
 
-#endif  // STARBOARD_TIZEN_SHARED_AUDIO_AUDIO_SINK_PRIVATE_H_
+#endif  // STARBOARD_CONTRIB_TIZEN_SHARED_AUDIO_AUDIO_SINK_PRIVATE_H_
diff --git a/src/starboard/contrib/tizen/shared/configuration_public.h b/src/starboard/contrib/tizen/shared/configuration_public.h
index 8f1f40a..d20e8ca 100644
--- a/src/starboard/contrib/tizen/shared/configuration_public.h
+++ b/src/starboard/contrib/tizen/shared/configuration_public.h
@@ -238,7 +238,7 @@
 // --- Network Configuration -------------------------------------------------
 
 // Specifies whether this platform supports IPV6.
-#define SB_HAS_IPV6 0
+#define SB_HAS_IPV6 1
 
 // Specifies whether this platform supports pipe.
 #define SB_HAS_PIPE 1
diff --git a/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_audio_decoder.cc b/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_audio_decoder.cc
deleted file mode 100644
index 7092f7b..0000000
--- a/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_audio_decoder.cc
+++ /dev/null
@@ -1,196 +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.
-
-#include "starboard/contrib/tizen/shared/ffmpeg/ffmpeg_audio_decoder.h"
-
-#include "starboard/audio_sink.h"
-#include "starboard/log.h"
-#include "starboard/memory.h"
-
-namespace starboard {
-namespace shared {
-namespace ffmpeg {
-
-namespace {
-
-AVCodecID GetFfmpegCodecIdByMediaCodec(SbMediaAudioCodec audio_codec) {
-  switch (audio_codec) {
-    case kSbMediaAudioCodecAac:
-      return AV_CODEC_ID_AAC;
-    case kSbMediaAudioCodecOpus:
-      return AV_CODEC_ID_OPUS;
-    default:
-      return AV_CODEC_ID_NONE;
-  }
-}
-
-}  // namespace
-
-AudioDecoder::AudioDecoder(SbMediaAudioCodec audio_codec,
-                           const SbMediaAudioHeader& audio_header)
-    : audio_codec_(audio_codec),
-      sample_type_(kSbMediaAudioSampleTypeInt16),
-      codec_context_(NULL),
-      av_frame_(NULL),
-      stream_ended_(false),
-      audio_header_(audio_header) {
-  SB_DCHECK(GetFfmpegCodecIdByMediaCodec(audio_codec) != AV_CODEC_ID_NONE)
-      << "Unsupported audio codec " << audio_codec;
-
-  InitializeCodec();
-}
-
-AudioDecoder::~AudioDecoder() {
-  TeardownCodec();
-}
-
-void AudioDecoder::Decode(const InputBuffer& input_buffer) {
-  SB_CHECK(codec_context_ != NULL);
-
-  if (stream_ended_) {
-    SB_LOG(ERROR) << "Decode() is called after WriteEndOfStream() is called.";
-    return;
-  }
-
-  AVPacket packet;
-  av_init_packet(&packet);
-  packet.data = const_cast<uint8_t*>(input_buffer.data());
-  packet.size = input_buffer.size();
-
-  avcodec_get_frame_defaults(av_frame_);
-  int frame_decoded = 0;
-  int result =
-      avcodec_decode_audio4(codec_context_, av_frame_, &frame_decoded, &packet);
-  if (result != input_buffer.size() || frame_decoded != 1) {
-    // TODO: Consider fill it with silence.
-    SB_DLOG(WARNING) << "avcodec_decode_audio4() failed with result: " << result
-                     << " with input buffer size: " << input_buffer.size()
-                     << " and frame decoded: " << frame_decoded;
-    return;
-  }
-
-  int decoded_audio_size = av_samples_get_buffer_size(
-      NULL, codec_context_->channels, av_frame_->nb_samples,
-      codec_context_->sample_fmt, 1);
-  audio_header_.samples_per_second = codec_context_->sample_rate;
-
-  if (decoded_audio_size > 0) {
-    scoped_refptr<DecodedAudio> decoded_audio = new DecodedAudio(
-        codec_context_->channels, sample_type_, GetStorageType(),
-        input_buffer.pts(),
-        codec_context_->channels * av_frame_->nb_samples *
-            (sample_type_ == kSbMediaAudioSampleTypeInt16 ? 2 : 4));
-    SbMemoryCopy(decoded_audio->buffer(), *av_frame_->extended_data,
-                 decoded_audio->size());
-    decoded_audios_.push(decoded_audio);
-  } else {
-    // TODO: Consider fill it with silence.
-    SB_LOG(ERROR) << "Decoded audio frame is empty.";
-  }
-}
-
-void AudioDecoder::WriteEndOfStream() {
-  // AAC has no dependent frames so we needn't flush the decoder.  Set the flag
-  // to ensure that Decode() is not called when the stream is ended.
-  stream_ended_ = true;
-  // Put EOS into the queue.
-  decoded_audios_.push(new DecodedAudio);
-}
-
-scoped_refptr<AudioDecoder::DecodedAudio> AudioDecoder::Read() {
-  scoped_refptr<DecodedAudio> result;
-  if (!decoded_audios_.empty()) {
-    result = decoded_audios_.front();
-    decoded_audios_.pop();
-  }
-  return result;
-}
-
-void AudioDecoder::Reset() {
-  stream_ended_ = false;
-  while (!decoded_audios_.empty()) {
-    decoded_audios_.pop();
-  }
-}
-
-SbMediaAudioSampleType AudioDecoder::GetSampleType() const {
-  return sample_type_;
-}
-
-int AudioDecoder::GetSamplesPerSecond() const {
-  return audio_header_.samples_per_second;
-}
-
-void AudioDecoder::InitializeCodec() {
-  InitializeFfmpeg();
-
-  codec_context_ = avcodec_alloc_context3(NULL);
-
-  if (codec_context_ == NULL) {
-    SB_LOG(ERROR) << "Unable to allocate ffmpeg codec context";
-    return;
-  }
-
-  codec_context_->codec_type = AVMEDIA_TYPE_AUDIO;
-  codec_context_->codec_id = GetFfmpegCodecIdByMediaCodec(audio_codec_);
-  // Request_sample_fmt is set by us, but sample_fmt is set by the decoder.
-  if (sample_type_ == kSbMediaAudioSampleTypeInt16) {
-    codec_context_->request_sample_fmt = AV_SAMPLE_FMT_S16;
-  } else {
-    codec_context_->request_sample_fmt = AV_SAMPLE_FMT_FLT;
-  }
-
-  codec_context_->channels = audio_header_.number_of_channels;
-  codec_context_->sample_rate = audio_header_.samples_per_second;
-
-  codec_context_->extradata = NULL;
-  codec_context_->extradata_size = 0;
-
-  AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
-
-  if (codec == NULL) {
-    SB_LOG(ERROR) << "Unable to allocate ffmpeg codec context";
-    TeardownCodec();
-    return;
-  }
-
-  int rv = OpenCodec(codec_context_, codec);
-  if (rv < 0) {
-    SB_LOG(ERROR) << "Unable to open codec";
-    TeardownCodec();
-    return;
-  }
-
-  av_frame_ = avcodec_alloc_frame();
-  if (av_frame_ == NULL) {
-    SB_LOG(ERROR) << "Unable to allocate audio frame";
-    TeardownCodec();
-  }
-}
-
-void AudioDecoder::TeardownCodec() {
-  if (codec_context_) {
-    CloseCodec(codec_context_);
-    av_free(codec_context_);
-    codec_context_ = NULL;
-  }
-  if (av_frame_) {
-    av_free(av_frame_);
-    av_frame_ = NULL;
-  }
-}
-
-}  // namespace ffmpeg
-}  // namespace shared
-}  // namespace starboard
diff --git a/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_audio_decoder.h b/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_audio_decoder.h
deleted file mode 100644
index 42e20a7..0000000
--- a/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_audio_decoder.h
+++ /dev/null
@@ -1,71 +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 STARBOARD_CONTRIB_TIZEN_SHARED_FFMPEG_FFMPEG_AUDIO_DECODER_H_
-#define STARBOARD_CONTRIB_TIZEN_SHARED_FFMPEG_FFMPEG_AUDIO_DECODER_H_
-
-#include <queue>
-
-#include "starboard/media.h"
-#include "starboard/shared/internal_only.h"
-#include "starboard/shared/starboard/player/decoded_audio_internal.h"
-#include "starboard/shared/starboard/player/filter/audio_decoder_internal.h"
-#include "starboard/contrib/tizen/shared/ffmpeg/ffmpeg_common.h"
-
-namespace starboard {
-namespace shared {
-namespace ffmpeg {
-
-class AudioDecoder : public starboard::player::filter::AudioDecoder {
- public:
-  typedef starboard::player::DecodedAudio DecodedAudio;
-  typedef starboard::player::InputBuffer InputBuffer;
-
-  AudioDecoder(SbMediaAudioCodec audio_codec,
-               const SbMediaAudioHeader& audio_header);
-  ~AudioDecoder() override;
-
-  void Decode(const InputBuffer& input_buffer) override;
-  void WriteEndOfStream() override;
-  scoped_refptr<DecodedAudio> Read() override;
-  void Reset() override;
-  SbMediaAudioSampleType GetSampleType() const override;
-  int GetSamplesPerSecond() const override;
-  bool CanAcceptMoreData() const override {
-    return !stream_ended_ && decoded_audios_.size() <= kMaxDecodedAudiosSize;
-  }
-
-  bool is_valid() const { return codec_context_ != NULL; }
-
- private:
-  void InitializeCodec();
-  void TeardownCodec();
-
-  static const int kMaxDecodedAudiosSize = 64;
-
-  SbMediaAudioCodec audio_codec_;
-  SbMediaAudioSampleType sample_type_;
-  AVCodecContext* codec_context_;
-  AVFrame* av_frame_;
-
-  bool stream_ended_;
-  std::queue<scoped_refptr<DecodedAudio> > decoded_audios_;
-  SbMediaAudioHeader audio_header_;
-};
-
-}  // namespace ffmpeg
-}  // namespace shared
-}  // namespace starboard
-
-#endif  // STARBOARD_CONTRIB_TIZEN_SHARED_FFMPEG_FFMPEG_AUDIO_DECODER_H_
diff --git a/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_common.cc b/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_common.cc
deleted file mode 100644
index cc7e83a..0000000
--- a/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_common.cc
+++ /dev/null
@@ -1,52 +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.
-
-#include "starboard/contrib/tizen/shared/ffmpeg/ffmpeg_common.h"
-
-#include "starboard/log.h"
-#include "starboard/mutex.h"
-#include "starboard/once.h"
-
-namespace starboard {
-namespace shared {
-namespace ffmpeg {
-
-namespace {
-
-SbOnceControl ffmpeg_initialization_once = SB_ONCE_INITIALIZER;
-SbMutex codec_mutex = SB_MUTEX_INITIALIZER;
-
-}  // namespace
-
-void InitializeFfmpeg() {
-  bool initialized = SbOnce(&ffmpeg_initialization_once, av_register_all);
-  SB_DCHECK(initialized);
-}
-
-int OpenCodec(AVCodecContext* codec_context, const AVCodec* codec) {
-  SbMutexAcquire(&codec_mutex);
-  int result = avcodec_open2(codec_context, codec, NULL);
-  SbMutexRelease(&codec_mutex);
-  return result;
-}
-
-void CloseCodec(AVCodecContext* codec_context) {
-  SbMutexAcquire(&codec_mutex);
-  avcodec_close(codec_context);
-  SbMutexRelease(&codec_mutex);
-}
-
-}  // namespace ffmpeg
-}  // namespace shared
-}  // namespace starboard
diff --git a/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_common.h b/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_common.h
deleted file mode 100644
index 3db515e..0000000
--- a/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_common.h
+++ /dev/null
@@ -1,47 +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 STARBOARD_TIZEN_SHARED_FFMPEG_FFMPEG_COMMON_H_
-#define STARBOARD_TIZEN_SHARED_FFMPEG_FFMPEG_COMMON_H_
-
-// Include FFmpeg header files.
-extern "C" {
-#include <libavcodec/avcodec.h>
-#include <libavformat/avformat.h>
-#include <libavutil/avutil.h>
-#include <libavutil/imgutils.h>
-#include <libavutil/opt.h>
-}  // extern "C"
-
-#include "starboard/shared/internal_only.h"
-
-namespace starboard {
-namespace shared {
-namespace ffmpeg {
-
-void InitializeFfmpeg();
-
-// In Ffmpeg, the calls to avcodec_open2() and avcodec_close() are not
-// synchronized internally so it is the responsibility of its user to ensure
-// that these calls don't overlap.  The following functions acquires a lock
-// internally before calling avcodec_open2() and avcodec_close() to enforce
-// this.
-int OpenCodec(AVCodecContext* codec_context, const AVCodec* codec);
-void CloseCodec(AVCodecContext* codec_context);
-
-}  // namespace ffmpeg
-}  // namespace shared
-}  // namespace starboard
-
-#endif  // STARBOARD_TIZEN_SHARED_FFMPEG_FFMPEG_COMMON_H_
diff --git a/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_video_decoder.cc b/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_video_decoder.cc
deleted file mode 100644
index f0fe7be..0000000
--- a/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_video_decoder.cc
+++ /dev/null
@@ -1,315 +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.
-
-#include "starboard/contrib/tizen/shared/ffmpeg/ffmpeg_video_decoder.h"
-
-#include "starboard/memory.h"
-
-namespace starboard {
-namespace shared {
-namespace ffmpeg {
-
-namespace {
-
-// FFmpeg requires its decoding buffers to align with platform alignment.  It
-// mentions inside
-// http://ffmpeg.org/doxygen/trunk/structAVFrame.html#aa52bfc6605f6a3059a0c3226cc0f6567
-// that the alignment on most modern desktop systems are 16 or 32.
-static const int kAlignment = 32;
-
-size_t AlignUp(size_t size, int alignment) {
-  SB_DCHECK((alignment & (alignment - 1)) == 0);
-  return (size + alignment - 1) & ~(alignment - 1);
-}
-
-size_t GetYV12SizeInBytes(int32_t width, int32_t height) {
-  return width * height * 3 / 2;
-}
-
-int AllocateBuffer(AVCodecContext* codec_context, AVFrame* frame) {
-  if (codec_context->pix_fmt != PIX_FMT_YUV420P &&
-      codec_context->pix_fmt != PIX_FMT_YUVJ420P) {
-    SB_DLOG(WARNING) << "Unsupported pix_fmt " << codec_context->pix_fmt;
-    return AVERROR(EINVAL);
-  }
-
-  int ret =
-      av_image_check_size(codec_context->width, codec_context->height, 0, NULL);
-  if (ret < 0) {
-    return ret;
-  }
-
-  // Align to kAlignment * 2 as we will divide y_stride by 2 for u and v planes
-  size_t y_stride = AlignUp(codec_context->width, kAlignment * 2);
-  size_t uv_stride = y_stride / 2;
-  size_t aligned_height = AlignUp(codec_context->height, kAlignment * 2);
-  uint8_t* frame_buffer = reinterpret_cast<uint8_t*>(SbMemoryAllocateAligned(
-      kAlignment, GetYV12SizeInBytes(y_stride, aligned_height)));
-
-  // y plane
-  frame->base[0] = frame_buffer;
-  frame->data[0] = frame->base[0];
-  frame->linesize[0] = y_stride;
-  // u plane
-  frame->base[1] = frame_buffer + y_stride * aligned_height;
-  frame->data[1] = frame->base[1];
-  frame->linesize[1] = uv_stride;
-  // v plane
-  frame->base[2] = frame->base[1] + uv_stride * aligned_height / 2;
-  frame->data[2] = frame->base[2];
-  frame->linesize[2] = uv_stride;
-
-  frame->opaque = frame_buffer;
-  frame->type = FF_BUFFER_TYPE_USER;
-  frame->pkt_pts =
-      codec_context->pkt ? codec_context->pkt->pts : AV_NOPTS_VALUE;
-  frame->width = codec_context->width;
-  frame->height = codec_context->height;
-  frame->format = codec_context->pix_fmt;
-
-  frame->reordered_opaque = codec_context->reordered_opaque;
-
-  return 0;
-}
-
-void ReleaseBuffer(AVCodecContext*, AVFrame* frame) {
-  SbMemoryDeallocate(frame->opaque);
-  frame->opaque = NULL;
-
-  // The FFmpeg API expects us to zero the data pointers in this callback.
-  SbMemorySet(frame->data, 0, sizeof(frame->data));
-}
-
-}  // namespace
-
-VideoDecoder::VideoDecoder(SbMediaVideoCodec video_codec)
-    : video_codec_(video_codec),
-      host_(NULL),
-      codec_context_(NULL),
-      av_frame_(NULL),
-      stream_ended_(false),
-      error_occured_(false),
-      decoder_thread_(kSbThreadInvalid) {
-  InitializeCodec();
-}
-
-VideoDecoder::~VideoDecoder() {
-  Reset();
-  TeardownCodec();
-}
-
-void VideoDecoder::SetHost(Host* host) {
-  SB_DCHECK(host != NULL);
-  SB_DCHECK(host_ == NULL);
-  host_ = host;
-}
-
-void VideoDecoder::WriteInputBuffer(const InputBuffer& input_buffer) {
-  SB_DCHECK(queue_.Poll().type == kInvalid);
-  SB_DCHECK(host_ != NULL);
-
-  if (stream_ended_) {
-    SB_LOG(ERROR) << "WriteInputFrame() was called after WriteEndOfStream().";
-    return;
-  }
-
-  if (!SbThreadIsValid(decoder_thread_)) {
-    decoder_thread_ =
-        SbThreadCreate(0, kSbThreadPriorityHigh, kSbThreadNoAffinity, true,
-                       "ff_video_dec", &VideoDecoder::ThreadEntryPoint, this);
-    SB_DCHECK(SbThreadIsValid(decoder_thread_));
-  }
-
-  queue_.Put(Event(input_buffer));
-}
-
-void VideoDecoder::WriteEndOfStream() {
-  SB_DCHECK(host_ != NULL);
-
-  // We have to flush the decoder to decode the rest frames and to ensure that
-  // Decode() is not called when the stream is ended.
-  stream_ended_ = true;
-  queue_.Put(Event(kWriteEndOfStream));
-}
-
-void VideoDecoder::Reset() {
-  // Join the thread to ensure that all callbacks in process are finished.
-  if (SbThreadIsValid(decoder_thread_)) {
-    queue_.Put(Event(kReset));
-    SbThreadJoin(decoder_thread_, NULL);
-  }
-
-  if (codec_context_ != NULL) {
-    avcodec_flush_buffers(codec_context_);
-  }
-
-  decoder_thread_ = kSbThreadInvalid;
-  stream_ended_ = false;
-}
-
-// static
-void* VideoDecoder::ThreadEntryPoint(void* context) {
-  SB_DCHECK(context);
-  VideoDecoder* decoder = reinterpret_cast<VideoDecoder*>(context);
-  decoder->DecoderThreadFunc();
-  return NULL;
-}
-
-void VideoDecoder::DecoderThreadFunc() {
-  for (;;) {
-    Event event = queue_.Get();
-    if (event.type == kReset) {
-      return;
-    }
-    if (error_occured_) {
-      continue;
-    }
-    if (event.type == kWriteInputBuffer) {
-      // Send |input_buffer| to ffmpeg and try to decode one frame.
-      AVPacket packet;
-      av_init_packet(&packet);
-      packet.data = const_cast<uint8_t*>(event.input_buffer.data());
-      packet.size = event.input_buffer.size();
-      packet.pts = event.input_buffer.pts();
-      codec_context_->reordered_opaque = packet.pts;
-
-      DecodePacket(&packet);
-      host_->OnDecoderStatusUpdate(kNeedMoreInput, NULL);
-    } else {
-      SB_DCHECK(event.type == kWriteEndOfStream);
-      // Stream has ended, try to decode any frames left in ffmpeg.
-      AVPacket packet;
-      do {
-        av_init_packet(&packet);
-        packet.data = NULL;
-        packet.size = 0;
-        packet.pts = 0;
-      } while (DecodePacket(&packet));
-
-      host_->OnDecoderStatusUpdate(kBufferFull, VideoFrame::CreateEOSFrame());
-    }
-  }
-}
-
-bool VideoDecoder::DecodePacket(AVPacket* packet) {
-  SB_DCHECK(packet != NULL);
-
-  avcodec_get_frame_defaults(av_frame_);
-  int frame_decoded = 0;
-  int result =
-      avcodec_decode_video2(codec_context_, av_frame_, &frame_decoded, packet);
-  if (frame_decoded == 0) {
-    return false;
-  }
-
-  if (av_frame_->opaque == NULL) {
-    SB_DLOG(ERROR) << "Video frame was produced yet has invalid frame data.";
-    host_->OnDecoderStatusUpdate(kFatalError, NULL);
-    error_occured_ = true;
-    return false;
-  }
-
-  int pitch = AlignUp(av_frame_->width, kAlignment * 2);
-
-  scoped_refptr<VideoFrame> frame = VideoFrame::CreateYV12Frame(
-      av_frame_->width, av_frame_->height, pitch,
-      codec_context_->reordered_opaque, av_frame_->data[0], av_frame_->data[1],
-      av_frame_->data[2]);
-  host_->OnDecoderStatusUpdate(kBufferFull, frame);
-  return true;
-}
-
-void VideoDecoder::InitializeCodec() {
-  InitializeFfmpeg();
-
-  codec_context_ = avcodec_alloc_context3(NULL);
-
-  if (codec_context_ == NULL) {
-    SB_LOG(ERROR) << "Unable to allocate ffmpeg codec context";
-    return;
-  }
-
-  codec_context_->codec_type = AVMEDIA_TYPE_VIDEO;
-  codec_context_->codec_id = AV_CODEC_ID_H264;
-  codec_context_->profile = FF_PROFILE_UNKNOWN;
-  codec_context_->coded_width = 0;
-  codec_context_->coded_height = 0;
-  codec_context_->pix_fmt = PIX_FMT_NONE;
-
-  codec_context_->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
-  codec_context_->thread_count = 2;
-  codec_context_->opaque = this;
-  codec_context_->flags |= CODEC_FLAG_EMU_EDGE;
-  codec_context_->get_buffer = AllocateBuffer;
-  codec_context_->release_buffer = ReleaseBuffer;
-
-  codec_context_->extradata = NULL;
-  codec_context_->extradata_size = 0;
-
-  AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
-
-  if (codec == NULL) {
-    SB_LOG(ERROR) << "Unable to allocate ffmpeg codec context";
-    TeardownCodec();
-    return;
-  }
-
-  int rv = OpenCodec(codec_context_, codec);
-  if (rv < 0) {
-    SB_LOG(ERROR) << "Unable to open codec";
-    TeardownCodec();
-    return;
-  }
-
-  av_frame_ = avcodec_alloc_frame();
-  if (av_frame_ == NULL) {
-    SB_LOG(ERROR) << "Unable to allocate audio frame";
-    TeardownCodec();
-  }
-}
-
-void VideoDecoder::TeardownCodec() {
-  if (codec_context_) {
-    CloseCodec(codec_context_);
-    av_free(codec_context_);
-    codec_context_ = NULL;
-  }
-  if (av_frame_) {
-    av_free(av_frame_);
-    av_frame_ = NULL;
-  }
-}
-
-}  // namespace ffmpeg
-
-namespace starboard {
-namespace player {
-namespace filter {
-
-// static
-bool VideoDecoder::OutputModeSupported(SbPlayerOutputMode output_mode,
-                                       SbMediaVideoCodec codec,
-                                       SbDrmSystem drm_system) {
-  SB_UNREFERENCED_PARAMETER(codec);
-  SB_UNREFERENCED_PARAMETER(drm_system);
-
-  return output_mode == kSbPlayerOutputModePunchOut;
-}
-
-}  // namespace filter
-}  // namespace player
-}  // namespace starboard
-
-}  // namespace shared
-}  // namespace starboard
diff --git a/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_video_decoder.h b/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_video_decoder.h
deleted file mode 100644
index 5d257ac..0000000
--- a/src/starboard/contrib/tizen/shared/ffmpeg/ffmpeg_video_decoder.h
+++ /dev/null
@@ -1,98 +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 STARBOARD_CONTRIB_TIZEN_SHARED_FFMPEG_FFMPEG_VIDEO_DECODER_H_
-#define STARBOARD_CONTRIB_TIZEN_SHARED_FFMPEG_FFMPEG_VIDEO_DECODER_H_
-
-#include "starboard/log.h"
-#include "starboard/media.h"
-#include "starboard/queue.h"
-#include "starboard/shared/internal_only.h"
-#include "starboard/shared/starboard/player/filter/video_decoder_internal.h"
-#include "starboard/shared/starboard/player/input_buffer_internal.h"
-#include "starboard/shared/starboard/player/video_frame_internal.h"
-#include "starboard/thread.h"
-#include "starboard/contrib/tizen/shared/ffmpeg/ffmpeg_common.h"
-
-namespace starboard {
-namespace shared {
-namespace ffmpeg {
-
-class VideoDecoder : public starboard::player::filter::HostedVideoDecoder {
- public:
-  typedef starboard::player::InputBuffer InputBuffer;
-  typedef starboard::player::VideoFrame VideoFrame;
-
-  explicit VideoDecoder(SbMediaVideoCodec video_codec);
-  ~VideoDecoder() override;
-
-  void SetHost(Host* host) override;
-  void WriteInputBuffer(const InputBuffer& input_buffer) override;
-  void WriteEndOfStream() override;
-  void Reset() override;
-
-  bool is_valid() const { return codec_context_ != NULL; }
-
- private:
-  enum EventType {
-    kInvalid,
-    kReset,
-    kWriteInputBuffer,
-    kWriteEndOfStream,
-  };
-
-  struct Event {
-    EventType type;
-    // |input_buffer| is only used when |type| is kWriteInputBuffer.
-    InputBuffer input_buffer;
-
-    explicit Event(EventType type = kInvalid) : type(type) {
-      SB_DCHECK(type != kWriteInputBuffer);
-    }
-
-    explicit Event(InputBuffer input_buffer)
-        : type(kWriteInputBuffer), input_buffer(input_buffer) {}
-  };
-
-  static void* ThreadEntryPoint(void* context);
-  void DecoderThreadFunc();
-
-  bool DecodePacket(AVPacket* packet);
-  void InitializeCodec();
-  void TeardownCodec();
-
-  // These variables will be initialized inside ctor or SetHost() and will not
-  // be changed during the life time of this class.
-  const SbMediaVideoCodec video_codec_;
-  Host* host_;
-
-  Queue<Event> queue_;
-
-  // The AV related classes will only be created and accessed on the decoder
-  // thread.
-  AVCodecContext* codec_context_;
-  AVFrame* av_frame_;
-
-  bool stream_ended_;
-  bool error_occured_;
-
-  // Working thread to avoid lengthy decoding work block the player thread.
-  SbThread decoder_thread_;
-};
-
-}  // namespace ffmpeg
-}  // namespace shared
-}  // namespace starboard
-
-#endif  // STARBOARD_CONTRIB_TIZEN_SHARED_FFMPEG_FFMPEG_VIDEO_DECODER_H_
diff --git a/src/starboard/contrib/tizen/shared/get_home_directory.cc b/src/starboard/contrib/tizen/shared/get_home_directory.cc
index 5daf338..e017e4d 100644
--- a/src/starboard/contrib/tizen/shared/get_home_directory.cc
+++ b/src/starboard/contrib/tizen/shared/get_home_directory.cc
@@ -1,4 +1,4 @@
-// Copyright 2016 Google Inc. All Rights Reserved.
+// Copyright 2016 Samsung Electronics. 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.
diff --git a/src/starboard/contrib/tizen/shared/gyp_configuration.gypi b/src/starboard/contrib/tizen/shared/gyp_configuration.gypi
index 6d16a78..45e8055 100644
--- a/src/starboard/contrib/tizen/shared/gyp_configuration.gypi
+++ b/src/starboard/contrib/tizen/shared/gyp_configuration.gypi
@@ -16,10 +16,12 @@
   'variables': {
     'target_os': 'linux',
     'tizen_os': 1,
+    'arm_version': 7,
 
     # Some package use tizen system instead of third_party
     'use_system_icu': 1,
-    'use_system_libxml': 1,
+    'use_system_libxml': 0,
+    'use_dlmalloc_allocator': 0,
 
     # scratch surface cache is designed to choose large offscreen surfaces so
     # that they can be maximally reused, it is not a very good fit for a tiled
@@ -28,7 +30,7 @@
 
     # This should have a default value in cobalt/base.gypi. See the comment
     # there for acceptable values for this variable.
-    'javascript_engine': 'mozjs',
+    'javascript_engine': 'mozjs-45',
     'cobalt_enable_jit': 0,
 
     'linker_flags': [
diff --git a/src/starboard/contrib/tizen/shared/player/filter/ffmpeg_player_components_impl.cc b/src/starboard/contrib/tizen/shared/player/filter/ffmpeg_player_components_impl.cc
deleted file mode 100644
index 84ddd6a..0000000
--- a/src/starboard/contrib/tizen/shared/player/filter/ffmpeg_player_components_impl.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2017 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 "starboard/shared/starboard/player/filter/player_components.h"
-
-#include "starboard/shared/starboard/player/filter/audio_renderer_impl_internal.h"
-#include "starboard/shared/starboard/player/filter/video_renderer_impl_internal.h"
-#include "starboard/contrib/tizen/shared/ffmpeg/ffmpeg_audio_decoder.h"
-#include "starboard/contrib/tizen/shared/ffmpeg/ffmpeg_video_decoder.h"
-
-namespace starboard {
-namespace shared {
-namespace starboard {
-namespace player {
-namespace filter {
-
-// static
-scoped_ptr<PlayerComponents> PlayerComponents::Create(
-    const AudioParameters& audio_parameters,
-    const VideoParameters& video_parameters) {
-  typedef ::starboard::shared::ffmpeg::AudioDecoder AudioDecoderImpl;
-  typedef ::starboard::shared::ffmpeg::VideoDecoder VideoDecoderImpl;
-
-  AudioDecoderImpl* audio_decoder = new AudioDecoderImpl(
-      audio_parameters.audio_codec, audio_parameters.audio_header);
-  if (!audio_decoder->is_valid()) {
-    delete audio_decoder;
-    return scoped_ptr<PlayerComponents>(NULL);
-  }
-
-  VideoDecoderImpl* video_decoder =
-      new VideoDecoderImpl(video_parameters.video_codec);
-  if (!video_decoder->is_valid()) {
-    delete video_decoder;
-    return scoped_ptr<PlayerComponents>(NULL);
-  }
-
-  AudioRendererImpl* audio_renderer =
-      new AudioRendererImpl(audio_parameters.job_queue,
-                            scoped_ptr<AudioDecoder>(audio_decoder).Pass(),
-                            audio_parameters.audio_header);
-  VideoRendererImpl* video_renderer = new VideoRendererImpl(
-      scoped_ptr<HostedVideoDecoder>(video_decoder).Pass());
-
-  return scoped_ptr<PlayerComponents>(
-      new PlayerComponents(audio_renderer, video_renderer));
-}
-
-}  // namespace filter
-}  // namespace player
-}  // namespace starboard
-}  // namespace shared
-}  // namespace starboard
diff --git a/src/starboard/contrib/tizen/shared/player/player_output_mode_supported.cc b/src/starboard/contrib/tizen/shared/player/player_output_mode_supported.cc
new file mode 100644
index 0000000..d345da0
--- /dev/null
+++ b/src/starboard/contrib/tizen/shared/player/player_output_mode_supported.cc
@@ -0,0 +1,39 @@
+// Copyright 2018 Samsung Electronics. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "starboard/player.h"
+
+#include "starboard/configuration.h"
+#include "starboard/log.h"
+#include "starboard/shared/starboard/player/filter/video_decoder_internal.h"
+
+#if SB_HAS(PLAYER_WITH_URL)
+
+bool SbPlayerOutputModeSupportedWithUrl(SbPlayerOutputMode output_mode) {
+  // Stub.
+  return false;
+}
+
+#else
+
+bool SbPlayerOutputModeSupported(SbPlayerOutputMode output_mode,
+                                 SbMediaVideoCodec codec,
+                                 SbDrmSystem drm_system) {
+  if (kSbPlayerOutputModePunchOut == output_mode)
+    return false;
+  return starboard::shared::starboard::player::filter::VideoDecoder::
+      OutputModeSupported(output_mode, codec, drm_system);
+}
+
+#endif  // SB_HAS(PLAYER_WITH_URL)
diff --git a/src/starboard/contrib/tizen/armv7l/starboard_common.gyp b/src/starboard/contrib/tizen/shared/starboard_common.gyp
similarity index 90%
rename from src/starboard/contrib/tizen/armv7l/starboard_common.gyp
rename to src/starboard/contrib/tizen/shared/starboard_common.gyp
index d627fbd..d605496 100644
--- a/src/starboard/contrib/tizen/armv7l/starboard_common.gyp
+++ b/src/starboard/contrib/tizen/shared/starboard_common.gyp
@@ -25,7 +25,14 @@
       'target_name': 'starboard_common',
       'type': 'static_library',
       'sources': [
-        '<(DEPTH)/starboard/linux/shared/system_get_connection_type.cc',
+        '<(DEPTH)/starboard/contrib/tizen/shared/audio/audio_sink_adaptor.cc',
+        '<(DEPTH)/starboard/contrib/tizen/shared/audio/audio_sink_private.cc',
+        '<(DEPTH)/starboard/contrib/tizen/shared/log/log.cc',
+        '<(DEPTH)/starboard/contrib/tizen/shared/memory_flush.cc',
+        '<(DEPTH)/starboard/contrib/tizen/shared/system_get_connection_type.cc',
+        '<(DEPTH)/starboard/contrib/tizen/shared/system_get_device_type.cc',
+        '<(DEPTH)/starboard/contrib/tizen/shared/thread_create.cc',
+        '<(DEPTH)/starboard/contrib/tizen/shared/thread_join.cc',
         '<(DEPTH)/starboard/linux/shared/system_has_capability.cc',
         '<(DEPTH)/starboard/shared/gcc/atomic_gcc_public.h',
         '<(DEPTH)/starboard/shared/iso/character_is_alphanumeric.cc',
@@ -165,7 +172,6 @@
         '<(DEPTH)/starboard/shared/pthread/thread_get_current.cc',
         '<(DEPTH)/starboard/shared/pthread/thread_get_local_value.cc',
         '<(DEPTH)/starboard/shared/pthread/thread_is_equal.cc',
-        '<(DEPTH)/starboard/shared/pthread/thread_join.cc',
         '<(DEPTH)/starboard/shared/pthread/thread_set_local_value.cc',
         '<(DEPTH)/starboard/shared/pthread/thread_yield.cc',
         '<(DEPTH)/starboard/shared/signal/crash_signals.h',
@@ -188,11 +194,6 @@
         '<(DEPTH)/starboard/shared/starboard/log_message.cc',
         '<(DEPTH)/starboard/shared/starboard/log_raw_dump_stack.cc',
         '<(DEPTH)/starboard/shared/starboard/log_raw_format.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/media_can_play_mime_and_key_system.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/media_is_output_protected.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/media_set_output_protection.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/mime_type.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/mime_type.h',
         '<(DEPTH)/starboard/shared/starboard/new.cc',
         '<(DEPTH)/starboard/shared/starboard/queue_application.cc',
         '<(DEPTH)/starboard/shared/starboard/string_concat.cc',
@@ -206,26 +207,9 @@
         '<(DEPTH)/starboard/shared/starboard/system_request_suspend.cc',
         '<(DEPTH)/starboard/shared/starboard/system_request_unpause.cc',
         '<(DEPTH)/starboard/shared/starboard/window_set_default_options.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/media_get_audio_configuration_stereo_only.cc',
-        '<(DEPTH)/starboard/shared/starboard/media/media_get_audio_output_count_stereo_only.cc',
-        '<(DEPTH)/starboard/shared/stub/media_is_supported.cc',
-        '<(DEPTH)/starboard/shared/stub/system_clear_platform_error.cc',
         '<(DEPTH)/starboard/shared/stub/system_get_total_gpu_memory.cc',
         '<(DEPTH)/starboard/shared/stub/system_get_used_gpu_memory.cc',
-        '<(DEPTH)/starboard/shared/stub/system_hide_splash_screen.cc',
-        '<(DEPTH)/starboard/shared/stub/system_raise_platform_error.cc',
-        '<(DEPTH)/starboard/shared/wayland/window_create.cc',
-        '<(DEPTH)/starboard/shared/wayland/window_destroy.cc',
-        '<(DEPTH)/starboard/shared/wayland/window_get_platform_handle.cc',
-        '<(DEPTH)/starboard/shared/wayland/window_get_size.cc',
-        '<(DEPTH)/starboard/shared/wayland/window_internal.cc',
-        '<(DEPTH)/starboard/contrib/tizen/shared/system_get_device_type.cc',
-        '<(DEPTH)/starboard/contrib/tizen/shared/thread_create.cc',
-        '<(DEPTH)/starboard/contrib/tizen/shared/audio/audio_sink_adaptor.cc',
-        '<(DEPTH)/starboard/contrib/tizen/shared/audio/audio_sink_private.cc',
-        '<(DEPTH)/starboard/contrib/tizen/shared/log/log.cc',
-        '<(DEPTH)/starboard/contrib/tizen/shared/get_home_directory.cc',
-        '<(DEPTH)/starboard/contrib/tizen/shared/memory_flush.cc',
+        '<(DEPTH)/starboard/shared/wayland/egl_workaround.cc',
       ],
       'defines': [
         # This must be defined when building Starboard, and must not when
@@ -236,6 +220,7 @@
         '<(DEPTH)/starboard/common/common.gyp:common',
         '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:capi-appfw-application',
         '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:capi-media-audio-io',
+        '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:capi-network-connection',
         '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:edbus',
         '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:elementary',
         '<(DEPTH)/starboard/contrib/tizen/shared/system.gyp:evas',
diff --git a/src/starboard/contrib/tizen/shared/starboard_platform.gypi b/src/starboard/contrib/tizen/shared/starboard_platform.gypi
new file mode 100644
index 0000000..62e1fe7
--- /dev/null
+++ b/src/starboard/contrib/tizen/shared/starboard_platform.gypi
@@ -0,0 +1,373 @@
+# 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.
+{
+  'variables': {
+    'starboard_platform_sources': [
+      '<(DEPTH)/starboard/contrib/tizen/shared/alsa/alsa_audio_sink_type.cc',
+      '<(DEPTH)/starboard/contrib/tizen/shared/alsa/alsa_util.cc',
+      '<(DEPTH)/starboard/contrib/tizen/shared/alsa/alsa_util.h',
+      '<(DEPTH)/starboard/contrib/tizen/shared/alsa/audio_sink_is_audio_sample_type_supported.cc',
+      '<(DEPTH)/starboard/contrib/tizen/shared/atomic_public.h',
+      '<(DEPTH)/starboard/contrib/tizen/shared/configuration_public.h',
+      '<(DEPTH)/starboard/contrib/tizen/shared/get_home_directory.cc',
+      '<(DEPTH)/starboard/contrib/tizen/shared/memory_flush.cc',
+      '<(DEPTH)/starboard/contrib/tizen/shared/player/player_output_mode_supported.cc',
+      '<(DEPTH)/starboard/contrib/tizen/shared/system_get_connection_type.cc',
+      '<(DEPTH)/starboard/contrib/tizen/shared/system_get_path.cc',
+      '<(DEPTH)/starboard/contrib/tizen/shared/system_get_device_type.cc',
+      '<(DEPTH)/starboard/contrib/tizen/shared/wayland/application_tizen.cc',
+      '<(DEPTH)/starboard/contrib/tizen/shared/wayland/application_tizen.h',
+      '<(DEPTH)/starboard/contrib/tizen/shared/wayland/window_internal_tizen.cc',
+      '<(DEPTH)/starboard/contrib/tizen/shared/wayland/window_internal_tizen.h',
+      '<(DEPTH)/starboard/linux/shared/decode_target_get_info.cc',
+      '<(DEPTH)/starboard/linux/shared/decode_target_internal.cc',
+      '<(DEPTH)/starboard/linux/shared/decode_target_internal.h',
+      '<(DEPTH)/starboard/linux/shared/decode_target_release.cc',
+      '<(DEPTH)/starboard/linux/shared/media_is_video_supported.cc',
+      '<(DEPTH)/starboard/linux/shared/player_components_impl.cc',
+      '<(DEPTH)/starboard/linux/shared/system_has_capability.cc',
+      '<(DEPTH)/starboard/shared/alsa/alsa_audio_sink_type.h',
+      '<(DEPTH)/starboard/shared/alsa/audio_sink_get_max_channels.cc',
+      '<(DEPTH)/starboard/shared/alsa/audio_sink_get_nearest_supported_sample_frequency.cc',
+      '<(DEPTH)/starboard/shared/alsa/audio_sink_is_audio_frame_storage_type_supported.cc',
+      '<(DEPTH)/starboard/shared/dlmalloc/memory_map.cc',
+      '<(DEPTH)/starboard/shared/dlmalloc/memory_unmap.cc',
+      '<(DEPTH)/starboard/shared/gcc/atomic_gcc_public.h',
+      '<(DEPTH)/starboard/shared/iso/character_is_alphanumeric.cc',
+      '<(DEPTH)/starboard/shared/iso/character_is_digit.cc',
+      '<(DEPTH)/starboard/shared/iso/character_is_hex_digit.cc',
+      '<(DEPTH)/starboard/shared/iso/character_is_space.cc',
+      '<(DEPTH)/starboard/shared/iso/character_is_upper.cc',
+      '<(DEPTH)/starboard/shared/iso/character_to_lower.cc',
+      '<(DEPTH)/starboard/shared/iso/character_to_upper.cc',
+      '<(DEPTH)/starboard/shared/iso/directory_close.cc',
+      '<(DEPTH)/starboard/shared/iso/directory_get_next.cc',
+      '<(DEPTH)/starboard/shared/iso/directory_open.cc',
+      '<(DEPTH)/starboard/shared/iso/double_absolute.cc',
+      '<(DEPTH)/starboard/shared/iso/double_exponent.cc',
+      '<(DEPTH)/starboard/shared/iso/double_floor.cc',
+      '<(DEPTH)/starboard/shared/iso/double_is_finite.cc',
+      '<(DEPTH)/starboard/shared/iso/double_is_nan.cc',
+      '<(DEPTH)/starboard/shared/iso/memory_compare.cc',
+      '<(DEPTH)/starboard/shared/iso/memory_copy.cc',
+      '<(DEPTH)/starboard/shared/iso/memory_find_byte.cc',
+      '<(DEPTH)/starboard/shared/iso/memory_move.cc',
+      '<(DEPTH)/starboard/shared/iso/memory_set.cc',
+      '<(DEPTH)/starboard/shared/iso/string_compare.cc',
+      '<(DEPTH)/starboard/shared/iso/string_compare_all.cc',
+      '<(DEPTH)/starboard/shared/iso/string_find_character.cc',
+      '<(DEPTH)/starboard/shared/iso/string_find_last_character.cc',
+      '<(DEPTH)/starboard/shared/iso/string_find_string.cc',
+      '<(DEPTH)/starboard/shared/iso/string_get_length.cc',
+      '<(DEPTH)/starboard/shared/iso/string_get_length_wide.cc',
+      '<(DEPTH)/starboard/shared/iso/string_parse_double.cc',
+      '<(DEPTH)/starboard/shared/iso/string_parse_signed_integer.cc',
+      '<(DEPTH)/starboard/shared/iso/string_parse_uint64.cc',
+      '<(DEPTH)/starboard/shared/iso/string_parse_unsigned_integer.cc',
+      '<(DEPTH)/starboard/shared/iso/string_scan.cc',
+      '<(DEPTH)/starboard/shared/iso/system_binary_search.cc',
+      '<(DEPTH)/starboard/shared/iso/system_sort.cc',
+      '<(DEPTH)/starboard/shared/libevent/socket_waiter_add.cc',
+      '<(DEPTH)/starboard/shared/libevent/socket_waiter_create.cc',
+      '<(DEPTH)/starboard/shared/libevent/socket_waiter_destroy.cc',
+      '<(DEPTH)/starboard/shared/libevent/socket_waiter_internal.cc',
+      '<(DEPTH)/starboard/shared/libevent/socket_waiter_remove.cc',
+      '<(DEPTH)/starboard/shared/libevent/socket_waiter_wait.cc',
+      '<(DEPTH)/starboard/shared/libevent/socket_waiter_wait_timed.cc',
+      '<(DEPTH)/starboard/shared/libevent/socket_waiter_wake_up.cc',
+      '<(DEPTH)/starboard/shared/libvpx/vpx_video_decoder.cc',
+      '<(DEPTH)/starboard/shared/libvpx/vpx_video_decoder.h',
+      '<(DEPTH)/starboard/shared/linux/byte_swap.cc',
+      '<(DEPTH)/starboard/shared/linux/memory_get_stack_bounds.cc',
+      '<(DEPTH)/starboard/shared/linux/page_internal.cc',
+      '<(DEPTH)/starboard/shared/linux/socket_get_interface_address.cc',
+      '<(DEPTH)/starboard/shared/linux/system_get_random_data.cc',
+      '<(DEPTH)/starboard/shared/linux/system_get_stack.cc',
+      '<(DEPTH)/starboard/shared/linux/system_get_total_cpu_memory.cc',
+      '<(DEPTH)/starboard/shared/linux/system_is_debugger_attached.cc',
+      '<(DEPTH)/starboard/shared/linux/system_symbolize.cc',
+      '<(DEPTH)/starboard/shared/linux/thread_get_id.cc',
+      '<(DEPTH)/starboard/shared/linux/thread_get_name.cc',
+      '<(DEPTH)/starboard/shared/linux/thread_set_name.cc',
+      '<(DEPTH)/starboard/shared/nouser/user_get_current.cc',
+      '<(DEPTH)/starboard/shared/nouser/user_get_property.cc',
+      '<(DEPTH)/starboard/shared/nouser/user_get_signed_in.cc',
+      '<(DEPTH)/starboard/shared/nouser/user_internal.cc',
+      '<(DEPTH)/starboard/shared/posix/directory_create.cc',
+      '<(DEPTH)/starboard/shared/posix/file_can_open.cc',
+      '<(DEPTH)/starboard/shared/posix/file_close.cc',
+      '<(DEPTH)/starboard/shared/posix/file_delete.cc',
+      '<(DEPTH)/starboard/shared/posix/file_exists.cc',
+      '<(DEPTH)/starboard/shared/posix/file_flush.cc',
+      '<(DEPTH)/starboard/shared/posix/file_get_info.cc',
+      '<(DEPTH)/starboard/shared/posix/file_get_path_info.cc',
+      '<(DEPTH)/starboard/shared/posix/file_open.cc',
+      '<(DEPTH)/starboard/shared/posix/file_read.cc',
+      '<(DEPTH)/starboard/shared/posix/file_seek.cc',
+      '<(DEPTH)/starboard/shared/posix/file_truncate.cc',
+      '<(DEPTH)/starboard/shared/posix/file_write.cc',
+      '<(DEPTH)/starboard/shared/posix/log.cc',
+      '<(DEPTH)/starboard/shared/posix/log_flush.cc',
+      '<(DEPTH)/starboard/shared/posix/log_format.cc',
+      '<(DEPTH)/starboard/shared/posix/log_is_tty.cc',
+      '<(DEPTH)/starboard/shared/posix/log_raw.cc',
+      '<(DEPTH)/starboard/shared/posix/set_non_blocking_internal.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_accept.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_bind.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_clear_last_error.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_connect.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_create.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_destroy.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_free_resolution.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_get_last_error.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_get_local_address.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_internal.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_is_connected.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_is_connected_and_idle.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_join_multicast_group.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_listen.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_receive_from.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_resolve.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_send_to.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_set_broadcast.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_set_receive_buffer_size.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_set_reuse_address.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_set_send_buffer_size.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_set_tcp_keep_alive.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_set_tcp_no_delay.cc',
+      '<(DEPTH)/starboard/shared/posix/socket_set_tcp_window_scaling.cc',
+      '<(DEPTH)/starboard/shared/posix/string_compare_no_case.cc',
+      '<(DEPTH)/starboard/shared/posix/string_compare_no_case_n.cc',
+      '<(DEPTH)/starboard/shared/posix/string_compare_wide.cc',
+      '<(DEPTH)/starboard/shared/posix/string_format.cc',
+      '<(DEPTH)/starboard/shared/posix/string_format_wide.cc',
+      '<(DEPTH)/starboard/shared/posix/system_break_into_debugger.cc',
+      '<(DEPTH)/starboard/shared/posix/system_clear_last_error.cc',
+      '<(DEPTH)/starboard/shared/posix/system_get_error_string.cc',
+      '<(DEPTH)/starboard/shared/posix/system_get_last_error.cc',
+      '<(DEPTH)/starboard/shared/posix/system_get_locale_id.cc',
+      '<(DEPTH)/starboard/shared/posix/system_get_number_of_processors.cc',
+      '<(DEPTH)/starboard/shared/posix/thread_sleep.cc',
+      '<(DEPTH)/starboard/shared/posix/time_get_monotonic_now.cc',
+      '<(DEPTH)/starboard/shared/posix/time_get_monotonic_thread_now.cc',
+      '<(DEPTH)/starboard/shared/posix/time_get_now.cc',
+      '<(DEPTH)/starboard/shared/posix/time_zone_get_current.cc',
+      '<(DEPTH)/starboard/shared/posix/time_zone_get_dst_name.cc',
+      '<(DEPTH)/starboard/shared/posix/time_zone_get_name.cc',
+      '<(DEPTH)/starboard/shared/pthread/condition_variable_broadcast.cc',
+      '<(DEPTH)/starboard/shared/pthread/condition_variable_create.cc',
+      '<(DEPTH)/starboard/shared/pthread/condition_variable_destroy.cc',
+      '<(DEPTH)/starboard/shared/pthread/condition_variable_signal.cc',
+      '<(DEPTH)/starboard/shared/pthread/condition_variable_wait.cc',
+      '<(DEPTH)/starboard/shared/pthread/condition_variable_wait_timed.cc',
+      '<(DEPTH)/starboard/shared/pthread/mutex_acquire.cc',
+      '<(DEPTH)/starboard/shared/pthread/mutex_acquire_try.cc',
+      '<(DEPTH)/starboard/shared/pthread/mutex_create.cc',
+      '<(DEPTH)/starboard/shared/pthread/mutex_destroy.cc',
+      '<(DEPTH)/starboard/shared/pthread/mutex_release.cc',
+      '<(DEPTH)/starboard/shared/pthread/once.cc',
+      '<(DEPTH)/starboard/shared/pthread/thread_create.cc',
+      '<(DEPTH)/starboard/shared/pthread/thread_create_local_key.cc',
+      '<(DEPTH)/starboard/shared/pthread/thread_create_priority.h',
+      '<(DEPTH)/starboard/shared/pthread/thread_destroy_local_key.cc',
+      '<(DEPTH)/starboard/shared/pthread/thread_detach.cc',
+      '<(DEPTH)/starboard/shared/pthread/thread_get_current.cc',
+      '<(DEPTH)/starboard/shared/pthread/thread_get_local_value.cc',
+      '<(DEPTH)/starboard/shared/pthread/thread_is_equal.cc',
+      '<(DEPTH)/starboard/shared/pthread/thread_join.cc',
+      '<(DEPTH)/starboard/shared/pthread/thread_set_local_value.cc',
+      '<(DEPTH)/starboard/shared/pthread/thread_yield.cc',
+      '<(DEPTH)/starboard/shared/signal/crash_signals.h',
+      '<(DEPTH)/starboard/shared/signal/crash_signals_sigaction.cc',
+      '<(DEPTH)/starboard/shared/signal/suspend_signals.cc',
+      '<(DEPTH)/starboard/shared/signal/suspend_signals.h',
+      '<(DEPTH)/starboard/shared/starboard/application.cc',
+      '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_create.cc',
+      '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_destroy.cc',
+      '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_internal.cc',
+      '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_internal.h',
+      '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_is_valid.cc',
+      '<(DEPTH)/starboard/shared/starboard/audio_sink/stub_audio_sink_type.cc',
+      '<(DEPTH)/starboard/shared/starboard/audio_sink/stub_audio_sink_type.h',
+      '<(DEPTH)/starboard/shared/starboard/command_line.cc',
+      '<(DEPTH)/starboard/shared/starboard/command_line.h',
+      '<(DEPTH)/starboard/shared/starboard/directory_can_open.cc',
+      '<(DEPTH)/starboard/shared/starboard/event_cancel.cc',
+      '<(DEPTH)/starboard/shared/starboard/event_schedule.cc',
+      '<(DEPTH)/starboard/shared/starboard/file_mode_string_to_flags.cc',
+      '<(DEPTH)/starboard/shared/starboard/file_storage/storage_close_record.cc',
+      '<(DEPTH)/starboard/shared/starboard/file_storage/storage_delete_record.cc',
+      '<(DEPTH)/starboard/shared/starboard/file_storage/storage_get_record_size.cc',
+      '<(DEPTH)/starboard/shared/starboard/file_storage/storage_open_record.cc',
+      '<(DEPTH)/starboard/shared/starboard/file_storage/storage_read_record.cc',
+      '<(DEPTH)/starboard/shared/starboard/file_storage/storage_write_record.cc',
+      '<(DEPTH)/starboard/shared/starboard/log_message.cc',
+      '<(DEPTH)/starboard/shared/starboard/log_raw_dump_stack.cc',
+      '<(DEPTH)/starboard/shared/starboard/log_raw_format.cc',
+      '<(DEPTH)/starboard/shared/starboard/media/codec_util.cc',
+      '<(DEPTH)/starboard/shared/starboard/media/codec_util.h',
+      '<(DEPTH)/starboard/shared/starboard/media/media_can_play_mime_and_key_system.cc',
+      '<(DEPTH)/starboard/shared/starboard/media/media_get_audio_configuration_stereo_only.cc',
+      '<(DEPTH)/starboard/shared/starboard/media/media_get_audio_output_count_stereo_only.cc',
+      '<(DEPTH)/starboard/shared/starboard/media/media_is_audio_supported_aac_only.cc',
+      '<(DEPTH)/starboard/shared/starboard/media/media_is_output_protected.cc',
+      '<(DEPTH)/starboard/shared/starboard/media/media_set_output_protection.cc',
+      '<(DEPTH)/starboard/shared/starboard/media/media_util.cc',
+      '<(DEPTH)/starboard/shared/starboard/media/media_util.h',
+      '<(DEPTH)/starboard/shared/starboard/media/mime_type.cc',
+      '<(DEPTH)/starboard/shared/starboard/media/mime_type.h',
+      '<(DEPTH)/starboard/shared/starboard/new.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/decoded_audio_internal.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/decoded_audio_internal.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/audio_decoder_internal.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/audio_frame_tracker.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/audio_frame_tracker.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_internal.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_internal.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_sink.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/audio_resampler_impl.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/audio_time_stretcher.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/audio_time_stretcher.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/cpu_video_frame.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/cpu_video_frame.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/decoded_audio_queue.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/decoded_audio_queue.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/media_time_provider.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/media_time_provider_impl.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/media_time_provider_impl.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/player_components.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/punchout_video_renderer_sink.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/punchout_video_renderer_sink.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/video_decoder_internal.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/video_frame_internal.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/video_render_algorithm.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/video_render_algorithm_impl.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/video_render_algorithm_impl.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/video_renderer_internal.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/video_renderer_internal.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/video_renderer_sink.h',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/wsola_internal.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/filter/wsola_internal.h',
+      '<(DEPTH)/starboard/shared/starboard/player/input_buffer_internal.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/input_buffer_internal.h',
+      '<(DEPTH)/starboard/shared/starboard/player/job_queue.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/job_queue.h',
+      '<(DEPTH)/starboard/shared/starboard/player/job_thread.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/job_thread.h',
+      '<(DEPTH)/starboard/shared/starboard/player/player_create.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/player_destroy.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/player_get_current_frame.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/player_get_info.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/player_internal.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/player_internal.h',
+      '<(DEPTH)/starboard/shared/starboard/player/player_seek.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/player_set_bounds.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/player_set_playback_rate.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/player_set_volume.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/player_worker.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/player_worker.h',
+      '<(DEPTH)/starboard/shared/starboard/player/player_write_end_of_stream.cc',
+      '<(DEPTH)/starboard/shared/starboard/player/player_write_sample.cc',
+      '<(DEPTH)/starboard/shared/starboard/queue_application.cc',
+      '<(DEPTH)/starboard/shared/starboard/string_concat.cc',
+      '<(DEPTH)/starboard/shared/starboard/string_concat_wide.cc',
+      '<(DEPTH)/starboard/shared/starboard/string_copy.cc',
+      '<(DEPTH)/starboard/shared/starboard/string_copy_wide.cc',
+      '<(DEPTH)/starboard/shared/starboard/string_duplicate.cc',
+      '<(DEPTH)/starboard/shared/starboard/system_get_random_uint64.cc',
+      '<(DEPTH)/starboard/shared/starboard/system_request_pause.cc',
+      '<(DEPTH)/starboard/shared/starboard/system_request_stop.cc',
+      '<(DEPTH)/starboard/shared/starboard/system_request_suspend.cc',
+      '<(DEPTH)/starboard/shared/starboard/system_request_unpause.cc',
+      '<(DEPTH)/starboard/shared/starboard/window_set_default_options.cc',
+      '<(DEPTH)/starboard/shared/stub/accessibility_get_display_settings.cc',
+      '<(DEPTH)/starboard/shared/stub/accessibility_get_text_to_speech_settings.cc',
+      '<(DEPTH)/starboard/shared/stub/cryptography_create_transformer.cc',
+      '<(DEPTH)/starboard/shared/stub/cryptography_destroy_transformer.cc',
+      '<(DEPTH)/starboard/shared/stub/cryptography_get_tag.cc',
+      '<(DEPTH)/starboard/shared/stub/cryptography_set_authenticated_data.cc',
+      '<(DEPTH)/starboard/shared/stub/cryptography_set_initialization_vector.cc',
+      '<(DEPTH)/starboard/shared/stub/cryptography_transform.cc',
+      '<(DEPTH)/starboard/shared/stub/drm_close_session.cc',
+      '<(DEPTH)/starboard/shared/stub/drm_create_system.cc',
+      '<(DEPTH)/starboard/shared/stub/drm_destroy_system.cc',
+      '<(DEPTH)/starboard/shared/stub/drm_generate_session_update_request.cc',
+      '<(DEPTH)/starboard/shared/stub/drm_system_internal.h',
+      '<(DEPTH)/starboard/shared/stub/drm_update_session.cc',
+      '<(DEPTH)/starboard/shared/stub/image_decode.cc',
+      '<(DEPTH)/starboard/shared/stub/image_is_decode_supported.cc',
+      '<(DEPTH)/starboard/shared/stub/media_is_supported.cc',
+      '<(DEPTH)/starboard/shared/stub/media_is_transfer_characteristics_supported.cc',
+      '<(DEPTH)/starboard/shared/stub/system_clear_platform_error.cc',
+      '<(DEPTH)/starboard/shared/stub/system_get_total_gpu_memory.cc',
+      '<(DEPTH)/starboard/shared/stub/system_get_used_gpu_memory.cc',
+      '<(DEPTH)/starboard/shared/stub/system_hide_splash_screen.cc',
+      '<(DEPTH)/starboard/shared/stub/system_raise_platform_error.cc',
+      '<(DEPTH)/starboard/shared/wayland/application_wayland.cc',
+      '<(DEPTH)/starboard/shared/wayland/application_wayland.h',
+      '<(DEPTH)/starboard/shared/wayland/dev_input.cc',
+      '<(DEPTH)/starboard/shared/wayland/dev_input.h',
+      '<(DEPTH)/starboard/shared/wayland/egl_workaround.cc',
+      '<(DEPTH)/starboard/shared/wayland/native_display_type.cc',
+      '<(DEPTH)/starboard/shared/wayland/window_create.cc',
+      '<(DEPTH)/starboard/shared/wayland/window_destroy.cc',
+      '<(DEPTH)/starboard/shared/wayland/window_get_platform_handle.cc',
+      '<(DEPTH)/starboard/shared/wayland/window_get_size.cc',
+      '<(DEPTH)/starboard/shared/wayland/window_internal.cc',
+      '<(DEPTH)/starboard/shared/wayland/window_internal.h',
+    ],
+    'conditions': [
+      ['use_dlmalloc_allocator==1', {
+        'starboard_platform_sources': [
+          '<(DEPTH)/starboard/shared/dlmalloc/memory_allocate_aligned_unchecked.cc',
+          '<(DEPTH)/starboard/shared/dlmalloc/memory_allocate_unchecked.cc',
+          '<(DEPTH)/starboard/shared/dlmalloc/memory_free.cc',
+          '<(DEPTH)/starboard/shared/dlmalloc/memory_free_aligned.cc',
+          '<(DEPTH)/starboard/shared/dlmalloc/memory_reallocate_unchecked.cc',
+          '<(DEPTH)/starboard/shared/dlmalloc/system_get_used_cpu_memory.cc',
+        ],
+      }, {
+        'starboard_platform_sources': [
+          '<(DEPTH)/starboard/shared/iso/memory_allocate_unchecked.cc',
+          '<(DEPTH)/starboard/shared/iso/memory_free.cc',
+          '<(DEPTH)/starboard/shared/iso/memory_reallocate_unchecked.cc',
+          '<(DEPTH)/starboard/shared/linux/system_get_used_cpu_memory.cc',
+          '<(DEPTH)/starboard/shared/posix/memory_allocate_aligned_unchecked.cc',
+          '<(DEPTH)/starboard/shared/posix/memory_free_aligned.cc',
+        ],
+      }]
+    ],
+    'starboard_platform_dependencies': [
+      '<(DEPTH)/starboard/common/common.gyp:common',
+      '<(DEPTH)/starboard/linux/shared/starboard_base_symbolize.gyp:starboard_base_symbolize',
+      '<(DEPTH)/starboard/shared/ffmpeg/ffmpeg.gyp:ffmpeg_linked',
+      '<(DEPTH)/third_party/dlmalloc/dlmalloc.gyp:dlmalloc',
+      '<(DEPTH)/third_party/libevent/libevent.gyp:libevent',
+      '<(DEPTH)/third_party/libvpx/libvpx.gyp:libvpx',
+    ],
+  },
+  'conditions': [
+    ['gl_type != "none"', {
+      'target_defaults': {
+        'include_dirs': [
+          '<(DEPTH)/third_party/khronos',
+        ],
+      }
+    }]
+  ],
+}
diff --git a/src/starboard/contrib/tizen/shared/system.gyp b/src/starboard/contrib/tizen/shared/system.gyp
index 4c23da0..8850e75 100644
--- a/src/starboard/contrib/tizen/shared/system.gyp
+++ b/src/starboard/contrib/tizen/shared/system.gyp
@@ -58,6 +58,23 @@
       },
     }, # capi-media-audio-io
     {
+      'target_name': 'capi-network-connection',
+      'type': 'none',
+      'direct_dependent_settings': {
+        'cflags': [
+          '<!@(<(pkg-config) --cflags capi-network-connection)',
+        ],
+      },
+      'link_settings': {
+        'ldflags': [
+          '<!@(<(pkg-config) --libs-only-L --libs-only-other capi-network-connection)',
+        ],
+        'libraries': [
+          '<!@(<(pkg-config) --libs-only-l capi-network-connection)',
+        ],
+      },
+    }, # capi-network-connection
+    {
       'target_name': 'capi-system-info',
       'type': 'none',
       'direct_dependent_settings': {
diff --git a/src/starboard/contrib/tizen/shared/system_get_connection_type.cc b/src/starboard/contrib/tizen/shared/system_get_connection_type.cc
new file mode 100644
index 0000000..0617fd5
--- /dev/null
+++ b/src/starboard/contrib/tizen/shared/system_get_connection_type.cc
@@ -0,0 +1,50 @@
+// Copyright 2016 Samsung Electronics. 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 <net_connection.h>
+
+#include "starboard/log.h"
+#include "starboard/system.h"
+
+SbSystemConnectionType SbSystemGetConnectionType() {
+  SbSystemConnectionType type = kSbSystemConnectionTypeUnknown;
+
+  connection_h conn;
+  if (connection_create(&conn) == CONNECTION_ERROR_NONE) {
+    connection_type_e state;
+    connection_get_type(conn, &state);
+    switch (state) {
+      case CONNECTION_TYPE_DISCONNECTED:
+        SB_DLOG(ERROR) << "No Network. We must do something.";
+        break;
+      case CONNECTION_TYPE_WIFI:      // fall through
+      case CONNECTION_TYPE_CELLULAR:  // fall through
+      case CONNECTION_TYPE_BT:
+        SB_DLOG(INFO) << "Connection Type : Wireless " << state;
+        type = kSbSystemConnectionTypeWireless;
+        break;
+      case CONNECTION_TYPE_ETHERNET:  // fall through
+      case CONNECTION_TYPE_NET_PROXY:
+        SB_DLOG(INFO) << "Connection Type : Wired " << state;
+        type = kSbSystemConnectionTypeWired;
+        break;
+      default:
+        SB_DLOG(ERROR) << "Unknown connection state : " << state;
+        break;
+    }
+    connection_destroy(conn);
+  }
+
+  return type;
+}
diff --git a/src/starboard/contrib/tizen/shared/thread_create.cc b/src/starboard/contrib/tizen/shared/thread_create.cc
index 30c4c0e..a0cc065 100644
--- a/src/starboard/contrib/tizen/shared/thread_create.cc
+++ b/src/starboard/contrib/tizen/shared/thread_create.cc
@@ -17,9 +17,10 @@
 #include <Eina.h>
 
 #include "starboard/log.h"
-#include "starboard/shared/pthread/is_success.h"
 #include "starboard/string.h"
 
+#define THREAD_LOG_ON 0
+
 namespace {
 
 struct ThreadParams {
@@ -36,6 +37,9 @@
   if (thread_params->name[0] != '\0') {
     SbThreadSetName(thread_params->name);
   }
+#if THREAD_LOG_ON
+  SB_DLOG(INFO) << "SbThreadCreate enter ============= " << thread;
+#endif
 
   delete thread_params;
 
diff --git a/src/starboard/contrib/tizen/shared/thread_join.cc b/src/starboard/contrib/tizen/shared/thread_join.cc
new file mode 100644
index 0000000..c1d447f
--- /dev/null
+++ b/src/starboard/contrib/tizen/shared/thread_join.cc
@@ -0,0 +1,52 @@
+// 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 "starboard/thread.h"
+
+#include <Eina.h>
+
+#include "starboard/log.h"
+
+#define THREAD_LOG_ON 0
+#define USE_EINA_JOIN 0
+
+bool SbThreadJoin(SbThread thread, void** out_return) {
+  if (!SbThreadIsValid(thread)) {
+    return false;
+  }
+
+#if THREAD_LOG_ON
+  SB_DLOG(INFO) << "SbThreadJoin start ============= " << thread;
+#endif
+#if USE_EINA_JOIN
+  // logically, we have to use eina's thread because we used eian's create.
+  void* joined_return = eina_thread_join(thread);
+#else
+  // but it hides error so we may copy the code and work-around the problem.
+  // refer /COMMON/Profile/platform/upstream/efl/src/lib/eina/eina_thread.c
+  void* joined_return = NULL;
+  int err = pthread_join((pthread_t)thread, &joined_return);
+  if (err)
+    return false;
+#endif
+#if THREAD_LOG_ON
+  SB_DLOG(INFO) << "SbThreadJoin end ============= " << thread;
+#endif
+
+  if (out_return) {
+    *out_return = joined_return;
+  }
+
+  return true;
+}
diff --git a/src/cobalt/dom/uint32_array.h b/src/starboard/contrib/tizen/shared/thread_types_public.h
similarity index 61%
copy from src/cobalt/dom/uint32_array.h
copy to src/starboard/contrib/tizen/shared/thread_types_public.h
index 8532467..97a8636 100644
--- a/src/cobalt/dom/uint32_array.h
+++ b/src/starboard/contrib/tizen/shared/thread_types_public.h
@@ -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,11 @@
 // 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_
+// Includes threading primitive types and initializers.
 
-#include "cobalt/dom/typed_array.h"
+#ifndef STARBOARD_CONTRIB_TIZEN_SHARED_THREAD_TYPES_PUBLIC_H_
+#define STARBOARD_CONTRIB_TIZEN_SHARED_THREAD_TYPES_PUBLIC_H_
 
-namespace cobalt {
-namespace dom {
+#include "starboard/shared/pthread/types_public.h"
 
-DEFINE_TYPED_ARRAY(Uint32Array, uint32);
-
-}  // namespace dom
-}  // namespace cobalt
-
-#endif  // COBALT_DOM_UINT32_ARRAY_H_
+#endif  // STARBOARD_CONTRIB_TIZEN_SHARED_THREAD_TYPES_PUBLIC_H_
diff --git a/src/starboard/linux/shared/cobalt/configuration.py b/src/starboard/linux/shared/cobalt/configuration.py
index c019b21..15291cb 100644
--- a/src/starboard/linux/shared/cobalt/configuration.py
+++ b/src/starboard/linux/shared/cobalt/configuration.py
@@ -54,7 +54,7 @@
         test_filter.TestFilter(
             'web_platform_tests', 'streams/WebPlatformTest.Run/11', 'debug'),
         test_filter.TestFilter(
-            'web_platform_tests', 'cors/WebPlatformTest.Run/7', 'devel')
+            'web_platform_tests', 'cors/WebPlatformTest.Run/7')
     ])
     return filters
 
diff --git a/src/starboard/linux/shared/starboard_platform.gypi b/src/starboard/linux/shared/starboard_platform.gypi
index a7f6949..8be0515 100644
--- a/src/starboard/linux/shared/starboard_platform.gypi
+++ b/src/starboard/linux/shared/starboard_platform.gypi
@@ -16,6 +16,11 @@
     '<(DEPTH)/starboard/shared/starboard/player/filter/player_filter.gypi',
   ],
   'variables': {
+    'variables': {
+      'has_cdm%': '<!(test -e <(DEPTH)/third_party/cdm/cdm/include/content_decryption_module.h && echo 1 || echo 0)',
+    },
+    # This has_cdm gets exported to gyp files that include this one.
+    'has_cdm%': '<(has_cdm)',
     'starboard_platform_sources': [
       '<@(filter_based_player_sources)',
       '<(DEPTH)/starboard/linux/shared/atomic_public.h',
@@ -223,7 +228,6 @@
       '<(DEPTH)/starboard/shared/starboard/media/media_get_audio_configuration_stereo_only.cc',
       '<(DEPTH)/starboard/shared/starboard/media/media_get_audio_output_count_stereo_only.cc',
       '<(DEPTH)/starboard/shared/starboard/media/media_is_audio_supported_aac_and_opus.cc',
-      '<(DEPTH)/starboard/shared/starboard/media/media_is_output_protected.cc',
       '<(DEPTH)/starboard/shared/starboard/media/media_set_output_protection.cc',
       '<(DEPTH)/starboard/shared/starboard/media/media_util.cc',
       '<(DEPTH)/starboard/shared/starboard/media/media_util.h',
@@ -277,17 +281,8 @@
       '<(DEPTH)/starboard/shared/stub/cryptography_set_authenticated_data.cc',
       '<(DEPTH)/starboard/shared/stub/cryptography_set_initialization_vector.cc',
       '<(DEPTH)/starboard/shared/stub/cryptography_transform.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_close_session.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_create_system.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_destroy_system.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_generate_session_update_request.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_is_server_certificate_updatable.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_system_internal.h',
-      '<(DEPTH)/starboard/shared/stub/drm_update_server_certificate.cc',
-      '<(DEPTH)/starboard/shared/stub/drm_update_session.cc',
       '<(DEPTH)/starboard/shared/stub/image_decode.cc',
       '<(DEPTH)/starboard/shared/stub/image_is_decode_supported.cc',
-      '<(DEPTH)/starboard/shared/stub/media_is_supported.cc',
       '<(DEPTH)/starboard/shared/stub/media_is_transfer_characteristics_supported.cc',
       '<(DEPTH)/starboard/shared/stub/microphone_close.cc',
       '<(DEPTH)/starboard/shared/stub/microphone_create.cc',
@@ -321,7 +316,41 @@
           '<(DEPTH)/starboard/shared/posix/memory_allocate_aligned_unchecked.cc',
           '<(DEPTH)/starboard/shared/posix/memory_free_aligned.cc',
         ],
-      }]
+      }],
+      ['has_cdm==1', {
+          'dependencies': [
+            '<(DEPTH)/starboard/linux/x64x11/widevine.gyp:wvcdm_static',
+          ],
+          'starboard_platform_sources': [
+            '<(DEPTH)/starboard/linux/x64x11/media_is_output_protected.cc',
+
+            '<(DEPTH)/starboard/shared/starboard/drm/drm_close_session.cc',
+            '<(DEPTH)/starboard/shared/starboard/drm/drm_destroy_system.cc',
+            '<(DEPTH)/starboard/shared/starboard/drm/drm_generate_session_update_request.cc',
+            '<(DEPTH)/starboard/shared/starboard/drm/drm_system_internal.h',
+            '<(DEPTH)/starboard/shared/starboard/drm/drm_update_session.cc',
+
+            '<(DEPTH)/starboard/shared/widevine/drm_create_system.cc',
+            '<(DEPTH)/starboard/shared/widevine/drm_is_server_certificate_updatable.cc',
+            '<(DEPTH)/starboard/shared/widevine/drm_system_widevine.cc',
+            '<(DEPTH)/starboard/shared/widevine/drm_system_widevine.h',
+            '<(DEPTH)/starboard/shared/widevine/drm_update_server_certificate.cc',
+            '<(DEPTH)/starboard/shared/widevine/media_is_supported.cc',
+          ],
+        }, {
+          'starboard_platform_sources': [
+            '<(DEPTH)/starboard/shared/starboard/media/media_is_output_protected.cc',
+            '<(DEPTH)/starboard/shared/stub/media_is_supported.cc',
+            '<(DEPTH)/starboard/shared/stub/drm_close_session.cc',
+            '<(DEPTH)/starboard/shared/stub/drm_create_system.cc',
+            '<(DEPTH)/starboard/shared/stub/drm_destroy_system.cc',
+            '<(DEPTH)/starboard/shared/stub/drm_generate_session_update_request.cc',
+            '<(DEPTH)/starboard/shared/stub/drm_is_server_certificate_updatable.cc',
+            '<(DEPTH)/starboard/shared/stub/drm_system_internal.h',
+            '<(DEPTH)/starboard/shared/stub/drm_update_server_certificate.cc',
+            '<(DEPTH)/starboard/shared/stub/drm_update_session.cc',
+          ],
+      }],
     ],
     'starboard_platform_dependencies': [
       '<(DEPTH)/starboard/common/common.gyp:common',
diff --git a/src/starboard/linux/x64directfb/starboard_platform.gyp b/src/starboard/linux/x64directfb/starboard_platform.gyp
index c45f24a..29be6f9 100644
--- a/src/starboard/linux/x64directfb/starboard_platform.gyp
+++ b/src/starboard/linux/x64directfb/starboard_platform.gyp
@@ -31,6 +31,13 @@
       'dependencies': [
         '<@(starboard_platform_dependencies)',
       ],
+      'conditions': [
+        ['has_cdm==1', {
+          'dependencies': [
+            '<(DEPTH)/starboard/linux/x64x11/widevine.gyp:wvcdm_static',
+          ],
+        }],
+      ],
     },
   ],
 }
diff --git a/src/starboard/linux/x64x11/clang/starboard_platform.gyp b/src/starboard/linux/x64x11/clang/starboard_platform.gyp
index 71a6d38..7e6eec8 100644
--- a/src/starboard/linux/x64x11/clang/starboard_platform.gyp
+++ b/src/starboard/linux/x64x11/clang/starboard_platform.gyp
@@ -13,6 +13,6 @@
 # limitations under the License.
 {
   'includes': [
-    '../starboard_platform.gyp',
+    '../shared/starboard_platform_target.gypi',
   ],
 }
diff --git a/src/starboard/linux/x64x11/egl/starboard_platform.gyp b/src/starboard/linux/x64x11/egl/starboard_platform.gyp
index 1b15c93..9bbf131 100644
--- a/src/starboard/linux/x64x11/egl/starboard_platform.gyp
+++ b/src/starboard/linux/x64x11/egl/starboard_platform.gyp
@@ -13,6 +13,6 @@
 # limitations under the License.
 {
   'includes': [
-    '../starboard_platform.gyp'
+    '../shared/starboard_platform_target.gypi',
   ],
 }
diff --git a/src/starboard/linux/x64x11/gcc/starboard_platform.gyp b/src/starboard/linux/x64x11/gcc/starboard_platform.gyp
index 71a6d38..7e6eec8 100644
--- a/src/starboard/linux/x64x11/gcc/starboard_platform.gyp
+++ b/src/starboard/linux/x64x11/gcc/starboard_platform.gyp
@@ -13,6 +13,6 @@
 # limitations under the License.
 {
   'includes': [
-    '../starboard_platform.gyp',
+    '../shared/starboard_platform_target.gypi',
   ],
 }
diff --git a/src/starboard/linux/x64x11/gczeal/starboard_platform.gyp b/src/starboard/linux/x64x11/gczeal/starboard_platform.gyp
index 1b15c93..9bbf131 100644
--- a/src/starboard/linux/x64x11/gczeal/starboard_platform.gyp
+++ b/src/starboard/linux/x64x11/gczeal/starboard_platform.gyp
@@ -13,6 +13,6 @@
 # limitations under the License.
 {
   'includes': [
-    '../starboard_platform.gyp'
+    '../shared/starboard_platform_target.gypi',
   ],
 }
diff --git a/src/starboard/linux/x64x11/mozjs/starboard_platform.gyp b/src/starboard/linux/x64x11/mozjs/starboard_platform.gyp
index 75991a5..ae0e74f 100644
--- a/src/starboard/linux/x64x11/mozjs/starboard_platform.gyp
+++ b/src/starboard/linux/x64x11/mozjs/starboard_platform.gyp
@@ -13,6 +13,6 @@
 # limitations under the License.
 {
   'includes': [
-    '../starboard_platform.gyp'
+    '../shared/starboard_platform_target.gypi',
   ],
 }
diff --git a/src/starboard/linux/x64x11/sbversion/4/starboard_platform.gyp b/src/starboard/linux/x64x11/sbversion/4/starboard_platform.gyp
index cb147aa..33d243c 100644
--- a/src/starboard/linux/x64x11/sbversion/4/starboard_platform.gyp
+++ b/src/starboard/linux/x64x11/sbversion/4/starboard_platform.gyp
@@ -17,8 +17,6 @@
 
 {
   'includes': [
-    # Note that we are 'includes'ing a 'gyp' file, not a 'gypi' file.  The idea
-    # is that we just want this file to *be* the parent gyp file.
-    '<(DEPTH)/starboard/linux/x64x11/starboard_platform.gyp',
+    '<(DEPTH)/starboard/linux/x64x11/shared/starboard_platform_target.gypi',
   ],
 }
diff --git a/src/starboard/linux/x64x11/starboard_platform.gypi b/src/starboard/linux/x64x11/shared/starboard_platform.gypi
similarity index 88%
rename from src/starboard/linux/x64x11/starboard_platform.gypi
rename to src/starboard/linux/x64x11/shared/starboard_platform.gypi
index efdf8ea..07a8826 100644
--- a/src/starboard/linux/x64x11/starboard_platform.gypi
+++ b/src/starboard/linux/x64x11/shared/starboard_platform.gypi
@@ -12,14 +12,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 {
-  'includes': ['../shared/starboard_platform.gypi'],
+  'includes': ['../../shared/starboard_platform.gypi'],
 
   'variables': {
-    'variables': {
-      'has_cdm%': '<!(test -e <(DEPTH)/third_party/cdm/cdm/include/content_decryption_module.h && echo 1 || echo 0)',
-    },
-    # This has_cdm gets exported to gyp files that include this one.
-    'has_cdm%': '<(has_cdm)',
     'starboard_platform_sources': [
       '<(DEPTH)/starboard/linux/x64x11/main.cc',
       '<(DEPTH)/starboard/linux/x64x11/sanitizer_options.cc',
diff --git a/src/starboard/linux/x64x11/shared/starboard_platform_target.gypi b/src/starboard/linux/x64x11/shared/starboard_platform_target.gypi
new file mode 100644
index 0000000..506a1d9
--- /dev/null
+++ b/src/starboard/linux/x64x11/shared/starboard_platform_target.gypi
@@ -0,0 +1,48 @@
+# 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.
+{
+  'includes': [
+    'starboard_platform.gypi'
+  ],
+  'targets': [
+    {
+      'target_name': 'starboard_platform',
+      'type': 'static_library',
+
+      'sources': [
+        '<@(starboard_platform_sources)',
+        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_common.cc',
+        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_common.h',
+        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_writer.cc',
+        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_writer.h',
+      ],
+      'defines': [
+        'SB_PLAYER_ENABLE_VIDEO_DUMPER',
+        # This must be defined when building Starboard, and must not when
+        # building Starboard client code.
+        'STARBOARD_IMPLEMENTATION',
+      ],
+      'dependencies': [
+        '<@(starboard_platform_dependencies)',
+      ],
+      'conditions': [
+        ['has_cdm==1', {
+          'dependencies': [
+            '<(DEPTH)/starboard/linux/x64x11/widevine.gyp:wvcdm_static',
+          ],
+        }],
+      ],
+    },
+  ],
+}
diff --git a/src/starboard/linux/x64x11/skia/starboard_platform.gyp b/src/starboard/linux/x64x11/skia/starboard_platform.gyp
index c33e4a8..7e6eec8 100644
--- a/src/starboard/linux/x64x11/skia/starboard_platform.gyp
+++ b/src/starboard/linux/x64x11/skia/starboard_platform.gyp
@@ -13,6 +13,6 @@
 # limitations under the License.
 {
   'includes': [
-    '../starboard_platform.gyp'
+    '../shared/starboard_platform_target.gypi',
   ],
 }
diff --git a/src/starboard/linux/x64x11/starboard_platform.gyp b/src/starboard/linux/x64x11/starboard_platform.gyp
index 4733075..d315df5 100644
--- a/src/starboard/linux/x64x11/starboard_platform.gyp
+++ b/src/starboard/linux/x64x11/starboard_platform.gyp
@@ -17,43 +17,6 @@
 # have no need to modify this code.
 {
   'includes': [
-    'starboard_platform.gypi'
-  ],
-  'targets': [
-    {
-      'target_name': 'starboard_platform',
-      'type': 'static_library',
-
-      'sources': [
-        '<@(starboard_platform_sources)',
-        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_common.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_common.h',
-        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_writer.cc',
-        '<(DEPTH)/starboard/shared/starboard/player/video_dmp_writer.h',
-      ],
-      'defines': [
-        'SB_PLAYER_ENABLE_VIDEO_DUMPER',
-        # This must be defined when building Starboard, and must not when
-        # building Starboard client code.
-        'STARBOARD_IMPLEMENTATION',
-      ],
-      'dependencies': [
-        '<@(starboard_platform_dependencies)',
-      ],
-      'conditions': [
-        ['has_cdm==1', {
-          'dependencies': [
-            '<(DEPTH)/starboard/linux/x64x11/widevine.gyp:wvcdm_static',
-          ],
-          'sources!': [
-            '<(DEPTH)/starboard/shared/starboard/media/media_is_output_protected.cc',
-          ],
-          'sources/': [
-            ['exclude', 'shared/stub/drm_.*'],
-            ['exclude', 'shared/stub/media_is_supported\\.cc'],
-          ],
-        }],
-      ],
-    },
+    './shared/starboard_platform_target.gypi'
   ],
 }
diff --git a/src/starboard/memory.h b/src/starboard/memory.h
index 18667be..a8bf08b 100644
--- a/src/starboard/memory.h
+++ b/src/starboard/memory.h
@@ -53,6 +53,11 @@
 // The bitwise OR of these flags should be passed to SbMemoryMap to indicate
 // how the mapped memory can be used.
 typedef enum SbMemoryMapFlags {
+  // No flags set: Reserves virtual address space. SbMemoryProtect() can later
+  // make it accessible.
+#if SB_API_VERSION >= SB_MEMORY_PROTECT_RESERVED_FLAG_API_VERSION
+  kSbMemoryMapProtectReserved = 0,
+#endif
   kSbMemoryMapProtectRead = 1 << 0,   // Mapped memory can be read.
   kSbMemoryMapProtectWrite = 1 << 1,  // Mapped memory can be written to.
 #if SB_CAN(MAP_EXECUTABLE_MEMORY)
@@ -189,15 +194,18 @@
     SB_EXPORT void SbMemoryFreeAligned(void* memory));
 
 #if SB_HAS(MMAP)
-// Allocates |size_bytes| worth of physical memory pages and maps them into an
-// available virtual region. This function returns |SB_MEMORY_MAP_FAILED| on
-// failure. |NULL| is a valid return value.
+// Allocates |size_bytes| worth of physical memory pages and maps them into
+// an available virtual region. This function returns |SB_MEMORY_MAP_FAILED|
+// on failure. |NULL| is a valid return value.
 //
 // |size_bytes|: The amount of physical memory pages to be allocated.
 // |flags|: The bitwise OR of the protection flags for the mapped memory
 //   as specified in |SbMemoryMapFlags|. Allocating executable memory is not
 //   allowed and will fail. If executable memory is needed, map non-executable
 //   memory first and then switch access to executable using SbMemoryProtect.
+//   When kSbMemoryMapProtectReserved is used, the address space will not be
+//   accessible and, if possible, the platform should not count it against any
+//   memory budget.
 // |name|: A value that appears in the debugger on some platforms. The value
 //   can be up to 32 bytes.
 SB_EXPORT void* SbMemoryMap(int64_t size_bytes, int flags, const char* name);
@@ -213,7 +221,7 @@
 SB_EXPORT bool SbMemoryUnmap(void* virtual_address, int64_t size_bytes);
 
 #if SB_API_VERSION >= SB_MEMORY_PROTECT_API_VERSION
-// Change the protection of |size_bytes| of physical pages, starting from
+// Change the protection of |size_bytes| of memory regions, starting from
 // |virtual_address|, to |flags|, returning |true| on success.
 SB_EXPORT bool SbMemoryProtect(void* virtual_address,
                                int64_t size_bytes,
diff --git a/src/starboard/nplb/memory_map_test.cc b/src/starboard/nplb/memory_map_test.cc
index eb4c94f..07710b1 100644
--- a/src/starboard/nplb/memory_map_test.cc
+++ b/src/starboard/nplb/memory_map_test.cc
@@ -220,13 +220,13 @@
 #if SB_API_VERSION >= SB_MEMORY_PROTECT_API_VERSION
 TEST(SbMemoryMapTest, CanChangeMemoryProtection) {
   SbMemoryMapFlags all_from_flags[] = {
-    SbMemoryMapFlags(0),
+    SbMemoryMapFlags(kSbMemoryMapProtectReserved),
     SbMemoryMapFlags(kSbMemoryMapProtectRead),
     SbMemoryMapFlags(kSbMemoryMapProtectWrite),
     SbMemoryMapFlags(kSbMemoryMapProtectRead | kSbMemoryMapProtectWrite),
   };
   SbMemoryMapFlags all_to_flags[] = {
-    SbMemoryMapFlags(0),
+    SbMemoryMapFlags(kSbMemoryMapProtectReserved),
     SbMemoryMapFlags(kSbMemoryMapProtectRead),
     SbMemoryMapFlags(kSbMemoryMapProtectWrite),
     SbMemoryMapFlags(kSbMemoryMapProtectRead | kSbMemoryMapProtectWrite),
diff --git a/src/starboard/shared/directfb/application_directfb.cc b/src/starboard/shared/directfb/application_directfb.cc
index 068bd25..def23d4 100644
--- a/src/starboard/shared/directfb/application_directfb.cc
+++ b/src/starboard/shared/directfb/application_directfb.cc
@@ -17,6 +17,19 @@
 #include <algorithm>
 #include <iomanip>
 
+#include <directfb/directfb_version.h>  // NOLINT(build/include_order)
+
+// Anything less than 1.7.x needs special behavior on teardown.
+// Issue confirmed on 1.7.7, and separate issue perhaps seen on 1.2.x
+#define NEEDS_DIRECTFB_TEARDOWN_WORKAROUND \
+    ((DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION <= 7))
+
+#if NEEDS_DIRECTFB_TEARDOWN_WORKAROUND
+#include <setjmp.h>
+#include <signal.h>
+#include <unistd.h>
+#endif
+
 #include "starboard/input.h"
 #include "starboard/key.h"
 #include "starboard/log.h"
@@ -407,9 +420,55 @@
   }
 }
 
+namespace {
+
+#if NEEDS_DIRECTFB_TEARDOWN_WORKAROUND
+jmp_buf signal_jmp_buffer;
+
+void on_segv(int sig /*, siginfo_t *info, void *ucontext*/) {
+  siglongjmp(signal_jmp_buffer, 1);
+}
+#endif  // NEEDS_DIRECTFB_TEARDOWN_WORKAROUND
+
+}  // namespace
+
 void ApplicationDirectFB::Teardown() {
   SB_DCHECK(!SbWindowIsValid(window_));
+
+  // DirectFB 1.7.7 has an uninitialized variable that causes
+  // crashes at teardown time.
+  // We swallow this crash here so that automated testing continues to
+  // work.
+  // See: http://lists.openembedded.org/pipermail/openembedded-core/2016-June/122843.html
+  // We've also seen teardown problems on 1.2.x.
+#if NEEDS_DIRECTFB_TEARDOWN_WORKAROUND
+  if (sigsetjmp(signal_jmp_buffer, 1)) {
+    SB_LOG(WARNING) << "DirectFB segv during teardown. Expect memory leaks.";
+    // Calling _exit here to skip atexit handlers because we've seen
+    // directfb 1.2.10 hang on shutdown after this during an atexit handler.
+    // Note we exit with success so unit tests pass.
+    _exit(0);
+  } else {
+    struct sigaction sigaction_config;
+    SbMemorySet(&sigaction_config, 0, sizeof(sigaction_config));
+
+    sigaction_config.sa_handler = on_segv;
+    sigemptyset(&sigaction_config.sa_mask);
+    sigaction_config.sa_flags = 0;
+
+    // Unblock SIGSEGV, which has been blocked earlier (perhaps by libdirectfb)
+    sigset_t set;
+    sigemptyset(&set);
+    sigaddset(&set, SIGSEGV);
+    sigprocmask(SIG_UNBLOCK, &set, nullptr);
+
+    int err = sigaction(SIGSEGV, &sigaction_config, nullptr);
+
+    directfb_->Release(directfb_);
+  }
+#else  // NEEDS_DIRECTFB_TEARDOWN_WORKAROUND
   directfb_->Release(directfb_);
+#endif  // NEEDS_DIRECTFB_TEARDOWN_WORKAROUND
 }
 
 shared::starboard::Application::Event*
diff --git a/src/starboard/shared/linux/page_internal.cc b/src/starboard/shared/linux/page_internal.cc
index 1113da2..49ffffd 100644
--- a/src/starboard/shared/linux/page_internal.cc
+++ b/src/starboard/shared/linux/page_internal.cc
@@ -36,6 +36,11 @@
 int SbMemoryMapFlagsToMmapProtect(int sb_flags) {
   bool flag_set = false;
   int mmap_protect = 0;
+#if SB_API_VERSION >= SB_MEMORY_PROTECT_RESERVED_FLAG_API_VERSION
+  if (sb_flags == kSbMemoryMapProtectReserved) {
+    return PROT_NONE;
+  }
+#endif
   if (sb_flags & kSbMemoryMapProtectRead) {
     mmap_protect |= PROT_READ;
     flag_set = true;
diff --git a/src/starboard/shared/starboard/net_log.cc b/src/starboard/shared/starboard/net_log.cc
index 715263d..4c9bc7f 100644
--- a/src/starboard/shared/starboard/net_log.cc
+++ b/src/starboard/shared/starboard/net_log.cc
@@ -364,12 +364,12 @@
   }
 
   void Close() {
+    socket_listener_.reset();
     if (writer_thread_) {
       writer_thread_->Join();
       writer_thread_.reset(nullptr);
       Flush();  // One last flush to the socket.
     }
-    socket_listener_.reset();
     ScopedLock lock(socket_mutex_);
     client_socket_.reset();
     listen_socket_.reset();
diff --git a/src/starboard/shared/starboard/player/filter/testing/player_filter_tests.gyp b/src/starboard/shared/starboard/player/filter/testing/player_filter_tests.gyp
index 0a5ba07..f773213 100644
--- a/src/starboard/shared/starboard/player/filter/testing/player_filter_tests.gyp
+++ b/src/starboard/shared/starboard/player/filter/testing/player_filter_tests.gyp
@@ -48,10 +48,11 @@
       'variables': {
         'content_test_input_files': ['<!@(python <(DEPTH)/starboard/build/list_dmp_files.py "starboard/shared/starboard/player/testdata")'],
         'content_test_output_subdir': 'starboard/shared/starboard/player/testdata',
-        'download_at_gyp_time': ['<!@(download_from_google_storage --no_resume --no_auth --num_threads 8 --bucket cobalt-static-storage -d <(DEPTH)/starboard/shared/starboard/player/testdata -v | grep "Success")'],
       },
       'actions' : [
         {
+          # This action requires depot_tools to be in path
+          # (https://cobalt.googlesource.com/depot_tools).
           'action_name': 'player_filter_tests_download_test_data',
           'action': [ 'download_from_google_storage',
                       '--no_resume',
diff --git a/src/third_party/blink/Source/bindings/scripts/idl_types.py b/src/third_party/blink/Source/bindings/scripts/idl_types.py
index c40150a..fa03d36 100644
--- a/src/third_party/blink/Source/bindings/scripts/idl_types.py
+++ b/src/third_party/blink/Source/bindings/scripts/idl_types.py
@@ -18,7 +18,6 @@
 
 from collections import defaultdict
 
-
 ################################################################################
 # IDL types
 ################################################################################
@@ -35,25 +34,50 @@
     'long long',
     'unsigned long long',
 ])
-NUMERIC_TYPES = (INTEGER_TYPES | frozenset([
-    # http://www.w3.org/TR/WebIDL/#dfn-numeric-type
-    'float',
-    'unrestricted float',
-    'double',
-    'unrestricted double',
-]))
+NUMERIC_TYPES = (
+    INTEGER_TYPES | frozenset([
+        # http://www.w3.org/TR/WebIDL/#dfn-numeric-type
+        'float',
+        'unrestricted float',
+        'double',
+        'unrestricted double',
+    ]))
 # http://www.w3.org/TR/WebIDL/#dfn-primitive-type
 PRIMITIVE_TYPES = (frozenset(['boolean']) | NUMERIC_TYPES)
-BASIC_TYPES = (PRIMITIVE_TYPES | frozenset([
-    # Built-in, non-composite, non-object data types
-    # http://heycam.github.io/webidl/#idl-types
-    'DOMString',
-    'ByteString',
-    'USVString',
-    'Date',
-    # http://heycam.github.io/webidl/#idl-types
-    'void',
-]))
+# ArrayBufer, its views, and TypedArrays, which use the JavaScript engine's
+# implementation.
+ARRAY_BUFFER_TYPES = frozenset([
+    'ArrayBuffer',
+])
+ARRAY_BUFFER_VIEW_TYPES = frozenset(['ArrayBufferView'])
+DATA_VIEW_TYPES = frozenset([
+    'DataView',
+])
+TYPED_ARRAY_TYPES = frozenset([
+    'ArrayBufferView',
+    'Int8Array',
+    'Uint8Array',
+    'Uint8ClampedArray',
+    'Int16Array',
+    'Uint16Array',
+    'Int32Array',
+    'Uint32Array',
+    'Float32Array',
+    'Float64Array',
+])
+ARRAY_BUFFER_AND_VIEWS_TYPES = (
+    ARRAY_BUFFER_TYPES | DATA_VIEW_TYPES | TYPED_ARRAY_TYPES)
+BASIC_TYPES = (
+    PRIMITIVE_TYPES | ARRAY_BUFFER_AND_VIEWS_TYPES | frozenset([
+        # Built-in, non-composite, non-object data types
+        # http://heycam.github.io/webidl/#idl-types
+        'DOMString',
+        'ByteString',
+        'USVString',
+        'Date',
+        # http://heycam.github.io/webidl/#idl-types
+        'void',
+    ]))
 TYPE_NAMES = {
     # http://heycam.github.io/webidl/#dfn-type-name
     'any': 'Any',
@@ -75,6 +99,18 @@
     'USVString': 'USVString',
     'object': 'Object',
     'Date': 'Date',
+    'ArrayBuffer': 'ArrayBuffer',
+    'ArrayBufferView': 'ArrayBufferView',
+    'DataView': 'DataView',
+    'Int8Array': 'Int8Array',
+    'Uint8Array': 'Uint8Array',
+    'Uint8ClampedArray': 'Uint8ClampedArray',
+    'Int16Array': 'Int16Array',
+    'Uint16Array': 'Uint16Array',
+    'Int32Array': 'Int32Array',
+    'Uint32Array': 'Uint32Array',
+    'Float32Array': 'Float32Array',
+    'Float64Array': 'Float64Array',
 }
 
 STRING_TYPES = frozenset([
@@ -92,493 +128,520 @@
     'VoidFunction',
 ])
 
-
 ################################################################################
 # Inheritance
 ################################################################################
 
 ancestors = defaultdict(list)  # interface_name -> ancestors
 
+
 def inherits_interface(interface_name, ancestor_name):
-    return (interface_name == ancestor_name or
-            ancestor_name in ancestors[interface_name])
+  return (interface_name == ancestor_name or
+          ancestor_name in ancestors[interface_name])
 
 
 def set_ancestors(new_ancestors):
-    ancestors.update(new_ancestors)
+  ancestors.update(new_ancestors)
 
 
 class IdlTypeBase(object):
-    """Base class for IdlType, IdlUnionType, IdlArrayOrSequenceType and IdlNullableType."""
+  """Base class for IdlType, IdlUnionType, IdlArrayOrSequenceType and IdlNullableType."""
 
-    def __str__(self):
-        raise NotImplementedError(
-            '__str__() should be defined in subclasses')
+  def __str__(self):
+    raise NotImplementedError('__str__() should be defined in subclasses')
 
-    def __getattr__(self, name):
-        # Default undefined attributes to None (analogous to Jinja variables).
-        # This allows us to not define default properties in the base class, and
-        # allows us to relay __getattr__ in IdlNullableType to the inner type.
-        return None
+  def __getattr__(self, name):
+    # Default undefined attributes to None (analogous to Jinja variables).
+    # This allows us to not define default properties in the base class, and
+    # allows us to relay __getattr__ in IdlNullableType to the inner type.
+    return None
 
-    def resolve_typedefs(self, typedefs):
-        raise NotImplementedError(
-            'resolve_typedefs should be defined in subclasses')
+  def resolve_typedefs(self, typedefs):
+    raise NotImplementedError(
+        'resolve_typedefs should be defined in subclasses')
 
-    def idl_types(self):
-        """A generator which yields IdlTypes which are referenced from |self|,
+  def idl_types(self):
+    """A generator which yields IdlTypes which are referenced from |self|,
         including itself."""
-        yield self
+    yield self
 
 
 ################################################################################
 # IdlType
 ################################################################################
 
+
 class IdlType(IdlTypeBase):
-    # FIXME: incorporate Nullable, etc.
-    # to support types like short?[] vs. short[]?, instead of treating these
-    # as orthogonal properties (via flags).
-    callback_functions = {}
-    callback_interfaces = set()
-    dictionaries = set()
-    enums = {}  # name -> values
+  # FIXME: incorporate Nullable, etc.
+  # to support types like short?[] vs. short[]?, instead of treating these
+  # as orthogonal properties (via flags).
+  callback_functions = {}
+  callback_interfaces = set()
+  dictionaries = set()
+  enums = {}  # name -> values
 
-    def __init__(self, base_type, is_unrestricted=False):
-        super(IdlType, self).__init__()
-        if is_unrestricted:
-            self.base_type = 'unrestricted %s' % base_type
-        else:
-            self.base_type = base_type
+  def __init__(self, base_type, is_unrestricted=False):
+    super(IdlType, self).__init__()
+    if is_unrestricted:
+      self.base_type = 'unrestricted %s' % base_type
+    else:
+      self.base_type = base_type
 
-    def __str__(self):
-        return self.base_type
+  def __str__(self):
+    return self.base_type
 
-    def __getstate__(self):
-        return {
-            'base_type': self.base_type,
-        }
+  def __getstate__(self):
+    return {
+        'base_type': self.base_type,
+    }
 
-    def __setstate__(self, state):
-        self.base_type = state['base_type']
+  def __setstate__(self, state):
+    self.base_type = state['base_type']
 
-    @property
-    def is_basic_type(self):
-        return self.base_type in BASIC_TYPES
+  @property
+  def is_basic_type(self):
+    return self.base_type in BASIC_TYPES
 
-    @property
-    def is_callback_function(self):  # pylint: disable=C0103
-        return self.base_type in IdlType.callback_functions or self.base_type in STANDARD_CALLBACK_FUNCTIONS
+  @property
+  def is_callback_function(self):  # pylint: disable=C0103
+    return self.base_type in IdlType.callback_functions or self.base_type in STANDARD_CALLBACK_FUNCTIONS
 
-    @property
-    def is_custom_callback_function(self):
-        # Treat standard callback functions as custom as they aren't generated.
-        if self.base_type in STANDARD_CALLBACK_FUNCTIONS:
-            return True
-        entry = IdlType.callback_functions.get(self.base_type)
-        callback_function = entry.get('callback_function')
-        if not callback_function:
-            return False
-        return 'Custom' in callback_function.extended_attributes
+  @property
+  def is_custom_callback_function(self):
+    # Treat standard callback functions as custom as they aren't generated.
+    if self.base_type in STANDARD_CALLBACK_FUNCTIONS:
+      return True
+    entry = IdlType.callback_functions.get(self.base_type)
+    callback_function = entry.get('callback_function')
+    if not callback_function:
+      return False
+    return 'Custom' in callback_function.extended_attributes
 
-    @property
-    def is_callback_interface(self):
-        return self.base_type in IdlType.callback_interfaces
+  @property
+  def is_callback_interface(self):
+    return self.base_type in IdlType.callback_interfaces
 
-    @property
-    def is_dictionary(self):
-        return self.base_type in IdlType.dictionaries
+  @property
+  def is_dictionary(self):
+    return self.base_type in IdlType.dictionaries
 
-    @property
-    def is_enum(self):
-        # FIXME: add an IdlEnumType class and a resolve_enums step at end of
-        # IdlDefinitions constructor
-        return self.name in IdlType.enums
+  @property
+  def is_enum(self):
+    # FIXME: add an IdlEnumType class and a resolve_enums step at end of
+    # IdlDefinitions constructor
+    return self.name in IdlType.enums
 
-    @property
-    def enum_values(self):
-        return IdlType.enums.get(self.name)
+  @property
+  def enum_values(self):
+    return IdlType.enums.get(self.name)
 
-    @property
-    def enum_type(self):
-        return self.name if self.is_enum else None
+  @property
+  def enum_type(self):
+    return self.name if self.is_enum else None
 
-    @property
-    def is_integer_type(self):
-        return self.base_type in INTEGER_TYPES
+  @property
+  def is_integer_type(self):
+    return self.base_type in INTEGER_TYPES
 
-    @property
-    def is_void(self):
-        return self.base_type == 'void'
+  @property
+  def is_void(self):
+    return self.base_type == 'void'
 
-    @property
-    def is_numeric_type(self):
-        return self.base_type in NUMERIC_TYPES
+  @property
+  def is_numeric_type(self):
+    return self.base_type in NUMERIC_TYPES
 
-    @property
-    def is_primitive_type(self):
-        return self.base_type in PRIMITIVE_TYPES
+  @property
+  def is_primitive_type(self):
+    return self.base_type in PRIMITIVE_TYPES
 
-    @property
-    def is_interface_type(self):
-        # Anything that is not another type is an interface type.
-        # http://www.w3.org/TR/WebIDL/#idl-types
-        # http://www.w3.org/TR/WebIDL/#idl-interface
-        # In C++ these are RefPtr or PassRefPtr types.
-        return not(self.is_basic_type or
-                   self.is_callback_function or
-                   self.is_dictionary or
-                   self.is_enum or
-                   self.name == 'Any' or
-                   self.name == 'Object')
+  @property
+  def is_interface_type(self):
+    # Anything that is not another type is an interface type.
+    # http://www.w3.org/TR/WebIDL/#idl-types
+    # http://www.w3.org/TR/WebIDL/#idl-interface
+    # In C++ these are RefPtr or PassRefPtr types.
+    return not (self.is_basic_type or self.is_callback_function or
+                self.is_dictionary or self.is_enum or self.name == 'Any' or
+                self.name == 'Object')
 
-    @property
-    def is_string_type(self):
-        return self.name in STRING_TYPES
+  @property
+  def is_string_type(self):
+    return self.name in STRING_TYPES
 
-    @property
-    def name(self):
-        """Return type name
+  @property
+  def is_array_buffer(self):
+    return self.base_type in ARRAY_BUFFER_TYPES
+
+  @property
+  def is_array_buffer_view(self):
+    return self.base_type in ARRAY_BUFFER_VIEW_TYPES
+
+  @property
+  def is_data_view(self):
+    return self.base_type in DATA_VIEW_TYPES
+
+  @property
+  def is_typed_array(self):
+    return self.base_type in TYPED_ARRAY_TYPES
+
+  @property
+  def is_array_buffer_or_view_type(self):
+    return self.base_type in ARRAY_BUFFER_AND_VIEWS_TYPES
+
+  @property
+  def name(self):
+    """Return type name
 
         http://heycam.github.io/webidl/#dfn-type-name
         """
-        base_type = self.base_type
-        return TYPE_NAMES.get(base_type, base_type)
+    base_type = self.base_type
+    return TYPE_NAMES.get(base_type, base_type)
 
-    @classmethod
-    def set_callback_functions(cls, new_callback_functions):
-        cls.callback_functions.update(new_callback_functions)
+  @classmethod
+  def set_callback_functions(cls, new_callback_functions):
+    cls.callback_functions.update(new_callback_functions)
 
-    @classmethod
-    def set_callback_interfaces(cls, new_callback_interfaces):
-        cls.callback_interfaces.update(new_callback_interfaces)
+  @classmethod
+  def set_callback_interfaces(cls, new_callback_interfaces):
+    cls.callback_interfaces.update(new_callback_interfaces)
 
-    @classmethod
-    def set_dictionaries(cls, new_dictionaries):
-        cls.dictionaries.update(new_dictionaries)
+  @classmethod
+  def set_dictionaries(cls, new_dictionaries):
+    cls.dictionaries.update(new_dictionaries)
 
-    @classmethod
-    def set_enums(cls, new_enums):
-        cls.enums.update(new_enums)
+  @classmethod
+  def set_enums(cls, new_enums):
+    cls.enums.update(new_enums)
 
-    def resolve_typedefs(self, typedefs):
-        # This function either returns |self| or a different object.
-        # FIXME: Rename typedefs_resolved().
-        return typedefs.get(self.base_type, self)
+  def resolve_typedefs(self, typedefs):
+    # This function either returns |self| or a different object.
+    # FIXME: Rename typedefs_resolved().
+    return typedefs.get(self.base_type, self)
 
 
 ################################################################################
 # IdlUnionType
 ################################################################################
 
+
 class IdlUnionType(IdlTypeBase):
-    # http://heycam.github.io/webidl/#idl-union
-    # IdlUnionType has __hash__() and __eq__() methods because they are stored
-    # in sets.
-    def __init__(self, member_types):
-        super(IdlUnionType, self).__init__()
-        self.member_types = member_types
+  # http://heycam.github.io/webidl/#idl-union
+  # IdlUnionType has __hash__() and __eq__() methods because they are stored
+  # in sets.
+  def __init__(self, member_types):
+    super(IdlUnionType, self).__init__()
+    self.member_types = member_types
 
-    def __str__(self):
-        return '(' + ' or '.join(str(member_type) for member_type in self.member_types) + ')'
+  def __str__(self):
+    return '(' + ' or '.join(
+        str(member_type) for member_type in self.member_types) + ')'
 
-    def __hash__(self):
-        return hash(self.name)
+  def __hash__(self):
+    return hash(self.name)
 
-    def __eq__(self, rhs):
-        return self.name == rhs.name
+  def __eq__(self, rhs):
+    return self.name == rhs.name
 
-    def __getstate__(self):
-        return {
-            'member_types': self.member_types,
-        }
+  def __getstate__(self):
+    return {
+        'member_types': self.member_types,
+    }
 
-    def __setstate__(self, state):
-        self.member_types = state['member_types']
+  def __setstate__(self, state):
+    self.member_types = state['member_types']
 
-    @property
-    def flattened_member_types(self):
-        """Returns the set of the union's flattened member types.
+  @property
+  def flattened_member_types(self):
+    """Returns the set of the union's flattened member types.
 
         https://heycam.github.io/webidl/#dfn-flattened-union-member-types
         """
-        # We cannot use a set directly because each member is an IdlTypeBase-derived class, and
-        # comparing two objects of the same type is not the same as comparing their names. In
-        # other words:
-        #   x = IdlType('ByteString')
-        #   y = IdlType('ByteString')
-        #   x == y  # False
-        #   x.name == y.name  # True
-        # |flattened_members|'s keys are type names, the values are type |objects.
-        # We assume we can use two IDL objects of the same type interchangeably.
-        flattened_members = {}
-        for member in self.member_types:
-            if member.is_nullable:
-                member = member.inner_type
-            if member.is_union_type:
-                for inner_member in member.flattened_member_types:
-                    flattened_members[inner_member.name] = inner_member
-            else:
-                flattened_members[member.name] = member
-        return set(flattened_members.values())
+    # We cannot use a set directly because each member is an IdlTypeBase-derived class, and
+    # comparing two objects of the same type is not the same as comparing their names. In
+    # other words:
+    #   x = IdlType('ByteString')
+    #   y = IdlType('ByteString')
+    #   x == y  # False
+    #   x.name == y.name  # True
+    # |flattened_members|'s keys are type names, the values are type |objects.
+    # We assume we can use two IDL objects of the same type interchangeably.
+    flattened_members = {}
+    for member in self.member_types:
+      if member.is_nullable:
+        member = member.inner_type
+      if member.is_union_type:
+        for inner_member in member.flattened_member_types:
+          flattened_members[inner_member.name] = inner_member
+      else:
+        flattened_members[member.name] = member
+    return set(flattened_members.values())
 
-    @property
-    def number_of_nullable_member_types(self):
-        """Returns the union's number of nullable types.
+  @property
+  def number_of_nullable_member_types(self):
+    """Returns the union's number of nullable types.
 
         http://heycam.github.io/webidl/#dfn-number-of-nullable-member-types
         """
-        count = 0
-        for member in self.member_types:
-            if member.is_nullable:
-                count += 1
-                member = member.inner_type
-            if member.is_union_type:
-                count += member.number_of_nullable_member_types
-        return count
+    count = 0
+    for member in self.member_types:
+      if member.is_nullable:
+        count += 1
+        member = member.inner_type
+      if member.is_union_type:
+        count += member.number_of_nullable_member_types
+    return count
 
-    @property
-    def is_union_type(self):
-        return True
+  @property
+  def is_union_type(self):
+    return True
 
-    def single_matching_member_type(self, predicate):
-        matching_types = filter(predicate, self.flattened_member_types)
-        if len(matching_types) > 1:
-            raise "%s is ambigious." % self.name
-        return matching_types[0] if matching_types else None
+  def single_matching_member_type(self, predicate):
+    matching_types = filter(predicate, self.flattened_member_types)
+    if len(matching_types) > 1:
+      raise '%s is ambigious.' % self.name
+    return matching_types[0] if matching_types else None
 
-    @property
-    def string_member_type(self):
-        return self.single_matching_member_type(
-            lambda member_type: (member_type.is_string_type or
-                                 member_type.is_enum))
+  @property
+  def string_member_type(self):
+    return self.single_matching_member_type(
+        lambda member_type: (member_type.is_string_type or member_type.is_enum))
 
-    @property
-    def numeric_member_type(self):
-        return self.single_matching_member_type(
-            lambda member_type: member_type.is_numeric_type)
+  @property
+  def numeric_member_type(self):
+    return self.single_matching_member_type(
+        lambda member_type: member_type.is_numeric_type)
 
-    @property
-    def boolean_member_type(self):
-        return self.single_matching_member_type(
-            lambda member_type: member_type.base_type == 'boolean')
+  @property
+  def boolean_member_type(self):
+    return self.single_matching_member_type(
+        lambda member_type: member_type.base_type == 'boolean')
 
-    @property
-    def as_union_type(self):
-        # Note: Use this to "look through" a possible IdlNullableType wrapper.
-        return self
+  @property
+  def as_union_type(self):
+    # Note: Use this to "look through" a possible IdlNullableType wrapper.
+    return self
 
-    @property
-    def name(self):
-        """Return type name (or inner type name if nullable)
+  @property
+  def name(self):
+    """Return type name (or inner type name if nullable)
 
         http://heycam.github.io/webidl/#dfn-type-name
         """
-        return 'Or'.join(member_type.name for member_type in self.member_types)
+    return 'Or'.join(member_type.name for member_type in self.member_types)
 
-    def resolve_typedefs(self, typedefs):
-        self.member_types = [
-            typedefs.get(member_type, member_type)
-            for member_type in self.member_types]
-        return self
+  def resolve_typedefs(self, typedefs):
+    self.member_types = [
+        typedefs.get(member_type, member_type)
+        for member_type in self.member_types
+    ]
+    return self
 
-    def idl_types(self):
-        yield self
-        for member_type in self.member_types:
-            for idl_type in member_type.idl_types():
-                yield idl_type
+  def idl_types(self):
+    yield self
+    for member_type in self.member_types:
+      for idl_type in member_type.idl_types():
+        yield idl_type
 
 
 ################################################################################
 # IdlArrayOrSequenceType, IdlArrayType, IdlSequenceType, IdlFrozenArrayType
 ################################################################################
 
+
 # TODO(bashi): Rename this like "IdlArrayTypeBase" or something.
 class IdlArrayOrSequenceType(IdlTypeBase):
-    """Base class for array-like types."""
+  """Base class for array-like types."""
 
-    def __init__(self, element_type):
-        super(IdlArrayOrSequenceType, self).__init__()
-        self.element_type = element_type
+  def __init__(self, element_type):
+    super(IdlArrayOrSequenceType, self).__init__()
+    self.element_type = element_type
 
-    def __getstate__(self):
-        return {
-            'element_type': self.element_type,
-        }
+  def __getstate__(self):
+    return {
+        'element_type': self.element_type,
+    }
 
-    def __setstate__(self, state):
-        self.element_type = state['element_type']
+  def __setstate__(self, state):
+    self.element_type = state['element_type']
 
-    def resolve_typedefs(self, typedefs):
-        self.element_type = self.element_type.resolve_typedefs(typedefs)
-        return self
+  def resolve_typedefs(self, typedefs):
+    self.element_type = self.element_type.resolve_typedefs(typedefs)
+    return self
 
-    @property
-    def is_array_or_sequence_type(self):
-        return True
+  @property
+  def is_array_or_sequence_type(self):
+    return True
 
-    @property
-    def is_array_type(self):
-        return False
+  @property
+  def is_array_type(self):
+    return False
 
-    @property
-    def is_sequence_type(self):
-        return False
+  @property
+  def is_sequence_type(self):
+    return False
 
-    @property
-    def is_frozen_array(self):
-        return False
+  @property
+  def is_frozen_array(self):
+    return False
 
-    @property
-    def enum_values(self):
-        return self.element_type.enum_values
+  @property
+  def enum_values(self):
+    return self.element_type.enum_values
 
-    @property
-    def enum_type(self):
-        return self.element_type.enum_type
+  @property
+  def enum_type(self):
+    return self.element_type.enum_type
 
-    def idl_types(self):
-        yield self
-        for idl_type in self.element_type.idl_types():
-            yield idl_type
+  def idl_types(self):
+    yield self
+    for idl_type in self.element_type.idl_types():
+      yield idl_type
 
 
 class IdlArrayType(IdlArrayOrSequenceType):
-    def __init__(self, element_type):
-        super(IdlArrayType, self).__init__(element_type)
 
-    def __str__(self):
-        return '%s[]' % self.element_type
+  def __init__(self, element_type):
+    super(IdlArrayType, self).__init__(element_type)
 
-    @property
-    def name(self):
-        return self.element_type.name + 'Array'
+  def __str__(self):
+    return '%s[]' % self.element_type
 
-    @property
-    def is_array_type(self):
-        return True
+  @property
+  def name(self):
+    return self.element_type.name + 'Array'
+
+  @property
+  def is_array_type(self):
+    return True
 
 
 class IdlSequenceType(IdlArrayOrSequenceType):
-    def __init__(self, element_type):
-        super(IdlSequenceType, self).__init__(element_type)
 
-    def __str__(self):
-        return 'sequence<%s>' % self.element_type
+  def __init__(self, element_type):
+    super(IdlSequenceType, self).__init__(element_type)
 
-    @property
-    def name(self):
-        return self.element_type.name + 'Sequence'
+  def __str__(self):
+    return 'sequence<%s>' % self.element_type
 
-    @property
-    def is_sequence_type(self):
-        return True
+  @property
+  def name(self):
+    return self.element_type.name + 'Sequence'
+
+  @property
+  def is_sequence_type(self):
+    return True
 
 
 class IdlFrozenArrayType(IdlArrayOrSequenceType):
-    def __init__(self, element_type):
-        super(IdlFrozenArrayType, self).__init__(element_type)
 
-    def __str__(self):
-        return 'FrozenArray<%s>' % self.element_type
+  def __init__(self, element_type):
+    super(IdlFrozenArrayType, self).__init__(element_type)
 
-    @property
-    def name(self):
-        return self.element_type.name + 'Array'
+  def __str__(self):
+    return 'FrozenArray<%s>' % self.element_type
 
-    @property
-    def is_frozen_array(self):
-        return True
+  @property
+  def name(self):
+    return self.element_type.name + 'Array'
+
+  @property
+  def is_frozen_array(self):
+    return True
 
 
 ################################################################################
 # IdlRecordType
 ################################################################################
 
+
 class IdlRecordType(IdlTypeBase):
-    def __init__(self, key_type, value_type):
-        super(IdlRecordType, self).__init__()
-        self.key_type = key_type
-        self.value_type = value_type
 
-    def __str__(self):
-        return 'record<%s, %s>' % (self.key_type, self.value_type)
+  def __init__(self, key_type, value_type):
+    super(IdlRecordType, self).__init__()
+    self.key_type = key_type
+    self.value_type = value_type
 
-    def __getstate__(self):
-        return {
-            'key_type': self.key_type,
-            'value_type': self.value_type,
-        }
+  def __str__(self):
+    return 'record<%s, %s>' % (self.key_type, self.value_type)
 
-    def __setstate__(self, state):
-        self.key_type = state['key_type']
-        self.value_type = state['value_type']
+  def __getstate__(self):
+    return {
+        'key_type': self.key_type,
+        'value_type': self.value_type,
+    }
 
-    def idl_types(self):
-        yield self
-        for idl_type in self.key_type.idl_types():
-            yield idl_type
-        for idl_type in self.value_type.idl_types():
-            yield idl_type
+  def __setstate__(self, state):
+    self.key_type = state['key_type']
+    self.value_type = state['value_type']
 
-    def resolve_typedefs(self, typedefs):
-        self.key_type = self.key_type.resolve_typedefs(typedefs)
-        self.value_type = self.value_type.resolve_typedefs(typedefs)
-        return self
+  def idl_types(self):
+    yield self
+    for idl_type in self.key_type.idl_types():
+      yield idl_type
+    for idl_type in self.value_type.idl_types():
+      yield idl_type
 
-    @property
-    def is_record_type(self):
-        return True
+  def resolve_typedefs(self, typedefs):
+    self.key_type = self.key_type.resolve_typedefs(typedefs)
+    self.value_type = self.value_type.resolve_typedefs(typedefs)
+    return self
 
-    @property
-    def name(self):
-        return self.key_type.name + self.value_type.name + 'Record'
+  @property
+  def is_record_type(self):
+    return True
+
+  @property
+  def name(self):
+    return self.key_type.name + self.value_type.name + 'Record'
 
 
 ################################################################################
 # IdlNullableType
 ################################################################################
 
+
 class IdlNullableType(IdlTypeBase):
-    def __init__(self, inner_type):
-        super(IdlNullableType, self).__init__()
-        self.inner_type = inner_type
 
-    def __str__(self):
-        # FIXME: Dictionary::ConversionContext::setConversionType can't
-        # handle the '?' in nullable types (passes nullability separately).
-        # Update that function to handle nullability from the type name,
-        # simplifying its signature.
-        # return str(self.inner_type) + '?'
-        return str(self.inner_type)
+  def __init__(self, inner_type):
+    super(IdlNullableType, self).__init__()
+    self.inner_type = inner_type
 
-    def __getattr__(self, name):
-        return getattr(self.inner_type, name)
+  def __str__(self):
+    # FIXME: Dictionary::ConversionContext::setConversionType can't
+    # handle the '?' in nullable types (passes nullability separately).
+    # Update that function to handle nullability from the type name,
+    # simplifying its signature.
+    # return str(self.inner_type) + '?'
+    return str(self.inner_type)
 
-    def __getstate__(self):
-        return {
-            'inner_type': self.inner_type,
-        }
+  def __getattr__(self, name):
+    return getattr(self.inner_type, name)
 
-    def __setstate__(self, state):
-        self.inner_type = state['inner_type']
+  def __getstate__(self):
+    return {
+        'inner_type': self.inner_type,
+    }
 
-    @property
-    def is_nullable(self):
-        return True
+  def __setstate__(self, state):
+    self.inner_type = state['inner_type']
 
-    @property
-    def name(self):
-        return self.inner_type.name + 'OrNull'
+  @property
+  def is_nullable(self):
+    return True
 
-    def resolve_typedefs(self, typedefs):
-        self.inner_type = self.inner_type.resolve_typedefs(typedefs)
-        return self
+  @property
+  def name(self):
+    return self.inner_type.name + 'OrNull'
 
-    def idl_types(self):
-        yield self
-        for idl_type in self.inner_type.idl_types():
-            yield idl_type
+  def resolve_typedefs(self, typedefs):
+    self.inner_type = self.inner_type.resolve_typedefs(typedefs)
+    return self
+
+  def idl_types(self):
+    yield self
+    for idl_type in self.inner_type.idl_types():
+      yield idl_type
 
 
 ################################################################################
@@ -586,26 +649,26 @@
 # Note: Added to Cobalt
 ################################################################################
 class IdlPromiseType(IdlTypeBase):
-    def __init__(self, result_type):
-        super(IdlPromiseType, self).__init__()
-        self.result_type = result_type
 
-    def __str__(self):
-        return 'Promise<%s>' % self.result_type
+  def __init__(self, result_type):
+    super(IdlPromiseType, self).__init__()
+    self.result_type = result_type
 
-    def __getstate__(self):
-        return {
-            'result_type': self.result_type,
-        }
+  def __str__(self):
+    return 'Promise<%s>' % self.result_type
 
-    def __setstate__(self, state):
-        self.result_type = state['result_type']
+  def __getstate__(self):
+    return {
+        'result_type': self.result_type,
+    }
 
-    @property
-    def name(self):
-        return self.result_type.name + 'Promise'
+  def __setstate__(self, state):
+    self.result_type = state['result_type']
 
-    def resolve_typedefs(self, typedefs):
-        self.result_type = self.result_type.resolve_typedefs(typedefs)
-        return self
+  @property
+  def name(self):
+    return self.result_type.name + 'Promise'
 
+  def resolve_typedefs(self, typedefs):
+    self.result_type = self.result_type.resolve_typedefs(typedefs)
+    return self
diff --git a/src/third_party/libvpx/ads2gas.gypi b/src/third_party/libvpx/ads2gas.gypi
new file mode 100644
index 0000000..3a96faa
--- /dev/null
+++ b/src/third_party/libvpx/ads2gas.gypi
@@ -0,0 +1,54 @@
+# Copyright (c) 2015 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.
+
+# This file is meant to be included into a target to provide a rule
+# for translating .asm files to .S files using ads2gas.
+#
+# To use this, create a gyp target with the following form:
+# {
+#   'target_name': 'my_lib',
+#   'sources': [
+#     'foo.asm',
+#     'bar.c',
+#   ],
+#   'includes': [ 'ads2gas.gypi' ],
+# }
+{
+  'variables': {
+    # Location of the intermediate output.
+    'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/libvpx',
+    'variables': {
+      'libvpx_source%': '<(DEPTH)/third_party/libvpx',
+      'conditions': [
+        ['OS=="ios"', {
+          'ads2gas_script%': 'ads2gas_apple.pl',
+        }, {
+          'ads2gas_script%': 'ads2gas.pl',
+        }],
+      ],
+    },
+    'ads2gas_script%': '<(ads2gas_script)',
+    'ads2gas_script_dir': '<(libvpx_source)/build/make',
+  },
+  'rules': [
+    {
+      'rule_name': 'convert_asm',
+      'extension': 'asm',
+      'inputs': [
+        '<(ads2gas_script_dir)/<(ads2gas_script)',
+        '<(ads2gas_script_dir)/thumb.pm',
+      ],
+      'outputs': [
+        '<(shared_generated_dir)/<(RULE_INPUT_ROOT).asm.S',
+      ],
+      'action': [
+        'bash',
+        '-c',
+        'cat <(RULE_INPUT_PATH) | perl <(ads2gas_script_dir)/<(ads2gas_script) -chromium > <(shared_generated_dir)/<(RULE_INPUT_ROOT).asm.S',
+      ],
+      'process_outputs_as_sources': 1,
+      'message': 'Convert libvpx asm file for ARM <(RULE_INPUT_PATH)',
+    },
+  ],
+}
diff --git a/src/third_party/libvpx/libvpx.gyp b/src/third_party/libvpx/libvpx.gyp
index 0d8dce3..be65e30 100644
--- a/src/third_party/libvpx/libvpx.gyp
+++ b/src/third_party/libvpx/libvpx.gyp
@@ -6,9 +6,81 @@
     {
       'target_name': 'libvpx',
       'type': 'static_library',
+      'conditions': [
+        ['target_arch == "arm" and arm_neon == 1', {
+          'include_dirs': [
+            '<(libvpx_source)/platforms/arm',
+          ],
+          'includes': [ 'ads2gas.gypi', ],
+          'sources': [
+            'platforms/arm/vp9_rtcd.h',
+            'platforms/arm/vpx_config.c',
+            'platforms/arm/vpx_config.h',
+            'platforms/arm/vpx_dsp_rtcd.h',
+            'platforms/arm/vpx_scale_rtcd.h',
+            'platforms/arm/vpx_version.h',
+            'vp9/common/arm/neon/vp9_iht4x4_add_neon.c',
+            'vp9/common/arm/neon/vp9_iht8x8_add_neon.c',
+            'vpx_dsp/arm/idct16x16_1_add_neon.asm',
+            'vpx_dsp/arm/idct16x16_1_add_neon.c',
+            'vpx_dsp/arm/idct16x16_add_neon.asm',
+            'vpx_dsp/arm/idct16x16_add_neon.c',
+            'vpx_dsp/arm/idct16x16_neon.c',
+            'vpx_dsp/arm/idct32x32_1_add_neon.asm',
+            'vpx_dsp/arm/idct32x32_1_add_neon.c',
+            'vpx_dsp/arm/idct32x32_add_neon.asm',
+            'vpx_dsp/arm/idct32x32_add_neon.c',
+            'vpx_dsp/arm/idct4x4_1_add_neon.asm',
+            'vpx_dsp/arm/idct4x4_1_add_neon.c',
+            'vpx_dsp/arm/idct4x4_add_neon.asm',
+            'vpx_dsp/arm/idct4x4_add_neon.c',
+            'vpx_dsp/arm/idct8x8_1_add_neon.asm',
+            'vpx_dsp/arm/idct8x8_1_add_neon.c',
+            'vpx_dsp/arm/idct8x8_add_neon.asm',
+            'vpx_dsp/arm/idct8x8_add_neon.c',
+            'vpx_dsp/arm/intrapred_neon.c',
+            'vpx_dsp/arm/intrapred_neon_asm.asm',
+            'vpx_dsp/arm/loopfilter_16_neon.asm',
+            'vpx_dsp/arm/loopfilter_16_neon.c',
+            'vpx_dsp/arm/loopfilter_4_neon.asm',
+            'vpx_dsp/arm/loopfilter_4_neon.c',
+            'vpx_dsp/arm/loopfilter_8_neon.asm',
+            'vpx_dsp/arm/loopfilter_8_neon.c',
+            'vpx_dsp/arm/loopfilter_mb_neon.asm',
+            'vpx_dsp/arm/loopfilter_neon.c',
+            'vpx_dsp/arm/save_reg_neon.asm',
+            'vpx_dsp/arm/vpx_convolve8_neon.c',
+            'vpx_dsp/arm/vpx_convolve_avg_neon.c',
+            'vpx_dsp/arm/vpx_convolve8_avg_neon.c',
+            'vpx_dsp/arm/vpx_convolve_copy_neon.c',
+            'vpx_dsp/arm/vpx_convolve_neon.c',
+            'vpx_ports/arm_cpudetect.c',
+          ],
+        }, {
+          'include_dirs': [
+            '<(libvpx_source)/platforms/linux-x64',
+          ],
+          'sources': [
+            'platforms/linux-x64/vp9_rtcd.h',
+            'platforms/linux-x64/vpx_config.c',
+            'platforms/linux-x64/vpx_config.h',
+            'platforms/linux-x64/vpx_dsp_rtcd.h',
+            'platforms/linux-x64/vpx_scale_rtcd.h',
+            'platforms/linux-x64/vpx_version.h',
+            'vp9/common/x86/vp9_idct_intrin_sse2.c',
+            'vpx_dsp/x86/convolve.h',
+            'vpx_dsp/x86/loopfilter_sse2.c',
+            'vpx_dsp/x86/vpx_asm_stubs.c',
+            'vpx_dsp/variance.c',
+            'vpx_dsp/variance.h',
+            'vpx_ports/emms.asm',
+            'vpx_ports/x86.h',
+            'vpx_ports/x86_abi_support.asm',
+          ],
+        },],
+      ],
       'include_dirs': [
         '<(libvpx_source)',
-        '<(libvpx_source)/platforms/linux-x64',
         '<(libvpx_source)/vpx_mem/memory_manager/include/',
       ],
       # Always optimize libvpx at O3.
@@ -19,12 +91,6 @@
       # This list was generated by running configure and then
       # make libvpx_srcs.txt
       'sources': [
-        'platforms/linux-x64/vp9_rtcd.h',
-        'platforms/linux-x64/vpx_config.c',
-        'platforms/linux-x64/vpx_config.h',
-        'platforms/linux-x64/vpx_dsp_rtcd.h',
-        'platforms/linux-x64/vpx_scale_rtcd.h',
-        'platforms/linux-x64/vpx_version.h',
         'vp9/common/vp9_alloccommon.c',
         'vp9/common/vp9_alloccommon.h',
         'vp9/common/vp9_blockd.c',
@@ -73,7 +139,6 @@
         'vp9/common/vp9_thread_common.h',
         'vp9/common/vp9_tile_common.c',
         'vp9/common/vp9_tile_common.h',
-        'vp9/common/x86/vp9_idct_intrin_sse2.c',
         'vp9/decoder/vp9_decodeframe.c',
         'vp9/decoder/vp9_decodeframe.h',
         'vp9/decoder/vp9_decodemv.c',
@@ -116,22 +181,16 @@
         'vpx_dsp/prob.c',
         'vpx_dsp/prob.h',
         'vpx_dsp/txfm_common.h',
-        'vpx_dsp/variance.c',
-        'vpx_dsp/variance.h',
         'vpx_dsp/vpx_convolve.c',
         'vpx_dsp/vpx_convolve.h',
         'vpx_dsp/vpx_dsp_common.h',
         'vpx_dsp/vpx_dsp_rtcd.c',
         'vpx_dsp/vpx_filter.h',
-        'vpx_dsp/x86/convolve.h',
-        'vpx_dsp/x86/loopfilter_sse2.c',
-        'vpx_dsp/x86/vpx_asm_stubs.c',
         'vpx_mem/include/vpx_mem_intrnl.h',
         'vpx_mem/vpx_mem.c',
         'vpx_mem/vpx_mem.h',
         'vpx_ports/bitops.h',
         'vpx_ports/emmintrin_compat.h',
-        'vpx_ports/emms.asm',
         'vpx_ports/mem.h',
         'vpx_ports/mem_ops.h',
         'vpx_ports/mem_ops_aligned.h',
@@ -139,8 +198,6 @@
         'vpx_ports/system_state.h',
         'vpx_ports/vpx_once.h',
         'vpx_ports/vpx_timer.h',
-        'vpx_ports/x86.h',
-        'vpx_ports/x86_abi_support.asm',
         'vpx_scale/generic/gen_scalers.c',
         'vpx_scale/generic/vpx_scale.c',
         'vpx_scale/generic/yv12config.c',
diff --git a/src/third_party/libvpx/platforms/arm/README.md b/src/third_party/libvpx/platforms/arm/README.md
new file mode 100644
index 0000000..d3b4ee6
--- /dev/null
+++ b/src/third_party/libvpx/platforms/arm/README.md
@@ -0,0 +1,38 @@
+The config files must be generated for the particular architecture, in our case
+Tizen armv7l.
+
+It was generated by running:
+`$ ./configure --target=armv7-linux-gcc --disable-vp8 --disable-examples
+--disable-webm-io --disable-vp9-encoder --disable-avx --disable-sse4_1
+--disable-ssse3 --disable-mmx --disable-sse --disable-sse2 --disable-sse3
+--disable-runtime_cpu_detect`
+
+Any configure problems will be logged in config.log.
+
+This will generate some vpx_config files in the source directory. They don't
+show up in '`git status`' because they are listed in `.gitignore`.
+
+Now run "`make`" in order to generate `vp9_rtcd.h`, `vpx_scale_rtcd.h`, and
+`vpx_version.h`.
+
+Everything should build and you should end up with `libvpx.a`.
+
+At this point, you should have the following files:
+```
+  vp9_rtcd.h
+  vpx_config.c
+  vpx_config.h
+  vpx_dsp_rtcd.h
+  vpx_scale_rtcd.h
+  vpx_version.h
+```
+
+Any other generated files can be discarded.
+
+To generate the test data, set `LIBVPX_TEST_DATA_PATH` to a local directory, and
+run '`make testdata`'.
+
+The list of source files can be generated by running
+`$ make libvpx_srcs.txt`
+
+This can be used to update the sources rule in `libvpx.gyp`.
diff --git a/src/third_party/libvpx/platforms/arm/vp9_rtcd.h b/src/third_party/libvpx/platforms/arm/vp9_rtcd.h
new file mode 100644
index 0000000..ac5ed92
--- /dev/null
+++ b/src/third_party/libvpx/platforms/arm/vp9_rtcd.h
@@ -0,0 +1,62 @@
+#ifndef VP9_RTCD_H_
+#define VP9_RTCD_H_
+
+#ifdef RTCD_C
+#define RTCD_EXTERN
+#else
+#define RTCD_EXTERN extern
+#endif
+
+/*
+ * VP9
+ */
+
+#include "vpx/vpx_integer.h"
+#include "vp9/common/vp9_common.h"
+#include "vp9/common/vp9_enums.h"
+
+struct macroblockd;
+
+/* Encoder forward decls */
+struct macroblock;
+struct vp9_variance_vtable;
+struct search_site_config;
+struct mv;
+union int_mv;
+struct yv12_buffer_config;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void vp9_iht16x16_256_add_c(const tran_low_t *input, uint8_t *output, int pitch, int tx_type);
+#define vp9_iht16x16_256_add vp9_iht16x16_256_add_c
+
+void vp9_iht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type);
+void vp9_iht4x4_16_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type);
+#define vp9_iht4x4_16_add vp9_iht4x4_16_add_neon
+
+void vp9_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type);
+void vp9_iht8x8_64_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride, int tx_type);
+#define vp9_iht8x8_64_add vp9_iht8x8_64_add_neon
+
+void vp9_rtcd(void);
+
+#include "vpx_config.h"
+
+#ifdef RTCD_C
+#include "vpx_ports/arm.h"
+static void setup_rtcd_internal(void)
+{
+    int flags = arm_cpu_caps();
+
+    (void)flags;
+
+}
+#endif
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/src/third_party/libvpx/platforms/arm/vpx_config.c b/src/third_party/libvpx/platforms/arm/vpx_config.c
new file mode 100644
index 0000000..fc4c4d4
--- /dev/null
+++ b/src/third_party/libvpx/platforms/arm/vpx_config.c
@@ -0,0 +1,10 @@
+/* Copyright (c) 2011 The WebM project authors. All Rights Reserved. */
+/*  */
+/* Use of this source code is governed by a BSD-style license */
+/* that can be found in the LICENSE file in the root of the source */
+/* tree. An additional intellectual property rights grant can be found */
+/* in the file PATENTS.  All contributing project authors may */
+/* be found in the AUTHORS file in the root of the source tree. */
+#include "vpx/vpx_codec.h"
+static const char* const cfg = "--target=armv7-linux-gcc --disable-vp8 --disable-examples --disable-webm-io --disable-vp9-encoder --disable-avx --disable-sse4_1 --disable-ssse3 --disable-mmx --disable-sse --disable-sse2 --disable-sse3 --disable-runtime_cpu_detect";
+const char *vpx_codec_build_config(void) {return cfg;}
diff --git a/src/third_party/libvpx/platforms/arm/vpx_config.h b/src/third_party/libvpx/platforms/arm/vpx_config.h
new file mode 100644
index 0000000..23b3fe2
--- /dev/null
+++ b/src/third_party/libvpx/platforms/arm/vpx_config.h
@@ -0,0 +1,98 @@
+/* Copyright (c) 2011 The WebM project authors. All Rights Reserved. */
+/*  */
+/* Use of this source code is governed by a BSD-style license */
+/* that can be found in the LICENSE file in the root of the source */
+/* tree. An additional intellectual property rights grant can be found */
+/* in the file PATENTS.  All contributing project authors may */
+/* be found in the AUTHORS file in the root of the source tree. */
+/* This file automatically generated by configure. Do not edit! */
+#ifndef VPX_CONFIG_H
+#define VPX_CONFIG_H
+#define RESTRICT
+#define INLINE      inline
+#define ARCH_ARM 1
+#define ARCH_MIPS 0
+#define ARCH_X86 0
+#define ARCH_X86_64 0
+#define HAVE_EDSP 0
+#define HAVE_MEDIA 1
+#define HAVE_NEON 1
+#define HAVE_NEON_ASM 1
+#define HAVE_MIPS32 0
+#define HAVE_DSPR2 0
+#define HAVE_MSA 0
+#define HAVE_MIPS64 0
+#define HAVE_MMX 0
+#define HAVE_SSE 0
+#define HAVE_SSE2 0
+#define HAVE_SSE3 0
+#define HAVE_SSSE3 0
+#define HAVE_SSE4_1 0
+#define HAVE_AVX 0
+#define HAVE_AVX2 0
+#define HAVE_VPX_PORTS 1
+#define HAVE_PTHREAD_H 1
+#define HAVE_UNISTD_H 1
+#define CONFIG_DEPENDENCY_TRACKING 1
+#define CONFIG_EXTERNAL_BUILD 0
+#define CONFIG_INSTALL_DOCS 0
+#define CONFIG_INSTALL_BINS 1
+#define CONFIG_INSTALL_LIBS 1
+#define CONFIG_INSTALL_SRCS 0
+#define CONFIG_USE_X86INC 0
+#define CONFIG_DEBUG 0
+#define CONFIG_GPROF 0
+#define CONFIG_GCOV 0
+#define CONFIG_RVCT 0
+#define CONFIG_GCC 1
+#define CONFIG_MSVS 0
+#define CONFIG_PIC 0
+#define CONFIG_BIG_ENDIAN 0
+#define CONFIG_CODEC_SRCS 0
+#define CONFIG_DEBUG_LIBS 0
+#define CONFIG_DEQUANT_TOKENS 0
+#define CONFIG_DC_RECON 0
+#define CONFIG_RUNTIME_CPU_DETECT 0
+#define CONFIG_POSTPROC 0
+#define CONFIG_VP9_POSTPROC 0
+#define CONFIG_MULTITHREAD 1
+#define CONFIG_INTERNAL_STATS 0
+#define CONFIG_VP8_ENCODER 0
+#define CONFIG_VP8_DECODER 0
+#define CONFIG_VP9_ENCODER 0
+#define CONFIG_VP9_DECODER 1
+#define CONFIG_VP10_ENCODER 0
+#define CONFIG_VP10_DECODER 0
+#define CONFIG_VP8 0
+#define CONFIG_VP9 1
+#define CONFIG_VP10 0
+#define CONFIG_ENCODERS 0
+#define CONFIG_DECODERS 1
+#define CONFIG_STATIC_MSVCRT 0
+#define CONFIG_SPATIAL_RESAMPLING 1
+#define CONFIG_REALTIME_ONLY 0
+#define CONFIG_ONTHEFLY_BITPACKING 0
+#define CONFIG_ERROR_CONCEALMENT 0
+#define CONFIG_SHARED 0
+#define CONFIG_STATIC 1
+#define CONFIG_SMALL 0
+#define CONFIG_POSTPROC_VISUALIZER 0
+#define CONFIG_OS_SUPPORT 1
+#define CONFIG_UNIT_TESTS 1
+#define CONFIG_WEBM_IO 0
+#define CONFIG_LIBYUV 1
+#define CONFIG_DECODE_PERF_TESTS 0
+#define CONFIG_ENCODE_PERF_TESTS 0
+#define CONFIG_MULTI_RES_ENCODING 0
+#define CONFIG_TEMPORAL_DENOISING 1
+#define CONFIG_VP9_TEMPORAL_DENOISING 0
+#define CONFIG_COEFFICIENT_RANGE_CHECKING 0
+#define CONFIG_VP9_HIGHBITDEPTH 0
+#define CONFIG_BETTER_HW_COMPATIBILITY 0
+#define CONFIG_EXPERIMENTAL 0
+#define CONFIG_SIZE_LIMIT 0
+#define CONFIG_SPATIAL_SVC 0
+#define CONFIG_FP_MB_STATS 0
+#define CONFIG_EMULATE_HARDWARE 0
+#define CONFIG_MISC_FIXES 0
+#endif /* VPX_CONFIG_H */
diff --git a/src/third_party/libvpx/platforms/arm/vpx_dsp_rtcd.h b/src/third_party/libvpx/platforms/arm/vpx_dsp_rtcd.h
new file mode 100644
index 0000000..89c1dd0
--- /dev/null
+++ b/src/third_party/libvpx/platforms/arm/vpx_dsp_rtcd.h
@@ -0,0 +1,426 @@
+#ifndef VPX_DSP_RTCD_H_
+#define VPX_DSP_RTCD_H_
+
+#ifdef RTCD_C
+#define RTCD_EXTERN
+#else
+#define RTCD_EXTERN extern
+#endif
+
+/*
+ * DSP
+ */
+
+#include "vpx/vpx_integer.h"
+#include "vpx_dsp/vpx_dsp_common.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void vpx_convolve8_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+void vpx_convolve8_neon(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_convolve8 vpx_convolve8_neon
+
+void vpx_convolve8_avg_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+void vpx_convolve8_avg_neon(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_convolve8_avg vpx_convolve8_avg_neon
+
+void vpx_convolve8_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+void vpx_convolve8_avg_horiz_neon(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_convolve8_avg_horiz vpx_convolve8_avg_horiz_neon
+
+void vpx_convolve8_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+void vpx_convolve8_avg_vert_neon(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_convolve8_avg_vert vpx_convolve8_avg_vert_neon
+
+void vpx_convolve8_horiz_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+void vpx_convolve8_horiz_neon(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_convolve8_horiz vpx_convolve8_horiz_neon
+
+void vpx_convolve8_vert_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+void vpx_convolve8_vert_neon(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_convolve8_vert vpx_convolve8_vert_neon
+
+void vpx_convolve_avg_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+void vpx_convolve_avg_neon(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_convolve_avg vpx_convolve_avg_neon
+
+void vpx_convolve_copy_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+void vpx_convolve_copy_neon(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_convolve_copy vpx_convolve_copy_neon
+
+void vpx_d117_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d117_predictor_16x16 vpx_d117_predictor_16x16_c
+
+void vpx_d117_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d117_predictor_32x32 vpx_d117_predictor_32x32_c
+
+void vpx_d117_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d117_predictor_4x4 vpx_d117_predictor_4x4_c
+
+void vpx_d117_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d117_predictor_8x8 vpx_d117_predictor_8x8_c
+
+void vpx_d135_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d135_predictor_16x16 vpx_d135_predictor_16x16_c
+
+void vpx_d135_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d135_predictor_32x32 vpx_d135_predictor_32x32_c
+
+void vpx_d135_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_d135_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d135_predictor_4x4 vpx_d135_predictor_4x4_neon
+
+void vpx_d135_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d135_predictor_8x8 vpx_d135_predictor_8x8_c
+
+void vpx_d153_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d153_predictor_16x16 vpx_d153_predictor_16x16_c
+
+void vpx_d153_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d153_predictor_32x32 vpx_d153_predictor_32x32_c
+
+void vpx_d153_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d153_predictor_4x4 vpx_d153_predictor_4x4_c
+
+void vpx_d153_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d153_predictor_8x8 vpx_d153_predictor_8x8_c
+
+void vpx_d207_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d207_predictor_16x16 vpx_d207_predictor_16x16_c
+
+void vpx_d207_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d207_predictor_32x32 vpx_d207_predictor_32x32_c
+
+void vpx_d207_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d207_predictor_4x4 vpx_d207_predictor_4x4_c
+
+void vpx_d207_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d207_predictor_8x8 vpx_d207_predictor_8x8_c
+
+void vpx_d207e_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d207e_predictor_16x16 vpx_d207e_predictor_16x16_c
+
+void vpx_d207e_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d207e_predictor_32x32 vpx_d207e_predictor_32x32_c
+
+void vpx_d207e_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d207e_predictor_4x4 vpx_d207e_predictor_4x4_c
+
+void vpx_d207e_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d207e_predictor_8x8 vpx_d207e_predictor_8x8_c
+
+void vpx_d45_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_d45_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d45_predictor_16x16 vpx_d45_predictor_16x16_neon
+
+void vpx_d45_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d45_predictor_32x32 vpx_d45_predictor_32x32_c
+
+void vpx_d45_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_d45_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d45_predictor_4x4 vpx_d45_predictor_4x4_neon
+
+void vpx_d45_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_d45_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d45_predictor_8x8 vpx_d45_predictor_8x8_neon
+
+void vpx_d45e_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d45e_predictor_16x16 vpx_d45e_predictor_16x16_c
+
+void vpx_d45e_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d45e_predictor_32x32 vpx_d45e_predictor_32x32_c
+
+void vpx_d45e_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d45e_predictor_4x4 vpx_d45e_predictor_4x4_c
+
+void vpx_d45e_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d45e_predictor_8x8 vpx_d45e_predictor_8x8_c
+
+void vpx_d63_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d63_predictor_16x16 vpx_d63_predictor_16x16_c
+
+void vpx_d63_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d63_predictor_32x32 vpx_d63_predictor_32x32_c
+
+void vpx_d63_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d63_predictor_4x4 vpx_d63_predictor_4x4_c
+
+void vpx_d63_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d63_predictor_8x8 vpx_d63_predictor_8x8_c
+
+void vpx_d63e_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d63e_predictor_16x16 vpx_d63e_predictor_16x16_c
+
+void vpx_d63e_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d63e_predictor_32x32 vpx_d63e_predictor_32x32_c
+
+void vpx_d63e_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d63e_predictor_4x4 vpx_d63e_predictor_4x4_c
+
+void vpx_d63e_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d63e_predictor_8x8 vpx_d63e_predictor_8x8_c
+
+void vpx_d63f_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_d63f_predictor_4x4 vpx_d63f_predictor_4x4_c
+
+void vpx_dc_128_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_128_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_128_predictor_16x16 vpx_dc_128_predictor_16x16_neon
+
+void vpx_dc_128_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_128_predictor_32x32_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_128_predictor_32x32 vpx_dc_128_predictor_32x32_neon
+
+void vpx_dc_128_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_128_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_128_predictor_4x4 vpx_dc_128_predictor_4x4_neon
+
+void vpx_dc_128_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_128_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_128_predictor_8x8 vpx_dc_128_predictor_8x8_neon
+
+void vpx_dc_left_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_left_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_left_predictor_16x16 vpx_dc_left_predictor_16x16_neon
+
+void vpx_dc_left_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_left_predictor_32x32_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_left_predictor_32x32 vpx_dc_left_predictor_32x32_neon
+
+void vpx_dc_left_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_left_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_left_predictor_4x4 vpx_dc_left_predictor_4x4_neon
+
+void vpx_dc_left_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_left_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_left_predictor_8x8 vpx_dc_left_predictor_8x8_neon
+
+void vpx_dc_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_predictor_16x16 vpx_dc_predictor_16x16_neon
+
+void vpx_dc_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_predictor_32x32_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_predictor_32x32 vpx_dc_predictor_32x32_neon
+
+void vpx_dc_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_predictor_4x4 vpx_dc_predictor_4x4_neon
+
+void vpx_dc_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_predictor_8x8 vpx_dc_predictor_8x8_neon
+
+void vpx_dc_top_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_top_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_top_predictor_16x16 vpx_dc_top_predictor_16x16_neon
+
+void vpx_dc_top_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_top_predictor_32x32_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_top_predictor_32x32 vpx_dc_top_predictor_32x32_neon
+
+void vpx_dc_top_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_top_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_top_predictor_4x4 vpx_dc_top_predictor_4x4_neon
+
+void vpx_dc_top_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_dc_top_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_dc_top_predictor_8x8 vpx_dc_top_predictor_8x8_neon
+
+void vpx_h_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_h_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_h_predictor_16x16 vpx_h_predictor_16x16_neon
+
+void vpx_h_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_h_predictor_32x32_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_h_predictor_32x32 vpx_h_predictor_32x32_neon
+
+void vpx_h_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_h_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_h_predictor_4x4 vpx_h_predictor_4x4_neon
+
+void vpx_h_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_h_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_h_predictor_8x8 vpx_h_predictor_8x8_neon
+
+void vpx_he_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_he_predictor_4x4 vpx_he_predictor_4x4_c
+
+void vpx_idct16x16_10_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct16x16_10_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_idct16x16_10_add vpx_idct16x16_10_add_neon
+
+void vpx_idct16x16_1_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct16x16_1_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_idct16x16_1_add vpx_idct16x16_1_add_neon
+
+void vpx_idct16x16_256_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct16x16_256_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_idct16x16_256_add vpx_idct16x16_256_add_neon
+
+void vpx_idct32x32_1024_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct32x32_1024_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_idct32x32_1024_add vpx_idct32x32_1024_add_neon
+
+void vpx_idct32x32_135_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct32x32_1024_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_idct32x32_135_add vpx_idct32x32_1024_add_neon
+
+void vpx_idct32x32_1_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct32x32_1_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_idct32x32_1_add vpx_idct32x32_1_add_neon
+
+void vpx_idct32x32_34_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct32x32_1024_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_idct32x32_34_add vpx_idct32x32_1024_add_neon
+
+void vpx_idct4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct4x4_16_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_idct4x4_16_add vpx_idct4x4_16_add_neon
+
+void vpx_idct4x4_1_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct4x4_1_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_idct4x4_1_add vpx_idct4x4_1_add_neon
+
+void vpx_idct8x8_12_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct8x8_12_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_idct8x8_12_add vpx_idct8x8_12_add_neon
+
+void vpx_idct8x8_1_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct8x8_1_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_idct8x8_1_add vpx_idct8x8_1_add_neon
+
+void vpx_idct8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+void vpx_idct8x8_64_add_neon(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_idct8x8_64_add vpx_idct8x8_64_add_neon
+
+void vpx_iwht4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_iwht4x4_16_add vpx_iwht4x4_16_add_c
+
+void vpx_iwht4x4_1_add_c(const tran_low_t *input, uint8_t *dest, int dest_stride);
+#define vpx_iwht4x4_1_add vpx_iwht4x4_1_add_c
+
+void vpx_lpf_horizontal_4_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+void vpx_lpf_horizontal_4_neon(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+#define vpx_lpf_horizontal_4 vpx_lpf_horizontal_4_neon
+
+void vpx_lpf_horizontal_4_dual_c(uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1);
+void vpx_lpf_horizontal_4_dual_neon(uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1);
+#define vpx_lpf_horizontal_4_dual vpx_lpf_horizontal_4_dual_neon
+
+void vpx_lpf_horizontal_8_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+void vpx_lpf_horizontal_8_neon(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+#define vpx_lpf_horizontal_8 vpx_lpf_horizontal_8_neon
+
+void vpx_lpf_horizontal_8_dual_c(uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1);
+void vpx_lpf_horizontal_8_dual_neon(uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1);
+#define vpx_lpf_horizontal_8_dual vpx_lpf_horizontal_8_dual_neon
+
+void vpx_lpf_horizontal_edge_16_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+void vpx_lpf_horizontal_edge_16_neon(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+#define vpx_lpf_horizontal_edge_16 vpx_lpf_horizontal_edge_16_neon
+
+void vpx_lpf_horizontal_edge_8_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+void vpx_lpf_horizontal_edge_8_neon(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+#define vpx_lpf_horizontal_edge_8 vpx_lpf_horizontal_edge_8_neon
+
+void vpx_lpf_vertical_16_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+void vpx_lpf_vertical_16_neon(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+#define vpx_lpf_vertical_16 vpx_lpf_vertical_16_neon
+
+void vpx_lpf_vertical_16_dual_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+void vpx_lpf_vertical_16_dual_neon(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+#define vpx_lpf_vertical_16_dual vpx_lpf_vertical_16_dual_neon
+
+void vpx_lpf_vertical_4_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+void vpx_lpf_vertical_4_neon(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+#define vpx_lpf_vertical_4 vpx_lpf_vertical_4_neon
+
+void vpx_lpf_vertical_4_dual_c(uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1);
+void vpx_lpf_vertical_4_dual_neon(uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1);
+#define vpx_lpf_vertical_4_dual vpx_lpf_vertical_4_dual_neon
+
+void vpx_lpf_vertical_8_c(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+void vpx_lpf_vertical_8_neon(uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh);
+#define vpx_lpf_vertical_8 vpx_lpf_vertical_8_neon
+
+void vpx_lpf_vertical_8_dual_c(uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1);
+void vpx_lpf_vertical_8_dual_neon(uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1);
+#define vpx_lpf_vertical_8_dual vpx_lpf_vertical_8_dual_neon
+
+void vpx_scaled_2d_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_scaled_2d vpx_scaled_2d_c
+
+void vpx_scaled_avg_2d_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_scaled_avg_2d vpx_scaled_avg_2d_c
+
+void vpx_scaled_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_scaled_avg_horiz vpx_scaled_avg_horiz_c
+
+void vpx_scaled_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_scaled_avg_vert vpx_scaled_avg_vert_c
+
+void vpx_scaled_horiz_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_scaled_horiz vpx_scaled_horiz_c
+
+void vpx_scaled_vert_c(const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h);
+#define vpx_scaled_vert vpx_scaled_vert_c
+
+void vpx_tm_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_tm_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_tm_predictor_16x16 vpx_tm_predictor_16x16_neon
+
+void vpx_tm_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_tm_predictor_32x32_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_tm_predictor_32x32 vpx_tm_predictor_32x32_neon
+
+void vpx_tm_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_tm_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_tm_predictor_4x4 vpx_tm_predictor_4x4_neon
+
+void vpx_tm_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_tm_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_tm_predictor_8x8 vpx_tm_predictor_8x8_neon
+
+void vpx_v_predictor_16x16_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_v_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_v_predictor_16x16 vpx_v_predictor_16x16_neon
+
+void vpx_v_predictor_32x32_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_v_predictor_32x32_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_v_predictor_32x32 vpx_v_predictor_32x32_neon
+
+void vpx_v_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_v_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_v_predictor_4x4 vpx_v_predictor_4x4_neon
+
+void vpx_v_predictor_8x8_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+void vpx_v_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_v_predictor_8x8 vpx_v_predictor_8x8_neon
+
+void vpx_ve_predictor_4x4_c(uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left);
+#define vpx_ve_predictor_4x4 vpx_ve_predictor_4x4_c
+
+void vpx_dsp_rtcd(void);
+
+#include "vpx_config.h"
+
+#ifdef RTCD_C
+#include "vpx_ports/arm.h"
+static void setup_rtcd_internal(void)
+{
+    int flags = arm_cpu_caps();
+
+    (void)flags;
+
+}
+#endif
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/src/third_party/libvpx/platforms/arm/vpx_scale_rtcd.h b/src/third_party/libvpx/platforms/arm/vpx_scale_rtcd.h
new file mode 100644
index 0000000..a1564b7
--- /dev/null
+++ b/src/third_party/libvpx/platforms/arm/vpx_scale_rtcd.h
@@ -0,0 +1,71 @@
+#ifndef VPX_SCALE_RTCD_H_
+#define VPX_SCALE_RTCD_H_
+
+#ifdef RTCD_C
+#define RTCD_EXTERN
+#else
+#define RTCD_EXTERN extern
+#endif
+
+struct yv12_buffer_config;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void vp8_horizontal_line_2_1_scale_c(const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width);
+#define vp8_horizontal_line_2_1_scale vp8_horizontal_line_2_1_scale_c
+
+void vp8_horizontal_line_5_3_scale_c(const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width);
+#define vp8_horizontal_line_5_3_scale vp8_horizontal_line_5_3_scale_c
+
+void vp8_horizontal_line_5_4_scale_c(const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width);
+#define vp8_horizontal_line_5_4_scale vp8_horizontal_line_5_4_scale_c
+
+void vp8_vertical_band_2_1_scale_c(unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width);
+#define vp8_vertical_band_2_1_scale vp8_vertical_band_2_1_scale_c
+
+void vp8_vertical_band_2_1_scale_i_c(unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width);
+#define vp8_vertical_band_2_1_scale_i vp8_vertical_band_2_1_scale_i_c
+
+void vp8_vertical_band_5_3_scale_c(unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width);
+#define vp8_vertical_band_5_3_scale vp8_vertical_band_5_3_scale_c
+
+void vp8_vertical_band_5_4_scale_c(unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width);
+#define vp8_vertical_band_5_4_scale vp8_vertical_band_5_4_scale_c
+
+void vp8_yv12_copy_frame_c(const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc);
+#define vp8_yv12_copy_frame vp8_yv12_copy_frame_c
+
+void vp8_yv12_extend_frame_borders_c(struct yv12_buffer_config *ybf);
+#define vp8_yv12_extend_frame_borders vp8_yv12_extend_frame_borders_c
+
+void vpx_extend_frame_borders_c(struct yv12_buffer_config *ybf);
+#define vpx_extend_frame_borders vpx_extend_frame_borders_c
+
+void vpx_extend_frame_inner_borders_c(struct yv12_buffer_config *ybf);
+#define vpx_extend_frame_inner_borders vpx_extend_frame_inner_borders_c
+
+void vpx_yv12_copy_y_c(const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc);
+#define vpx_yv12_copy_y vpx_yv12_copy_y_c
+
+void vpx_scale_rtcd(void);
+
+#include "vpx_config.h"
+
+#ifdef RTCD_C
+#include "vpx_ports/arm.h"
+static void setup_rtcd_internal(void)
+{
+    int flags = arm_cpu_caps();
+
+    (void)flags;
+
+}
+#endif
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/src/third_party/libvpx/platforms/arm/vpx_version.h b/src/third_party/libvpx/platforms/arm/vpx_version.h
new file mode 100644
index 0000000..e44cba1
--- /dev/null
+++ b/src/third_party/libvpx/platforms/arm/vpx_version.h
@@ -0,0 +1,7 @@
+#define VERSION_MAJOR  0
+#define VERSION_MINOR  0
+#define VERSION_PATCH  0
+#define VERSION_EXTRA  ""
+#define VERSION_PACKED ((VERSION_MAJOR<<16)|(VERSION_MINOR<<8)|(VERSION_PATCH))
+#define VERSION_STRING_NOSP "Release"
+#define VERSION_STRING      " Release"
diff --git a/src/third_party/skia/src/gpu/gl/GrGLCaps.cpp b/src/third_party/skia/src/gpu/gl/GrGLCaps.cpp
index 0656cc7..c5c422d 100644
--- a/src/third_party/skia/src/gpu/gl/GrGLCaps.cpp
+++ b/src/third_party/skia/src/gpu/gl/GrGLCaps.cpp
@@ -554,6 +554,16 @@
     // Disable scratch texture reuse on Mali and Adreno devices
     fReuseScratchTextures = kARM_GrGLVendor != ctxInfo.vendor();
 
+#if defined(COBALT)
+    // A crash issue was found on the Nexus Player within the PowerVR GLES
+    // driver when uploading new data to reuse scratch textures, so disable
+    // scratch texture reuse on that device.
+    if (kImagination_GrGLVendor == ctxInfo.vendor() &&
+        kPowerVRRogue_GrGLRenderer == ctxInfo.renderer()) {
+        fReuseScratchTextures = false;
+    }
+#endif
+
 #if 0
     fReuseScratchBuffers = kARM_GrGLVendor != ctxInfo.vendor() &&
                            kQualcomm_GrGLVendor != ctxInfo.vendor();
diff --git a/src/v8/src/runtime/runtime-atomics.cc b/src/v8/src/runtime/runtime-atomics.cc
index 68a7b41..cca1df9 100644
--- a/src/v8/src/runtime/runtime-atomics.cc
+++ b/src/v8/src/runtime/runtime-atomics.cc
@@ -10,6 +10,8 @@
 #include "src/conversions-inl.h"
 #include "src/factory.h"
 
+#include "starboard/log.h"
+
 // Implement Atomic accesses to SharedArrayBuffers as defined in the
 // SharedArrayBuffer draft spec, found here
 // https://github.com/tc39/ecmascript_sharedmem
@@ -19,7 +21,51 @@
 
 namespace {
 
-#if V8_CC_GNU
+#if defined(STARBOARD)
+
+template <typename T>
+inline T ExchangeSeqCst(T* p, T value) {
+  SB_NOTREACHED();
+  return 0;
+}
+
+template <typename T>
+inline T CompareExchangeSeqCst(T* p, T oldval, T newval) {
+  SB_NOTREACHED();
+  return 0;
+}
+
+template <typename T>
+inline T AddSeqCst(T* p, T value) {
+  SB_NOTREACHED();
+  return 0;
+}
+
+template <typename T>
+inline T SubSeqCst(T* p, T value) {
+  SB_NOTREACHED();
+  return 0;
+}
+
+template <typename T>
+inline T AndSeqCst(T* p, T value) {
+  SB_NOTREACHED();
+  return 0;
+}
+
+template <typename T>
+inline T OrSeqCst(T* p, T value) {
+  SB_NOTREACHED();
+  return 0;
+}
+
+template <typename T>
+inline T XorSeqCst(T* p, T value) {
+  SB_NOTREACHED();
+  return 0;
+}
+
+#elif V8_CC_GNU
 
 template <typename T>
 inline T ExchangeSeqCst(T* p, T value) {
diff --git a/src/v8/src/trap-handler/handler-inside.cc b/src/v8/src/trap-handler/handler-inside.cc
index d3c543f..06b14a7 100644
--- a/src/v8/src/trap-handler/handler-inside.cc
+++ b/src/v8/src/trap-handler/handler-inside.cc
@@ -65,6 +65,17 @@
 }  // namespace
 
 #if V8_TRAP_HANDLER_SUPPORTED && V8_OS_LINUX
+#if defined(STARBOARD)
+bool TryHandleSignal(int signum, siginfo_t* info, ucontext_t* context) {
+  SB_NOTREACHED();
+  return false;
+}
+
+bool TryFindLandingPad(uintptr_t fault_addr, uintptr_t* landing_pad) {
+  SB_NOTREACHED()
+  return false;
+}
+#else
 bool TryHandleSignal(int signum, siginfo_t* info, ucontext_t* context) {
   // Bail out early in case we got called for the wrong kind of signal.
   if (signum != SIGSEGV) {
@@ -154,6 +165,7 @@
   }
   return false;
 }
+#endif  // STARBOARD
 #endif  // V8_TRAP_HANDLER_SUPPORTED && V8_OS_LINUX
 
 #if V8_TRAP_HANDLER_SUPPORTED
diff --git a/src/v8/src/trap-handler/handler-shared.cc b/src/v8/src/trap-handler/handler-shared.cc
index d07f7ae..56a0b6e 100644
--- a/src/v8/src/trap-handler/handler-shared.cc
+++ b/src/v8/src/trap-handler/handler-shared.cc
@@ -23,10 +23,12 @@
 namespace internal {
 namespace trap_handler {
 
+#if !defined(STARBOARD)
 // We declare this as int rather than bool as a workaround for a glibc bug, in
 // which the dynamic loader cannot handle executables whose TLS area is only
 // 1 byte in size; see https://sourceware.org/bugzilla/show_bug.cgi?id=14898.
 THREAD_LOCAL int g_thread_in_wasm_code;
+#endif
 
 #if V8_TRAP_HANDLER_SUPPORTED
 // When using the default signal handler, we save the old one to restore in case
@@ -43,9 +45,11 @@
 #endif
 }
 
+#if !defined(STARBOARD)
 static_assert(sizeof(g_thread_in_wasm_code) > 1,
               "sizeof(thread_local_var) must be > 1, see "
               "https://sourceware.org/bugzilla/show_bug.cgi?id=14898");
+#endif
 
 size_t gNumCodeObjects = 0;
 CodeProtectionInfoListEntry* gCodeObjects = nullptr;
@@ -53,6 +57,10 @@
 
 std::atomic_flag MetadataLock::spinlock_ = ATOMIC_FLAG_INIT;
 
+#if defined(STARBOARD)
+MetadataLock::MetadataLock() { SB_NOTREACHED(); }
+MetadataLock::~MetadataLock() { SB_NOTREACHED(); }
+#else
 MetadataLock::MetadataLock() {
   if (g_thread_in_wasm_code) {
     abort();
@@ -69,6 +77,7 @@
 
   spinlock_.clear(std::memory_order::memory_order_release);
 }
+#endif
 
 }  // namespace trap_handler
 }  // namespace internal
diff --git a/src/v8/src/trap-handler/trap-handler.h b/src/v8/src/trap-handler/trap-handler.h
index 1e02eeb..b927818 100644
--- a/src/v8/src/trap-handler/trap-handler.h
+++ b/src/v8/src/trap-handler/trap-handler.h
@@ -13,6 +13,8 @@
 #include "src/flags.h"
 #include "src/globals.h"
 
+#include "starboard/log.h"
+
 #if V8_OS_LINUX
 #include <ucontext.h>
 #endif
@@ -57,6 +59,7 @@
 /// to using size_t for index and not need kInvalidIndex.
 void ReleaseHandlerData(int index);
 
+#if !defined(STARBOARD)
 #if V8_OS_WIN
 #define THREAD_LOCAL __declspec(thread)
 #elif V8_OS_ANDROID
@@ -65,14 +68,26 @@
 #else
 #define THREAD_LOCAL __thread
 #endif
+#endif
 
 inline bool IsTrapHandlerEnabled() {
   return FLAG_wasm_trap_handler && V8_TRAP_HANDLER_SUPPORTED;
 }
 
+#if defined(STARBOARD)
+inline bool IsThreadInWasm() {
+  SB_NOTREACHED();
+  return false;
+}
+inline void SetThreadInWasm() { SB_NOTREACHED(); }
+inline void ClearThreadInWasm() { SB_NOTREACHED(); }
+#else
 extern THREAD_LOCAL int g_thread_in_wasm_code;
 
-inline bool IsThreadInWasm() { return g_thread_in_wasm_code; }
+inline bool IsThreadInWasm() {
+  SB_NOTIMPLEMENTED();
+  return g_thread_in_wasm_code;
+}
 
 inline void SetThreadInWasm() {
   if (IsTrapHandlerEnabled()) {
@@ -87,6 +102,7 @@
     g_thread_in_wasm_code = false;
   }
 }
+#endif
 
 bool RegisterDefaultSignalHandler();
 V8_EXPORT_PRIVATE void RestoreOriginalSignalHandler();
diff --git a/src/v8/src/v8.gyp b/src/v8/src/v8.gyp
index ab75a5e..6a64c48 100644
--- a/src/v8/src/v8.gyp
+++ b/src/v8/src/v8.gyp
@@ -47,6 +47,7 @@
     'defines': [
       'V8_OS_STARBOARD=1',
     ],
+    'msvs_disabled_warnings': [4267, 4312, 4351, 4355, 4800, 4838],
     'conditions': [
       ['cobalt_config == "debug"', {
         'defines': [