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 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 for (unsigned i = 0; i < numSources; ++i) { | 850 for (unsigned i = 0; i < numSources; ++i) { |
851 TextPosition position(OrdinalNumber::fromOneBasedInt(sourcesIn[i].startL
ine), OrdinalNumber::first()); | 851 TextPosition position(OrdinalNumber::fromOneBasedInt(sourcesIn[i].startL
ine), OrdinalNumber::first()); |
852 sources.append(ScriptSourceCode(sourcesIn[i].code, sourcesIn[i].url, pos
ition)); | 852 sources.append(ScriptSourceCode(sourcesIn[i].code, sourcesIn[i].url, pos
ition)); |
853 } | 853 } |
854 | 854 |
855 if (results) { | 855 if (results) { |
856 Vector<ScriptValue> scriptResults; | 856 Vector<ScriptValue> scriptResults; |
857 frame()->script()->executeScriptInIsolatedWorld(worldID, sources, extens
ionGroup, &scriptResults); | 857 frame()->script()->executeScriptInIsolatedWorld(worldID, sources, extens
ionGroup, &scriptResults); |
858 WebVector<v8::Local<v8::Value> > v8Results(scriptResults.size()); | 858 WebVector<v8::Local<v8::Value> > v8Results(scriptResults.size()); |
859 for (unsigned i = 0; i < scriptResults.size(); i++) | 859 for (unsigned i = 0; i < scriptResults.size(); i++) |
860 v8Results[i] = v8::Local<v8::Value>::New(isolateForFrame(frame()), s
criptResults[i].v8Value()); | 860 v8Results[i] = v8::Local<v8::Value>::New(toIsolate(frame()), scriptR
esults[i].v8Value()); |
861 results->swap(v8Results); | 861 results->swap(v8Results); |
862 } else | 862 } else |
863 frame()->script()->executeScriptInIsolatedWorld(worldID, sources, extens
ionGroup, 0); | 863 frame()->script()->executeScriptInIsolatedWorld(worldID, sources, extens
ionGroup, 0); |
864 } | 864 } |
865 | 865 |
866 v8::Handle<v8::Value> WebFrameImpl::callFunctionEvenIfScriptDisabled(v8::Handle<
v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8
::Value> argv[]) | 866 v8::Handle<v8::Value> WebFrameImpl::callFunctionEvenIfScriptDisabled(v8::Handle<
v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8
::Value> argv[]) |
867 { | 867 { |
868 ASSERT(frame()); | 868 ASSERT(frame()); |
869 return frame()->script()->callFunctionEvenIfScriptDisabled(function, receive
r, argc, argv).v8Value(); | 869 return frame()->script()->callFunctionEvenIfScriptDisabled(function, receive
r, argc, argv).v8Value(); |
870 } | 870 } |
871 | 871 |
872 v8::Local<v8::Context> WebFrameImpl::mainWorldScriptContext() const | 872 v8::Local<v8::Context> WebFrameImpl::mainWorldScriptContext() const |
873 { | 873 { |
874 if (!frame()) | 874 if (!frame()) |
875 return v8::Local<v8::Context>(); | 875 return v8::Local<v8::Context>(); |
876 return ScriptController::mainWorldContext(frame()); | 876 return ScriptController::mainWorldContext(frame()); |
877 } | 877 } |
878 | 878 |
879 v8::Handle<v8::Value> WebFrameImpl::createFileSystem(WebFileSystemType type, con
st WebString& name, const WebString& path) | 879 v8::Handle<v8::Value> WebFrameImpl::createFileSystem(WebFileSystemType type, con
st WebString& name, const WebString& path) |
880 { | 880 { |
881 ASSERT(frame()); | 881 ASSERT(frame()); |
882 return toV8(DOMFileSystem::create(frame()->document(), name, static_cast<Web
Core::FileSystemType>(type), KURL(ParsedURLString, path.utf8().data())), v8::Han
dle<v8::Object>(), isolateForFrame(frame())); | 882 return toV8(DOMFileSystem::create(frame()->document(), name, static_cast<Web
Core::FileSystemType>(type), KURL(ParsedURLString, path.utf8().data())), v8::Han
dle<v8::Object>(), toIsolate(frame())); |
883 } | 883 } |
884 | 884 |
885 v8::Handle<v8::Value> WebFrameImpl::createSerializableFileSystem(WebFileSystemTy
pe type, const WebString& name, const WebString& path) | 885 v8::Handle<v8::Value> WebFrameImpl::createSerializableFileSystem(WebFileSystemTy
pe type, const WebString& name, const WebString& path) |
886 { | 886 { |
887 ASSERT(frame()); | 887 ASSERT(frame()); |
888 RefPtr<DOMFileSystem> fileSystem = DOMFileSystem::create(frame()->document()
, name, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURLString, path.u
tf8().data())); | 888 RefPtr<DOMFileSystem> fileSystem = DOMFileSystem::create(frame()->document()
, name, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURLString, path.u
tf8().data())); |
889 fileSystem->makeClonable(); | 889 fileSystem->makeClonable(); |
890 return toV8(fileSystem.release(), v8::Handle<v8::Object>(), isolateForFrame(
frame())); | 890 return toV8(fileSystem.release(), v8::Handle<v8::Object>(), toIsolate(frame(
))); |
891 } | 891 } |
892 | 892 |
893 v8::Handle<v8::Value> WebFrameImpl::createFileEntry(WebFileSystemType type, cons
t WebString& fileSystemName, const WebString& fileSystemPath, const WebString& f
ilePath, bool isDirectory) | 893 v8::Handle<v8::Value> WebFrameImpl::createFileEntry(WebFileSystemType type, cons
t WebString& fileSystemName, const WebString& fileSystemPath, const WebString& f
ilePath, bool isDirectory) |
894 { | 894 { |
895 ASSERT(frame()); | 895 ASSERT(frame()); |
896 | 896 |
897 RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->docume
nt(), fileSystemName, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURL
String, fileSystemPath.utf8().data())); | 897 RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->docume
nt(), fileSystemName, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURL
String, fileSystemPath.utf8().data())); |
898 if (isDirectory) | 898 if (isDirectory) |
899 return toV8(DirectoryEntry::create(fileSystem, filePath), v8::Handle<v8:
:Object>(), isolateForFrame(frame())); | 899 return toV8(DirectoryEntry::create(fileSystem, filePath), v8::Handle<v8:
:Object>(), toIsolate(frame())); |
900 return toV8(FileEntry::create(fileSystem, filePath), v8::Handle<v8::Object>(
), isolateForFrame(frame())); | 900 return toV8(FileEntry::create(fileSystem, filePath), v8::Handle<v8::Object>(
), toIsolate(frame())); |
901 } | 901 } |
902 | 902 |
903 void WebFrameImpl::reload(bool ignoreCache) | 903 void WebFrameImpl::reload(bool ignoreCache) |
904 { | 904 { |
905 ASSERT(frame()); | 905 ASSERT(frame()); |
906 frame()->loader()->reload(ignoreCache ? EndToEndReload : NormalReload); | 906 frame()->loader()->reload(ignoreCache ? EndToEndReload : NormalReload); |
907 } | 907 } |
908 | 908 |
909 void WebFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl, bool ignoreC
ache) | 909 void WebFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl, bool ignoreC
ache) |
910 { | 910 { |
(...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2476 | 2476 |
2477 // There is a possibility that the frame being detached was the only | 2477 // There is a possibility that the frame being detached was the only |
2478 // pending one. We need to make sure final replies can be sent. | 2478 // pending one. We need to make sure final replies can be sent. |
2479 flushCurrentScopingEffort(m_findRequestIdentifier); | 2479 flushCurrentScopingEffort(m_findRequestIdentifier); |
2480 | 2480 |
2481 cancelPendingScopingEffort(); | 2481 cancelPendingScopingEffort(); |
2482 } | 2482 } |
2483 } | 2483 } |
2484 | 2484 |
2485 } // namespace WebKit | 2485 } // namespace WebKit |
OLD | NEW |