| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 /** | 150 /** |
| 151 * DOM Attributes which have observable side effect on getter, in the form of | 151 * DOM Attributes which have observable side effect on getter, in the form of |
| 152 * {interfaceName1: {attributeName1: true, | 152 * {interfaceName1: {attributeName1: true, |
| 153 * attributeName2: true, | 153 * attributeName2: true, |
| 154 * ...}, | 154 * ...}, |
| 155 * interfaceName2: {...}, | 155 * interfaceName2: {...}, |
| 156 * ...} | 156 * ...} |
| 157 * @type {!Object<string, !Object<string, boolean>>} | 157 * @type {!Object<string, !Object<string, boolean>>} |
| 158 * @const | 158 * @const |
| 159 */ | 159 */ |
| 160 var domAttributesWithObservableSideEffectOnGet = nullifyObjectProto({}); | 160 var domAttributesWithObservableSideEffectOnGet = { |
| 161 domAttributesWithObservableSideEffectOnGet["Request"] = nullifyObjectProto({}); | 161 Request: { body: true, __proto__: null }, |
| 162 domAttributesWithObservableSideEffectOnGet["Request"]["body"] = true; | 162 Response: { body: true, __proto__: null }, |
| 163 domAttributesWithObservableSideEffectOnGet["Response"] = nullifyObjectProto({}); | 163 __proto__: null |
| 164 domAttributesWithObservableSideEffectOnGet["Response"]["body"] = true; | 164 } |
| 165 | 165 |
| 166 /** | 166 /** |
| 167 * @param {!Object} object | 167 * @param {!Object} object |
| 168 * @param {string} attribute | 168 * @param {string} attribute |
| 169 * @return {boolean} | 169 * @return {boolean} |
| 170 */ | 170 */ |
| 171 function doesAttributeHaveObservableSideEffectOnGet(object, attribute) | 171 function doesAttributeHaveObservableSideEffectOnGet(object, attribute) |
| 172 { | 172 { |
| 173 for (var interfaceName in domAttributesWithObservableSideEffectOnGet) { | 173 for (var interfaceName in domAttributesWithObservableSideEffectOnGet) { |
| 174 var interfaceFunction = inspectedGlobalObject[interfaceName]; | 174 var interfaceFunction = inspectedGlobalObject[interfaceName]; |
| 175 // Call to instanceOf looks safe after typeof check. | 175 // Call to instanceOf looks safe after typeof check. |
| 176 var isInstance = typeof interfaceFunction === "function" && /* suppressB
lacklist */ object instanceof interfaceFunction; | 176 var isInstance = typeof interfaceFunction === "function" && /* suppressB
lacklist */ object instanceof interfaceFunction; |
| 177 if (isInstance) | 177 if (isInstance) |
| 178 return attribute in domAttributesWithObservableSideEffectOnGet[inter
faceName]; | 178 return attribute in domAttributesWithObservableSideEffectOnGet[inter
faceName]; |
| 179 } | 179 } |
| 180 return false; | 180 return false; |
| 181 } | 181 } |
| 182 | 182 |
| 183 /** | 183 /** |
| 184 * @constructor | 184 * @constructor |
| 185 */ | 185 */ |
| 186 var InjectedScript = function() | 186 var InjectedScript = function() |
| 187 { | 187 { |
| 188 } | 188 } |
| 189 InjectedScriptHost.nullifyPrototype(InjectedScript); |
| 189 | 190 |
| 190 /** | 191 /** |
| 191 * @type {!Object.<string, boolean>} | 192 * @type {!Object.<string, boolean>} |
| 192 * @const | 193 * @const |
| 193 */ | 194 */ |
| 194 InjectedScript.primitiveTypes = { | 195 InjectedScript.primitiveTypes = { |
| 195 "undefined": true, | 196 "undefined": true, |
| 196 "boolean": true, | 197 "boolean": true, |
| 197 "number": true, | 198 "number": true, |
| 198 "string": true, | 199 "string": true, |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 return string.substr(0, leftHalf) + "\u2026" + string.substr(string.
length - rightHalf, rightHalf); | 1086 return string.substr(0, leftHalf) + "\u2026" + string.substr(string.
length - rightHalf, rightHalf); |
| 1086 } | 1087 } |
| 1087 return string.substr(0, maxLength) + "\u2026"; | 1088 return string.substr(0, maxLength) + "\u2026"; |
| 1088 }, | 1089 }, |
| 1089 | 1090 |
| 1090 __proto__: null | 1091 __proto__: null |
| 1091 } | 1092 } |
| 1092 | 1093 |
| 1093 return injectedScript; | 1094 return injectedScript; |
| 1094 }) | 1095 }) |
| OLD | NEW |