diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-18 17:09:36 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-18 17:09:36 +0000 |
commit | 855ab43da4bd0342e2b8c9592b52ef80ac0b773f (patch) | |
tree | 0ea5aa300191aa3e0145fe083015b880edcaed53 /gin/per_context_data.cc | |
parent | a29e465aecb6cfc30b757d31242b06eb39846f2a (diff) | |
download | chromium_src-855ab43da4bd0342e2b8c9592b52ef80ac0b773f.zip chromium_src-855ab43da4bd0342e2b8c9592b52ef80ac0b773f.tar.gz chromium_src-855ab43da4bd0342e2b8c9592b52ef80ac0b773f.tar.bz2 |
Introduce gin_shell
This CL adds a simple shell program for Gin to make edit/test/debug cycle
faster. The shell excutes a list of scripts from the command line and loads any
requested AMD modules relative to the current working directory.
This CL will also let us remove the ugly code in
https://codereview.chromium.org/69843003/diff/240001/mojo/public/bindings/js/test/run_js_tests.cc
because we now know how to file modules via the file system. Eventually for
Mojo, we'll want to use a net_module_provider (instead of the
file_module_provider included in this CL) to load additional AMD modules off
the network.
BUG=317398
R=jochen@chromium.org
Review URL: https://codereview.chromium.org/74753002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235750 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gin/per_context_data.cc')
-rw-r--r-- | gin/per_context_data.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gin/per_context_data.cc b/gin/per_context_data.cc index 8f6261a..58a7241 100644 --- a/gin/per_context_data.cc +++ b/gin/per_context_data.cc @@ -4,7 +4,7 @@ #include "gin/per_context_data.h" -#include <assert.h> +#include "base/logging.h" #include "gin/wrapper_info.h" namespace gin { @@ -20,11 +20,11 @@ PerContextData::PerContextData(v8::Handle<v8::Context> context) { } PerContextData::~PerContextData() { - assert(supplements_.empty()); + DCHECK(supplements_.empty()); } void PerContextData::Detach(v8::Handle<v8::Context> context) { - assert(From(context) == this); + DCHECK(From(context) == this); context->SetAlignedPointerInEmbedderData(kEncodedValueIndex, NULL); SuplementVector supplements; @@ -33,7 +33,6 @@ void PerContextData::Detach(v8::Handle<v8::Context> context) { for (SuplementVector::iterator it = supplements.begin(); it != supplements.end(); ++it) { (*it)->Detach(context); - delete *it; } } @@ -42,8 +41,8 @@ PerContextData* PerContextData::From(v8::Handle<v8::Context> context) { context->GetAlignedPointerFromEmbedderData(kEncodedValueIndex)); } -void PerContextData::AddSupplement(ContextSupplement* supplement) { - supplements_.push_back(supplement); +void PerContextData::AddSupplement(scoped_ptr<ContextSupplement> supplement) { + supplements_.push_back(supplement.release()); } } // namespace gin |