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

Side by Side Diff: Source/bindings/scripts/code_generator_v8.pm

Issue 137953010: Remove isolatedWorldForEnteredContext() and isolatedWorldForIsolate() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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/bindings/tests/results/V8TestInterfaceDocument.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
5 # Copyright (C) 2006 Apple Computer, Inc. 5 # Copyright (C) 2006 Apple Computer, Inc.
6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc.
7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 # Copyright (C) 2012 Ericsson AB. All rights reserved. 10 # Copyright (C) 2012 Ericsson AB. All rights reserved.
(...skipping 3091 matching lines...) Expand 10 before | Expand all | Expand 10 after
3102 # If we're in an isolated world, create a SerializedScriptValue and 3102 # If we're in an isolated world, create a SerializedScriptValue and
3103 # store it in the event for later cloning if the property is accessed 3103 # store it in the event for later cloning if the property is accessed
3104 # from another world. 3104 # from another world.
3105 # The main world case is handled lazily (in Custom code). 3105 # The main world case is handled lazily (in Custom code).
3106 # 3106 #
3107 # We do not clone Error objects (exceptions), for 2 reasons: 3107 # We do not clone Error objects (exceptions), for 2 reasons:
3108 # 1) Errors carry a reference to the isolated world's global object, 3108 # 1) Errors carry a reference to the isolated world's global object,
3109 # and thus passing it around would cause leakage. 3109 # and thus passing it around would cause leakage.
3110 # 2) Errors cannot be cloned (or serialized): 3110 # 2) Errors cannot be cloned (or serialized):
3111 # http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom -interfaces.html#safe-passing-of-structured-data 3111 # http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom -interfaces.html#safe-passing-of-structured-data
3112 $implementation{nameSpaceInternal}->add(" if (isolatedWorldForIsolate (info.GetIsolate())) {\n"); 3112 $implementation{nameSpaceInternal}->add(" if (DOMWrapperWorld::curren t(info.GetIsolate())->isIsolatedWorld()) {\n");
3113 foreach my $attrName (@anyAttributeNames) { 3113 foreach my $attrName (@anyAttributeNames) {
3114 my $setter = "setSerialized" . FirstLetterToUpperCase($attrName); 3114 my $setter = "setSerialized" . FirstLetterToUpperCase($attrName);
3115 $implementation{nameSpaceInternal}->add(<<END); 3115 $implementation{nameSpaceInternal}->add(<<END);
3116 if (!${attrName}.IsEmpty()) 3116 if (!${attrName}.IsEmpty())
3117 event->${setter}(SerializedScriptValue::createAndSwallowExceptions($ {attrName}, info.GetIsolate())); 3117 event->${setter}(SerializedScriptValue::createAndSwallowExceptions($ {attrName}, info.GetIsolate()));
3118 END 3118 END
3119 } 3119 }
3120 $implementation{nameSpaceInternal}->add(" }\n\n"); 3120 $implementation{nameSpaceInternal}->add(" }\n\n");
3121 } 3121 }
3122 3122
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
5131 } 5131 }
5132 $code .= <<END; 5132 $code .= <<END;
5133 v8::Handle<v8::Object> wrapper = ${v8ClassName}::createWrapper(impl, creatio nContext, isolate); 5133 v8::Handle<v8::Object> wrapper = ${v8ClassName}::createWrapper(impl, creatio nContext, isolate);
5134 END 5134 END
5135 if ($isDocument) { 5135 if ($isDocument) {
5136 AddToImplIncludes("bindings/v8/ScriptController.h"); 5136 AddToImplIncludes("bindings/v8/ScriptController.h");
5137 AddToImplIncludes("bindings/v8/V8WindowShell.h"); 5137 AddToImplIncludes("bindings/v8/V8WindowShell.h");
5138 $code .= <<END; 5138 $code .= <<END;
5139 if (wrapper.IsEmpty()) 5139 if (wrapper.IsEmpty())
5140 return wrapper; 5140 return wrapper;
5141 if (!isolatedWorldForEnteredContext(isolate)) { 5141 DOMWrapperWorld* world = DOMWrapperWorld::current(isolate);
5142 if (world->isMainWorld()) {
5142 if (Frame* frame = impl->frame()) 5143 if (Frame* frame = impl->frame())
5143 frame->script().windowShell(DOMWrapperWorld::mainWorld())->updateDoc umentWrapper(wrapper); 5144 frame->script().windowShell(world)->updateDocumentWrapper(wrapper);
5144 } 5145 }
5145 END 5146 END
5146 } 5147 }
5147 $code .= <<END; 5148 $code .= <<END;
5148 return wrapper; 5149 return wrapper;
5149 } 5150 }
5150 5151
5151 END 5152 END
5152 $implementation{nameSpaceWebCore}->add($code); 5153 $implementation{nameSpaceWebCore}->add($code);
5153 } 5154 }
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
6491 if ($parameter->type eq "SerializedScriptValue") { 6492 if ($parameter->type eq "SerializedScriptValue") {
6492 return 1; 6493 return 1;
6493 } elsif (IsIntegerType($parameter->type)) { 6494 } elsif (IsIntegerType($parameter->type)) {
6494 return 1; 6495 return 1;
6495 } 6496 }
6496 } 6497 }
6497 return 0; 6498 return 0;
6498 } 6499 }
6499 6500
6500 1; 6501 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/tests/results/V8TestInterfaceDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698