Lines Matching refs:objectInfo
36 // 1) ObjectInfo. This represents the observed state of a given object. It
182 function ObserverIsActive(observer, objectInfo) {
183 return TypeMapIsDisjointFrom(ObjectInfoGetPerformingTypes(objectInfo),
189 var objectInfo = ObjectInfoGet(object);
190 if (IS_UNDEFINED(objectInfo)) {
194 objectInfo = {
202 object, objectInfo, GetHash(object));
204 return objectInfo;
220 function ObjectInfoGetNotifier(objectInfo) {
221 if (IS_NULL(objectInfo.notifier)) {
223 objectInfo.notifier = notifier;
225 notifier, objectInfo, GetHash(notifier));
228 return objectInfo.notifier;
239 // observer is referenced directly via objectInfo.changeObservers. When a second
241 // priority -> observer and is then stored on objectInfo.changeObservers.
242 function ObjectInfoNormalizeChangeObservers(objectInfo) {
243 if (ChangeObserversIsOptimized(objectInfo.changeObservers)) {
244 var observer = objectInfo.changeObservers;
248 objectInfo.changeObservers = nullProtoObject();
249 objectInfo.changeObservers[priority] = observer;
254 function ObjectInfoAddObserver(objectInfo, callback, acceptList) {
258 if (!objectInfo.changeObservers) {
259 objectInfo.changeObservers = observer;
263 ObjectInfoNormalizeChangeObservers(objectInfo);
265 objectInfo.changeObservers[priority] = observer;
268 function ObjectInfoRemoveObserver(objectInfo, callback) {
269 if (!objectInfo.changeObservers)
272 if (ChangeObserversIsOptimized(objectInfo.changeObservers)) {
273 if (callback === ObserverGetCallback(objectInfo.changeObservers))
274 objectInfo.changeObservers = null;
280 objectInfo.changeObservers[priority] = null;
283 function ObjectInfoHasActiveObservers(objectInfo) {
284 if (IS_UNDEFINED(objectInfo) || !objectInfo.changeObservers)
287 if (ChangeObserversIsOptimized(objectInfo.changeObservers))
288 return ObserverIsActive(objectInfo.changeObservers, objectInfo);
290 for (var priority in objectInfo.changeObservers) {
291 var observer = objectInfo.changeObservers[priority];
292 if (!IS_NULL(observer) && ObserverIsActive(observer, objectInfo))
300 function ObjectInfoAddPerformingType(objectInfo, type) {
301 objectInfo.performing = objectInfo.performing || TypeMapCreate();
302 TypeMapAddType(objectInfo.performing, type);
303 objectInfo.performingCount++;
307 function ObjectInfoRemovePerformingType(objectInfo, type) {
308 objectInfo.performingCount--;
309 TypeMapRemoveType(objectInfo.performing, type);
313 function ObjectInfoGetPerformingTypes(objectInfo) {
314 return objectInfo.performingCount > 0 ? objectInfo.performing : null;
396 var objectInfo = ObjectInfoGetOrCreate(object);
398 ObjectInfoAddObserver(objectInfo, callback, typeList);
411 var objectInfo = ObjectInfoGet(object);
412 if (IS_UNDEFINED(objectInfo))
415 ObjectInfoRemoveObserver(objectInfo, callback);
433 function ObserverEnqueueIfActive(observer, objectInfo, changeRecord) {
434 if (!ObserverIsActive(observer, objectInfo) ||
466 function ObjectInfoEnqueueExternalChangeRecord(objectInfo, changeRecord, type) {
467 if (!ObjectInfoHasActiveObservers(objectInfo))
472 { object: objectInfo.object, type: type } :
473 { object: objectInfo.object };
482 ObjectInfoEnqueueInternalChangeRecord(objectInfo, newRecord);
486 function ObjectInfoEnqueueInternalChangeRecord(objectInfo, changeRecord) {
490 if (ChangeObserversIsOptimized(objectInfo.changeObservers)) {
491 var observer = objectInfo.changeObservers;
492 ObserverEnqueueIfActive(observer, objectInfo, changeRecord);
496 for (var priority in objectInfo.changeObservers) {
497 var observer = objectInfo.changeObservers[priority];
500 ObserverEnqueueIfActive(observer, objectInfo, changeRecord);
506 var objectInfo = ObjectInfoGet(array);
507 if (!IS_UNDEFINED(objectInfo))
508 ObjectInfoAddPerformingType(objectInfo, 'splice');
513 var objectInfo = ObjectInfoGet(array);
514 if (!IS_UNDEFINED(objectInfo))
515 ObjectInfoRemovePerformingType(objectInfo, 'splice');
520 var objectInfo = ObjectInfoGet(array);
521 if (!ObjectInfoHasActiveObservers(objectInfo))
534 ObjectInfoEnqueueInternalChangeRecord(objectInfo, changeRecord);
539 var objectInfo = ObjectInfoGet(object);
540 if (!ObjectInfoHasActiveObservers(objectInfo))
558 ObjectInfoEnqueueInternalChangeRecord(objectInfo, changeRecord);
566 var objectInfo = ObjectInfoGetFromNotifier(this);
567 if (IS_UNDEFINED(objectInfo))
572 ObjectInfoEnqueueExternalChangeRecord(objectInfo, changeRecord);
580 var objectInfo = ObjectInfoGetFromNotifier(this);
581 if (IS_UNDEFINED(objectInfo))
588 var performChangeFn = %GetObjectContextNotifierPerformChange(objectInfo);
589 performChangeFn(objectInfo, changeType, changeFn);
593 function NativeObjectNotifierPerformChange(objectInfo, changeType, changeFn) {
594 ObjectInfoAddPerformingType(objectInfo, changeType);
600 ObjectInfoRemovePerformingType(objectInfo, changeType);
604 ObjectInfoEnqueueExternalChangeRecord(objectInfo, changeRecord, changeType);
626 var objectInfo = ObjectInfoGetOrCreate(object);
627 return ObjectInfoGetNotifier(objectInfo);