Changeset 37715 in webkit
- Timestamp:
- Oct 20, 2008, 2:24:30 AM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 6 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r37713 r37715 1 2008-10-20 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 https://bugs.webkit.org/show_bug.cgi?id=21705 6 Implement Web Workers client-side API 7 8 The implementation is experimental, and disabled by default. It doesn't quite match the 9 published draft, being influenced by further WHATWG discussions. 10 11 This only implements the client-side API, and does not actually create any threads or 12 global contexts yet. 13 14 * DerivedSources.make: Added DedicatedWorker. SharedWorker is not implemented yet, as I'm 15 still not sure if having separate classes for these helps at all. 16 17 * WebCore.xcodeproj/project.pbxproj: Added new files. 18 19 * bindings/js/JSDOMWindowBase.cpp: 20 (jsDOMWindowBaseWorker): 21 (WebCore::JSDOMWindowBase::put): 22 (setJSDOMWindowBaseWorker): 23 Added window.Worker constructor. Moved JSXSLTProcessorConstructor.h include out of ifdef 24 to match prevailing style. 25 26 * bindings/js/JSDedicatedWorkerConstructor.cpp: Added. 27 * bindings/js/JSDedicatedWorkerConstructor.h: Added. 28 * bindings/js/JSDedicatedWorkerCustom.cpp: Added. 29 The implementation of event listeners are left custom intentionally, for easier implementation 30 of listeners that are not tied to any Document in the future. 31 32 * dom/DedicatedWorker.cpp: Added. 33 * dom/DedicatedWorker.h: Added. 34 * dom/DedicatedWorker.idl: Added. 35 Added an implementation that can only load requested scripts for now. 36 1 37 2008-10-19 Darin Adler <darin@apple.com> 2 38 -
trunk/WebCore/DerivedSources.make
r37435 r37715 78 78 DOMSelection \ 79 79 DOMWindow \ 80 DedicatedWorker \ 80 81 Database \ 81 82 Document \ -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r37662 r37715 4160 4160 E1C4DE690EA75C1E0023CCD6 /* ActiveDOMObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C4DE680EA75C1E0023CCD6 /* ActiveDOMObject.h */; }; 4161 4161 E1C4DE6E0EA75C650023CCD6 /* ActiveDOMObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */; }; 4162 E1C8BE5D0E8BD15A0064CB7D /* JSDedicatedWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C8BE5C0E8BD15A0064CB7D /* JSDedicatedWorker.cpp */; }; 4163 E1CA5CA00E8CD73B00E8EF90 /* DedicatedWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CA5C9F0E8CD73B00E8EF90 /* DedicatedWorker.h */; }; 4164 E1CA5CA50E8CD78500E8EF90 /* DedicatedWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1CA5CA40E8CD78500E8EF90 /* DedicatedWorker.cpp */; }; 4165 E1CA5CBC0E8CDCAF00E8EF90 /* JSDedicatedWorkerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1CA5CBB0E8CDCAF00E8EF90 /* JSDedicatedWorkerCustom.cpp */; }; 4166 E1CA5CD30E8CDE8000E8EF90 /* JSDedicatedWorkerConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CA5CD20E8CDE8000E8EF90 /* JSDedicatedWorkerConstructor.h */; }; 4167 E1CA5CD60E8CDEE900E8EF90 /* JSDedicatedWorkerConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1CA5CD50E8CDEE900E8EF90 /* JSDedicatedWorkerConstructor.cpp */; }; 4168 E1CAA5C60E8BD23600A73ECA /* JSDedicatedWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CAA5C50E8BD23600A73ECA /* JSDedicatedWorker.h */; }; 4162 4169 E1E6EEA40B628DA8005F2F70 /* JSHTMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1E6EEA30B628DA8005F2F70 /* JSHTMLSelectElement.cpp */; }; 4163 4170 E1E6EEA80B628DB3005F2F70 /* JSHTMLSelectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E6EEA70B628DB3005F2F70 /* JSHTMLSelectElement.h */; }; … … 8734 8741 E1C4DE680EA75C1E0023CCD6 /* ActiveDOMObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActiveDOMObject.h; sourceTree = "<group>"; }; 8735 8742 E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActiveDOMObject.cpp; sourceTree = "<group>"; }; 8743 E1C8BE440E8BCCBB0064CB7D /* DedicatedWorker.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DedicatedWorker.idl; sourceTree = "<group>"; }; 8744 E1C8BE5C0E8BD15A0064CB7D /* JSDedicatedWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDedicatedWorker.cpp; sourceTree = "<group>"; }; 8745 E1CA5C9F0E8CD73B00E8EF90 /* DedicatedWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DedicatedWorker.h; sourceTree = "<group>"; }; 8746 E1CA5CA40E8CD78500E8EF90 /* DedicatedWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DedicatedWorker.cpp; sourceTree = "<group>"; }; 8747 E1CA5CBB0E8CDCAF00E8EF90 /* JSDedicatedWorkerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDedicatedWorkerCustom.cpp; sourceTree = "<group>"; }; 8748 E1CA5CD20E8CDE8000E8EF90 /* JSDedicatedWorkerConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDedicatedWorkerConstructor.h; sourceTree = "<group>"; }; 8749 E1CA5CD50E8CDEE900E8EF90 /* JSDedicatedWorkerConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDedicatedWorkerConstructor.cpp; sourceTree = "<group>"; }; 8750 E1CAA5C50E8BD23600A73ECA /* JSDedicatedWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDedicatedWorker.h; sourceTree = "<group>"; }; 8736 8751 E1E6EEA30B628DA8005F2F70 /* JSHTMLSelectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLSelectElement.cpp; sourceTree = "<group>"; }; 8737 8752 E1E6EEA70B628DB3005F2F70 /* JSHTMLSelectElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JSHTMLSelectElement.h; sourceTree = "<group>"; }; … … 8983 8998 A83B79150CCB0078000B0825 /* Storage */, 8984 8999 A83B790A0CCAFF47000B0825 /* SVG */, 9000 E1C8BE4B0E8BD0D10064CB7D /* Threads */, 8985 9001 BC9854530CD3DA8F00069BC1 /* Traversal */, 8986 9002 BC9854430CD3D9D000069BC1 /* Window */, … … 12859 12875 1A3417C70CECFF250049CBDE /* JSCustomVoidCallback.h */, 12860 12876 1AE830420CAB0ED1002237AE /* JSDatabaseCustom.cpp */, 12877 E1CA5CD20E8CDE8000E8EF90 /* JSDedicatedWorkerConstructor.h */, 12878 E1CA5CD50E8CDEE900E8EF90 /* JSDedicatedWorkerConstructor.cpp */, 12879 E1CA5CBB0E8CDCAF00E8EF90 /* JSDedicatedWorkerCustom.cpp */, 12861 12880 929264760B61FC7200B41D34 /* JSDocumentCustom.cpp */, 12862 12881 BC1DEA4E0E268EB60083A73F /* JSDocumentFragmentCustom.cpp */, … … 13225 13244 tabWidth = 4; 13226 13245 usesTabs = 0; 13246 }; 13247 E1C8BE4B0E8BD0D10064CB7D /* Threads */ = { 13248 isa = PBXGroup; 13249 children = ( 13250 E1C8BE5C0E8BD15A0064CB7D /* JSDedicatedWorker.cpp */, 13251 E1CAA5C50E8BD23600A73ECA /* JSDedicatedWorker.h */, 13252 ); 13253 name = Threads; 13254 sourceTree = "<group>"; 13227 13255 }; 13228 13256 E1F0424309839389006694EA /* xml */ = { … … 13725 13753 A8C4A7F809D563270003AC8D /* CSSMappedAttributeDeclaration.cpp */, 13726 13754 A8C4A7F709D563270003AC8D /* CSSMappedAttributeDeclaration.h */, 13755 E1CA5CA40E8CD78500E8EF90 /* DedicatedWorker.cpp */, 13756 E1CA5C9F0E8CD73B00E8EF90 /* DedicatedWorker.h */, 13757 E1C8BE440E8BCCBB0064CB7D /* DedicatedWorker.idl */, 13727 13758 93EEC1E709C2877700C515D1 /* DocPtr.h */, 13728 13759 A8185F3409765765005826D9 /* Document.cpp */, … … 15979 16010 A8CB413E0E8633FD0032C4F0 /* DashArray.h in Headers */, 15980 16011 930B3BE20E884921009770C5 /* JSCanvasPixelArrayCustom.h in Headers */, 16012 E1CAA5C60E8BD23600A73ECA /* JSDedicatedWorker.h in Headers */, 15981 16013 BCF937E70E8B2E95005C7AB7 /* JSDOMWindowBase.lut.h in Headers */, 15982 16014 63F5D4F70E8C4B7100C0BD04 /* ElementRareData.h in Headers */, 16015 E1CA5CA00E8CD73B00E8EF90 /* DedicatedWorker.h in Headers */, 16016 E1CA5CD30E8CDE8000E8EF90 /* JSDedicatedWorkerConstructor.h in Headers */, 15983 16017 BC3B7AF40E919CA900D54065 /* JSEventTargetNode.h in Headers */, 15984 16018 BC60901F0E91B8EC000C68B5 /* JSEventTarget.h in Headers */, … … 17855 17889 BCC438780E886CC700533DD5 /* JSHTMLInputElementCustom.cpp in Sources */, 17856 17890 BC2441C40E8B65D00055320F /* ScrollView.cpp in Sources */, 17891 E1C8BE5D0E8BD15A0064CB7D /* JSDedicatedWorker.cpp in Sources */, 17892 E1CA5CA50E8CD78500E8EF90 /* DedicatedWorker.cpp in Sources */, 17893 E1CA5CBC0E8CDCAF00E8EF90 /* JSDedicatedWorkerCustom.cpp in Sources */, 17894 E1CA5CD60E8CDEE900E8EF90 /* JSDedicatedWorkerConstructor.cpp in Sources */, 17857 17895 BC3B7AF30E919CA900D54065 /* JSEventTargetNode.cpp in Sources */, 17858 17896 BC3B7B210E91AAF400D54065 /* JSEventTargetNodeCustom.cpp in Sources */, -
trunk/WebCore/bindings/js/JSDOMWindowBase.cpp
r37705 r37715 39 39 #include "HTMLDocument.h" 40 40 #include "JSAudioConstructor.h" 41 #include "JSDedicatedWorkerConstructor.h" 41 42 #include "JSDOMWindowCustom.h" 42 43 #include "JSEvent.h" … … 48 49 #include "JSNode.h" 49 50 #include "JSXMLHttpRequestConstructor.h" 51 #include "JSXSLTProcessorConstructor.h" 50 52 #include "Logging.h" 51 53 #include "MediaPlayer.h" … … 66 68 #include <wtf/MathExtras.h> 67 69 68 #if ENABLE(XSLT)69 #include "JSXSLTProcessorConstructor.h"70 #endif71 72 70 using namespace JSC; 73 71 … … 87 85 static JSValuePtr jsDOMWindowBaseMessageChannel(ExecState*, const Identifier&, const PropertySlot&); 88 86 static void setJSDOMWindowBaseMessageChannel(ExecState*, JSObject*, JSValuePtr); 87 static JSValuePtr jsDOMWindowBaseWorker(ExecState*, const Identifier&, const PropertySlot&); 88 static void setJSDOMWindowBaseWorker(ExecState*, JSObject*, JSValuePtr); 89 89 static JSValuePtr jsDOMWindowBaseOption(ExecState*, const Identifier&, const PropertySlot&); 90 90 static void setJSDOMWindowBaseOption(ExecState*, JSObject*, JSValuePtr); … … 159 159 MessageChannel jsDOMWindowBaseMessageChannel DontDelete 160 160 Option jsDOMWindowBaseOption DontDelete 161 Worker jsDOMWindowBaseWorker DontDelete 161 162 XMLHttpRequest jsDOMWindowBaseXMLHttpRequest DontDelete 162 163 XSLTProcessor jsDOMWindowBaseXSLTProcessor DontDelete … … 471 472 } 472 473 474 JSValuePtr jsDOMWindowBaseWorker(ExecState* exec, const Identifier&, const PropertySlot& slot) 475 { 476 #if ENABLE(WORKERS) 477 if (!static_cast<JSDOMWindowBase*>(asObject(slot.slotBase()))->allowsAccessFrom(exec)) 478 return jsUndefined(); 479 return getDOMConstructor<JSDedicatedWorkerConstructor>(exec); 480 #else 481 return jsUndefined(); 482 #endif 483 } 484 473 485 JSValuePtr jsDOMWindowBaseXSLTProcessor(ExecState* exec, const Identifier&, const PropertySlot& slot) 474 486 { … … 603 615 || entry->propertyPutter() == setJSDOMWindowBaseOption 604 616 || entry->propertyPutter() == setJSDOMWindowBaseMessageChannel 617 || entry->propertyPutter() == setJSDOMWindowBaseWorker 605 618 || entry->propertyPutter() == setJSDOMWindowBaseXMLHttpRequest 606 619 || entry->propertyPutter() == setJSDOMWindowBaseXSLTProcessor)) { … … 637 650 638 651 void setJSDOMWindowBaseOption(ExecState*, JSObject*, JSValuePtr) 652 { 653 ASSERT_NOT_REACHED(); 654 } 655 656 void setJSDOMWindowBaseWorker(ExecState*, JSObject*, JSValuePtr) 639 657 { 640 658 ASSERT_NOT_REACHED();
Note:
See TracChangeset
for help on using the changeset viewer.