OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |