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

Unified Diff: src/bootstrapper.h

Issue 12254007: Make the Isolate parameter mandatory for internal HandleScopes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 7 years, 10 months 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 | « src/api.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.h
diff --git a/src/bootstrapper.h b/src/bootstrapper.h
index fead45604fb46829d0b3a29893c139030d86110b..e33415eeb9ca5f9e5157f0bf23a8b93cff8af286 100644
--- a/src/bootstrapper.h
+++ b/src/bootstrapper.h
@@ -65,7 +65,7 @@ class SourceCodeCache BASE_EMBEDDED {
}
void Add(Vector<const char> name, Handle<SharedFunctionInfo> shared) {
- HandleScope scope;
+ HandleScope scope(shared->GetIsolate());
int length = cache_->length();
Handle<FixedArray> new_array =
FACTORY->NewFixedArray(length + 2, TENURED);
@@ -95,7 +95,6 @@ class Bootstrapper {
// Creates a JavaScript Global Context with initial object graph.
// The returned value is a global handle casted to V8Environment*.
Handle<Context> CreateEnvironment(
- Isolate* isolate,
Handle<Object> global_object,
v8::Handle<v8::ObjectTemplate> global_template,
v8::ExtensionConfiguration* extensions);
@@ -132,6 +131,7 @@ class Bootstrapper {
SourceCodeCache* extensions_cache() { return &extensions_cache_; }
private:
+ Isolate* isolate_;
typedef int NestingCounterType;
NestingCounterType nesting_;
SourceCodeCache extensions_cache_;
@@ -144,7 +144,7 @@ class Bootstrapper {
friend class Isolate;
friend class NativesExternalStringResource;
- Bootstrapper();
+ explicit Bootstrapper(Isolate* isolate);
DISALLOW_COPY_AND_ASSIGN(Bootstrapper);
};
@@ -152,15 +152,18 @@ class Bootstrapper {
class BootstrapperActive BASE_EMBEDDED {
public:
- BootstrapperActive() {
- ++Isolate::Current()->bootstrapper()->nesting_;
+ explicit BootstrapperActive(Bootstrapper* bootstrapper)
+ : bootstrapper_(bootstrapper) {
+ ++bootstrapper_->nesting_;
}
~BootstrapperActive() {
- --Isolate::Current()->bootstrapper()->nesting_;
+ --bootstrapper_->nesting_;
}
private:
+ Bootstrapper* bootstrapper_;
+
DISALLOW_COPY_AND_ASSIGN(BootstrapperActive);
};
« no previous file with comments | « src/api.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698