Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(520)

Unified Diff: gin/context_holder.cc

Issue 60613003: Add a dependency from Gin to base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gin/context_holder.h ('k') | gin/gin.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/context_holder.cc
diff --git a/gin/context_holder.cc b/gin/context_holder.cc
index 077feb70d0719e4612c57e933be74271022a76e2..80c11980938b555c50ac4d74b21986d0256e94d9 100644
--- a/gin/context_holder.cc
+++ b/gin/context_holder.cc
@@ -4,7 +4,7 @@
#include "gin/context_holder.h"
-#include <assert.h>
+#include "base/logging.h"
#include "gin/per_context_data.h"
namespace gin {
@@ -17,18 +17,17 @@ ContextHolder::~ContextHolder() {
v8::HandleScope handle_scope(isolate());
v8::Handle<v8::Context> context = this->context();
- PerContextData* data = PerContextData::From(context);
- data->Detach(context);
- delete data;
+ data_->Detach(context);
+ data_.reset();
// TODO(abarth): Figure out how to set kResetInDestructor to true.
context_.Reset();
}
void ContextHolder::SetContext(v8::Handle<v8::Context> context) {
- assert(context_.IsEmpty());
+ DCHECK(context_.IsEmpty());
context_.Reset(isolate_, context);
- new PerContextData(context); // Deleted in ~ContextHolder.
+ data_.reset(new PerContextData(context));
}
} // namespace gin
« no previous file with comments | « gin/context_holder.h ('k') | gin/gin.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698