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

Side by Side Diff: Source/bindings/core/v8/NPV8Object.cpp

Issue 403133002: Suppress ScriptForbiddenScope in Document.cpp and FrameView.cpp in release mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/ScriptForbiddenScope.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2007, 2008, 2009 Google, Inc. All rights reserved. 3 * Copyright (C) 2007, 2008, 2009 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 197 }
198 } 198 }
199 v8NpObject->v8Object.Reset(); 199 v8NpObject->v8Object.Reset();
200 v8NpObject->rootObject = 0; 200 v8NpObject->rootObject = 0;
201 } 201 }
202 202
203 } // namespace blink 203 } // namespace blink
204 204
205 bool _NPN_Invoke(NPP npp, NPObject* npObject, NPIdentifier methodName, const NPV ariant* arguments, uint32_t argumentCount, NPVariant* result) 205 bool _NPN_Invoke(NPP npp, NPObject* npObject, NPIdentifier methodName, const NPV ariant* arguments, uint32_t argumentCount, NPVariant* result)
206 { 206 {
207 ScriptForbiddenScope::AllowSuperUnsafeScript thisShouldBeRemoved;
208
207 if (!npObject) 209 if (!npObject)
208 return false; 210 return false;
209 211
210 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 212 v8::Isolate* isolate = v8::Isolate::GetCurrent();
211 213
212 V8NPObject* v8NpObject = npObjectToV8NPObject(npObject); 214 V8NPObject* v8NpObject = npObjectToV8NPObject(npObject);
213 if (!v8NpObject) { 215 if (!v8NpObject) {
214 if (npObject->_class->invoke) 216 if (npObject->_class->invoke)
215 return npObject->_class->invoke(npObject, methodName, arguments, arg umentCount, result); 217 return npObject->_class->invoke(npObject, methodName, arguments, arg umentCount, result);
216 218
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 if (resultObject.IsEmpty()) 264 if (resultObject.IsEmpty())
263 return false; 265 return false;
264 266
265 convertV8ObjectToNPVariant(resultObject, npObject, result, isolate); 267 convertV8ObjectToNPVariant(resultObject, npObject, result, isolate);
266 return true; 268 return true;
267 } 269 }
268 270
269 // FIXME: Fix it same as _NPN_Invoke (HandleScope and such). 271 // FIXME: Fix it same as _NPN_Invoke (HandleScope and such).
270 bool _NPN_InvokeDefault(NPP npp, NPObject* npObject, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result) 272 bool _NPN_InvokeDefault(NPP npp, NPObject* npObject, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
271 { 273 {
274 ScriptForbiddenScope::AllowSuperUnsafeScript thisShouldBeRemoved;
275
272 if (!npObject) 276 if (!npObject)
273 return false; 277 return false;
274 278
275 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 279 v8::Isolate* isolate = v8::Isolate::GetCurrent();
276 280
277 V8NPObject* v8NpObject = npObjectToV8NPObject(npObject); 281 V8NPObject* v8NpObject = npObjectToV8NPObject(npObject);
278 if (!v8NpObject) { 282 if (!v8NpObject) {
279 if (npObject->_class->invokeDefault) 283 if (npObject->_class->invokeDefault)
280 return npObject->_class->invokeDefault(npObject, arguments, argument Count, result); 284 return npObject->_class->invokeDefault(npObject, arguments, argument Count, result);
281 285
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 321
318 bool _NPN_Evaluate(NPP npp, NPObject* npObject, NPString* npScript, NPVariant* r esult) 322 bool _NPN_Evaluate(NPP npp, NPObject* npObject, NPString* npScript, NPVariant* r esult)
319 { 323 {
320 // FIXME: Give the embedder a way to control this. 324 // FIXME: Give the embedder a way to control this.
321 bool popupsAllowed = false; 325 bool popupsAllowed = false;
322 return _NPN_EvaluateHelper(npp, popupsAllowed, npObject, npScript, result); 326 return _NPN_EvaluateHelper(npp, popupsAllowed, npObject, npScript, result);
323 } 327 }
324 328
325 bool _NPN_EvaluateHelper(NPP npp, bool popupsAllowed, NPObject* npObject, NPStri ng* npScript, NPVariant* result) 329 bool _NPN_EvaluateHelper(NPP npp, bool popupsAllowed, NPObject* npObject, NPStri ng* npScript, NPVariant* result)
326 { 330 {
331 ScriptForbiddenScope::AllowSuperUnsafeScript thisShouldBeRemoved;
332
327 VOID_TO_NPVARIANT(*result); 333 VOID_TO_NPVARIANT(*result);
328 if (!npObject) 334 if (!npObject)
329 return false; 335 return false;
330 336
331 V8NPObject* v8NpObject = npObjectToV8NPObject(npObject); 337 V8NPObject* v8NpObject = npObjectToV8NPObject(npObject);
332 if (!v8NpObject) 338 if (!v8NpObject)
333 return false; 339 return false;
334 340
335 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 341 v8::Isolate* isolate = v8::Isolate::GetCurrent();
336 ScriptState* scriptState = mainWorldScriptState(isolate, npp, npObject); 342 ScriptState* scriptState = mainWorldScriptState(isolate, npp, npObject);
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 600
595 convertV8ObjectToNPVariant(resultObject, npObject, result, isolate); 601 convertV8ObjectToNPVariant(resultObject, npObject, result, isolate);
596 return true; 602 return true;
597 } 603 }
598 604
599 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class-> construct) 605 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class-> construct)
600 return npObject->_class->construct(npObject, arguments, argumentCount, r esult); 606 return npObject->_class->construct(npObject, arguments, argumentCount, r esult);
601 607
602 return false; 608 return false;
603 } 609 }
OLDNEW
« no previous file with comments | « no previous file | Source/platform/ScriptForbiddenScope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698