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

Unified Diff: src/object-observe.js

Issue 11274014: Store Object.observe state per-isolate rather than per-context (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: More tests Created 8 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 | « src/heap.cc ('k') | src/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/object-observe.js
diff --git a/src/object-observe.js b/src/object-observe.js
index dcf98d84aed1e66359b2c71d8f648733f7479922..13cf335957fd1138698f01b659819b6d0ba45e7c 100644
--- a/src/object-observe.js
+++ b/src/object-observe.js
@@ -43,8 +43,13 @@ function createInternalWeakMap() {
return map;
}
-var observerInfoMap = createInternalWeakMap();
-var objectInfoMap = createInternalWeakMap();
+var objectObservationState = %GetObjectObservationState();
+if (IS_UNDEFINED(objectObservationState.observerInfoMap)) {
+ objectObservationState.observerInfoMap = createInternalWeakMap();
Michael Starzinger 2012/11/05 13:08:10 This will make the WeakMap instantiated in this co
+ objectObservationState.objectInfoMap = createInternalWeakMap();
+}
+var observerInfoMap = objectObservationState.observerInfoMap;
+var objectInfoMap = objectObservationState.objectInfoMap;
function ObjectObserve(object, callback) {
if (!IS_SPEC_OBJECT(object))
@@ -161,4 +166,4 @@ function SetupObjectObserve() {
));
}
-SetupObjectObserve();
+SetupObjectObserve();
« no previous file with comments | « src/heap.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698