OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 ensureInitialized(); | 1048 ensureInitialized(); |
1049 return m_resourceName; | 1049 return m_resourceName; |
1050 } | 1050 } |
1051 | 1051 |
1052 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate* isolate, ExecutionContext* context, v8::Handle<v8::Function> function) | 1052 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate* isolate, ExecutionContext* context, v8::Handle<v8::Function> function) |
1053 { | 1053 { |
1054 DevToolsFunctionInfo info(function); | 1054 DevToolsFunctionInfo info(function); |
1055 return InspectorFunctionCallEvent::data(context, info.scriptId(), info.resou
rceName(), info.lineNumber()); | 1055 return InspectorFunctionCallEvent::data(context, info.scriptId(), info.resou
rceName(), info.lineNumber()); |
1056 } | 1056 } |
1057 | 1057 |
| 1058 bool AttributesWithObservableSideEffectOnGet::hasNoSideEffect(v8::Isolate* isola
te, v8::Handle<v8::Value> domObject, v8::Handle<v8::Value> attributeName) |
| 1059 { |
| 1060 if (!V8DOMWrapper::isWrapper(isolate, domObject)) |
| 1061 return false; |
| 1062 const WrapperTypeInfo* wrapperTypeInfo = |
| 1063 toWrapperTypeInfo(v8::Handle<v8::Object>::Cast(domObject)); |
| 1064 |
| 1065 if (attributeName.IsEmpty() || !attributeName->IsString()) |
| 1066 return false; |
| 1067 String attribute = V8StringResource<>(attributeName); |
| 1068 |
| 1069 if (!wrapperTypeInfo || attribute.isEmpty()) |
| 1070 return false; |
| 1071 |
| 1072 for (const auto& entry : *attributesWithSideEffectOnGet()) { |
| 1073 if (wrapperTypeInfo->isSubclass(entry.first) |
| 1074 && attribute == entry.second) |
| 1075 return false; |
| 1076 } |
| 1077 |
| 1078 return true; |
| 1079 } |
| 1080 |
| 1081 void AttributesWithObservableSideEffectOnGet::add(const WrapperTypeInfo* wrapper
TypeInfo, String attributeName) |
| 1082 { |
| 1083 AttributeSet* attributes = attributesWithSideEffectOnGet(); |
| 1084 AttributeSet::ValueType value(wrapperTypeInfo, attributeName); |
| 1085 if (!attributes->contains(value)) |
| 1086 attributes->append(value); |
| 1087 } |
| 1088 |
| 1089 AttributesWithObservableSideEffectOnGet::AttributeSet* AttributesWithObservableS
ideEffectOnGet::attributesWithSideEffectOnGet() |
| 1090 { |
| 1091 DEFINE_STATIC_LOCAL(AttributeSet, attributes, ()); |
| 1092 return &attributes; |
| 1093 } |
| 1094 |
1058 void v8ConstructorAttributeGetterAsProperty(v8::Local<v8::String> propertyName,
const v8::PropertyCallbackInfo<v8::Value>& info) | 1095 void v8ConstructorAttributeGetterAsProperty(v8::Local<v8::String> propertyName,
const v8::PropertyCallbackInfo<v8::Value>& info) |
1059 { | 1096 { |
1060 v8ConstructorAttributeGetter(info); | 1097 v8ConstructorAttributeGetter(info); |
1061 } | 1098 } |
1062 | 1099 |
1063 void v8ConstructorAttributeGetterAsAccessor(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 1100 void v8ConstructorAttributeGetterAsAccessor(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
1064 { | 1101 { |
1065 v8ConstructorAttributeGetter(info); | 1102 v8ConstructorAttributeGetter(info); |
1066 } | 1103 } |
1067 | 1104 |
1068 } // namespace blink | 1105 } // namespace blink |
OLD | NEW |