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

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

Issue 834203003: Revert of Revert of Revert of Reland factor out window proxy management (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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
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 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
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 22 matching lines...) Expand all
33 #include "bindings/core/v8/V8Binding.h" 33 #include "bindings/core/v8/V8Binding.h"
34 #include "bindings/core/v8/V8GCController.h" 34 #include "bindings/core/v8/V8GCController.h"
35 #include "bindings/core/v8/V8NPUtils.h" 35 #include "bindings/core/v8/V8NPUtils.h"
36 #include "bindings/core/v8/V8ObjectConstructor.h" 36 #include "bindings/core/v8/V8ObjectConstructor.h"
37 #include "bindings/core/v8/V8ScriptRunner.h" 37 #include "bindings/core/v8/V8ScriptRunner.h"
38 #include "bindings/core/v8/WrapperTypeInfo.h" 38 #include "bindings/core/v8/WrapperTypeInfo.h"
39 #include "bindings/core/v8/npruntime_impl.h" 39 #include "bindings/core/v8/npruntime_impl.h"
40 #include "bindings/core/v8/npruntime_priv.h" 40 #include "bindings/core/v8/npruntime_priv.h"
41 #include "core/frame/LocalDOMWindow.h" 41 #include "core/frame/LocalDOMWindow.h"
42 #include "core/frame/LocalFrame.h" 42 #include "core/frame/LocalFrame.h"
43 #include "platform/ScriptForbiddenScope.h"
44 #include "platform/UserGestureIndicator.h" 43 #include "platform/UserGestureIndicator.h"
45 #include "wtf/OwnPtr.h" 44 #include "wtf/OwnPtr.h"
46 #include "wtf/StringExtras.h" 45 #include "wtf/StringExtras.h"
47 #include "wtf/text/WTFString.h" 46 #include "wtf/text/WTFString.h"
48 #include <stdio.h> 47 #include <stdio.h>
49 48
50 using namespace blink; 49 using namespace blink;
51 50
52 namespace blink { 51 namespace blink {
53 52
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 bool _NPN_Evaluate(NPP npp, NPObject* npObject, NPString* npScript, NPVariant* r esult) 335 bool _NPN_Evaluate(NPP npp, NPObject* npObject, NPString* npScript, NPVariant* r esult)
337 { 336 {
338 // FIXME: Give the embedder a way to control this. 337 // FIXME: Give the embedder a way to control this.
339 bool popupsAllowed = false; 338 bool popupsAllowed = false;
340 return _NPN_EvaluateHelper(npp, popupsAllowed, npObject, npScript, result); 339 return _NPN_EvaluateHelper(npp, popupsAllowed, npObject, npScript, result);
341 } 340 }
342 341
343 bool _NPN_EvaluateHelper(NPP npp, bool popupsAllowed, NPObject* npObject, NPStri ng* npScript, NPVariant* result) 342 bool _NPN_EvaluateHelper(NPP npp, bool popupsAllowed, NPObject* npObject, NPStri ng* npScript, NPVariant* result)
344 { 343 {
345 VOID_TO_NPVARIANT(*result); 344 VOID_TO_NPVARIANT(*result);
346 if (ScriptForbiddenScope::isScriptForbidden())
347 return false;
348
349 if (!npObject) 345 if (!npObject)
350 return false; 346 return false;
351 347
352 V8NPObject* v8NpObject = npObjectToV8NPObject(npObject); 348 V8NPObject* v8NpObject = npObjectToV8NPObject(npObject);
353 if (!v8NpObject) 349 if (!v8NpObject)
354 return false; 350 return false;
355 351
356 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 352 v8::Isolate* isolate = v8::Isolate::GetCurrent();
357 ScriptState* scriptState = mainWorldScriptState(isolate, npp, npObject); 353 ScriptState* scriptState = mainWorldScriptState(isolate, npp, npObject);
358 if (!scriptState) 354 if (!scriptState)
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 611
616 convertV8ObjectToNPVariant(isolate, resultObject, npObject, result); 612 convertV8ObjectToNPVariant(isolate, resultObject, npObject, result);
617 return true; 613 return true;
618 } 614 }
619 615
620 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class-> construct) 616 if (NP_CLASS_STRUCT_VERSION_HAS_CTOR(npObject->_class) && npObject->_class-> construct)
621 return npObject->_class->construct(npObject, arguments, argumentCount, r esult); 617 return npObject->_class->construct(npObject, arguments, argumentCount, r esult);
622 618
623 return false; 619 return false;
624 } 620 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/defaultView-on-detached-document-expected.txt ('k') | Source/bindings/core/v8/ScriptController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698