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

Side by Side Diff: Source/WebKit/chromium/src/WebFrameImpl.cpp

Issue 13954010: Eliminate "temporary" and "uninitialized" isolated worlds (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 void WebFrameImpl::executeScript(const WebScriptSource& source) 783 void WebFrameImpl::executeScript(const WebScriptSource& source)
784 { 784 {
785 ASSERT(frame()); 785 ASSERT(frame());
786 TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), Ordi nalNumber::first()); 786 TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), Ordi nalNumber::first());
787 frame()->script()->executeScript(ScriptSourceCode(source.code, source.url, p osition)); 787 frame()->script()->executeScript(ScriptSourceCode(source.code, source.url, p osition));
788 } 788 }
789 789
790 void WebFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSour ce* sourcesIn, unsigned numSources, int extensionGroup) 790 void WebFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSour ce* sourcesIn, unsigned numSources, int extensionGroup)
791 { 791 {
792 ASSERT(frame()); 792 ASSERT(frame());
793 ASSERT(worldID > 0);
793 794
794 Vector<ScriptSourceCode> sources; 795 Vector<ScriptSourceCode> sources;
795 for (unsigned i = 0; i < numSources; ++i) { 796 for (unsigned i = 0; i < numSources; ++i) {
796 TextPosition position(OrdinalNumber::fromOneBasedInt(sourcesIn[i].startL ine), OrdinalNumber::first()); 797 TextPosition position(OrdinalNumber::fromOneBasedInt(sourcesIn[i].startL ine), OrdinalNumber::first());
797 sources.append(ScriptSourceCode(sourcesIn[i].code, sourcesIn[i].url, pos ition)); 798 sources.append(ScriptSourceCode(sourcesIn[i].code, sourcesIn[i].url, pos ition));
798 } 799 }
799 800
800 frame()->script()->evaluateInIsolatedWorld(worldID, sources, extensionGroup, 0); 801 frame()->script()->evaluateInIsolatedWorld(worldID, sources, extensionGroup, 0);
801 } 802 }
802 803
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 // http://code.google.com/p/chromium/issues/detail?id=86397 864 // http://code.google.com/p/chromium/issues/detail?id=86397
864 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); 865 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
865 866
866 TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), Ordi nalNumber::first()); 867 TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), Ordi nalNumber::first());
867 return frame()->script()->executeScript(ScriptSourceCode(source.code, source .url, position)).v8Value(); 868 return frame()->script()->executeScript(ScriptSourceCode(source.code, source .url, position)).v8Value();
868 } 869 }
869 870
870 void WebFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSour ce* sourcesIn, unsigned numSources, int extensionGroup, WebVector<v8::Local<v8:: Value> >* results) 871 void WebFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSour ce* sourcesIn, unsigned numSources, int extensionGroup, WebVector<v8::Local<v8:: Value> >* results)
871 { 872 {
872 ASSERT(frame()); 873 ASSERT(frame());
874 ASSERT(worldID > 0);
873 875
874 Vector<ScriptSourceCode> sources; 876 Vector<ScriptSourceCode> sources;
875 877
876 for (unsigned i = 0; i < numSources; ++i) { 878 for (unsigned i = 0; i < numSources; ++i) {
877 TextPosition position(OrdinalNumber::fromOneBasedInt(sourcesIn[i].startL ine), OrdinalNumber::first()); 879 TextPosition position(OrdinalNumber::fromOneBasedInt(sourcesIn[i].startL ine), OrdinalNumber::first());
878 sources.append(ScriptSourceCode(sourcesIn[i].code, sourcesIn[i].url, pos ition)); 880 sources.append(ScriptSourceCode(sourcesIn[i].code, sourcesIn[i].url, pos ition));
879 } 881 }
880 882
881 if (results) { 883 if (results) {
882 Vector<ScriptValue> scriptResults; 884 Vector<ScriptValue> scriptResults;
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
2496 2498
2497 // There is a possibility that the frame being detached was the only 2499 // There is a possibility that the frame being detached was the only
2498 // pending one. We need to make sure final replies can be sent. 2500 // pending one. We need to make sure final replies can be sent.
2499 flushCurrentScopingEffort(m_findRequestIdentifier); 2501 flushCurrentScopingEffort(m_findRequestIdentifier);
2500 2502
2501 cancelPendingScopingEffort(); 2503 cancelPendingScopingEffort();
2502 } 2504 }
2503 } 2505 }
2504 2506
2505 } // namespace WebKit 2507 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698