Go back to JSON serialization of extension messages. base::Value pickling was
causing OOMs on the browser, and V8ValueConverter has bugs. This is effectively
a revert of both r204067 and r204496, except the json library replaced by the new
safe $JSON, and it's eagerly included via our small-footprint v8::Extension.

BUG=247530,248019,249419
[email protected]
[email protected]

Review URL: https://chromiumcodereview.appspot.com/17144003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207675 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/renderer/extensions/module_system.cc b/chrome/renderer/extensions/module_system.cc
index c29b440..29575b2e 100644
--- a/chrome/renderer/extensions/module_system.cc
+++ b/chrome/renderer/extensions/module_system.cc
@@ -198,6 +198,7 @@
     // Each safe builtin. Keep in order with the arguments in WrapSource.
     context_->safe_builtins()->GetArray(),
     context_->safe_builtins()->GetFunction(),
+    context_->safe_builtins()->GetJSON(),
     context_->safe_builtins()->GetObjekt(),
   };
   {
@@ -482,7 +483,7 @@
   // Keep in order with the arguments in RequireForJsInner.
   v8::Handle<v8::String> left = v8::String::New(
       "(function(require, requireNative, exports,"
-                "$Array, $Function, $Object) {"
+                "$Array, $Function, $JSON, $Object) {"
        "'use strict';");
   v8::Handle<v8::String> right = v8::String::New("\n})");
   return handle_scope.Close(