We need to add SharedWorkerRepository::isAvailable(), and have window.SharedWorker === undefined when isAvailable returns false.
Created attachment 40156 [details] proposed patch V8 does not support custom getters for constructors yet, so this just turns on this functionality for JSC. V8 functionality will be added once https://bugs.webkit.org/show_bug.cgi?id=29758 is addressed
Comment on attachment 40156 [details] proposed patch Where is the code to make it return false? // Returns true if the platform supports SharedWorkers, otherwise false. 52 static bool isAvailable();
That will be in the platform specific implementation. Chromium will provide its own implementation of SharedWorkerRepository (it will not compile the default WebKit implementation in DefaultSharedWorkerRepository).
Comment on attachment 40156 [details] proposed patch Why wouldn't this be held off of Settings?
(In reply to comment #4) > (From update of attachment 40156 [details]) > Why wouldn't this be held off of Settings? Because it's not intended to be a user setting, and it doesn't make sense to pollute all platforms with extra settings when there's already a clear platform-specific interface to hang this off of. I'm basically doing the same thing that MediaPlayer::isAvailable() does, so there's ample precedent for putting it here.
Comment on attachment 40156 [details] proposed patch Looks good. Sorry it took me so long to look at this.
Comment on attachment 40156 [details] proposed patch Clearing flags on attachment: 40156 Committed r49130: <http://trac.webkit.org/changeset/49130>
All reviewed patches have been landed. Closing bug.
This is wrong. "SharedWorker" in window will still return true, and that is the way we encourage web developers to due feature detection.
(In reply to comment #9) > This is wrong. "SharedWorker" in window will still return true, and that is > the way we encourage web developers to due feature detection. I've logged two new bugs to track the issues Sam is concerned about, so I'm closing this bug. https://bugs.webkit.org/show_bug.cgi?id=30240 https://bugs.webkit.org/show_bug.cgi?id=30289