RESOLVED FIXED 61536
[Chromium] Add missing compile guards for WebWorkers in WebKit
https://bugs.webkit.org/show_bug.cgi?id=61536
Summary [Chromium] Add missing compile guards for WebWorkers in WebKit
Leandro Graciá Gil
Reported 2011-05-26 08:46:07 PDT
Some files in WebKit Chromium lack the appropriate #if ENABLED(WORKERS). This causes some files to fail when compiling if this feature is disabled.
Attachments
Patch (9.82 KB, patch)
2011-05-26 10:01 PDT, Leandro Graciá Gil
no flags
Patch (9.96 KB, patch)
2011-05-26 12:06 PDT, Leandro Graciá Gil
no flags
Patch (9.97 KB, patch)
2011-05-26 12:13 PDT, Leandro Graciá Gil
no flags
Patch (10.09 KB, patch)
2011-05-26 12:28 PDT, Leandro Graciá Gil
no flags
Leandro Graciá Gil
Comment 1 2011-05-26 10:01:05 PDT
Dmitry Titov
Comment 2 2011-05-26 11:22:30 PDT
Comment on attachment 94992 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=94992&action=review Great! Couple of comments, lets do another iteration: > Source/WebKit/chromium/src/DatabaseObserver.cpp:71 > + return false; Lets add ASSERT_NOT_REACHED() here, to document that we don't expect any other case but Document in this case. > Source/WebKit/chromium/src/LocalFileSystemChromium.cpp:101 > + allowed = false; Same as above, ASSERT_NOT_REACHED() could be useful here. > Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp:96 > + m_callbacks->didOpenFileSystem(name, AsyncFileSystemChromium::create(m_type, path)); This duplicates a line of code... By placing #if/#endif around if/else, it's possible to avoid that.
Leandro Graciá Gil
Comment 3 2011-05-26 11:38:05 PDT
Comment on attachment 94992 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=94992&action=review >> Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp:96 >> + m_callbacks->didOpenFileSystem(name, AsyncFileSystemChromium::create(m_type, path)); > > This duplicates a line of code... By placing #if/#endif around if/else, it's possible to avoid that. Yes, but it may introduce style errors in the bots that don't enable workers. If you think this is ok I'll be happy to fix it like you propose.
David Levin
Comment 4 2011-05-26 11:49:13 PDT
Comment on attachment 94992 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=94992&action=review >>> Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp:96 >>> + m_callbacks->didOpenFileSystem(name, AsyncFileSystemChromium::create(m_type, path)); >> >> This duplicates a line of code... By placing #if/#endif around if/else, it's possible to avoid that. > > Yes, but it may introduce style errors in the bots that don't enable workers. If you think this is ok I'll be happy to fix it like you propose. This could do OwnPtr<WebFileSystemCallbacksImpl> callbacks(this); #if if (m_context && m_context->isWorkerContext()) { m_callbacks->didOpenFileSystem(name, WorkerAsyncFileSystemChromium::create(m_context, m_type, path, m_synchronous)); return; } #endif m_callbacks->didOpenFileSystem(name, AsyncFileSystemChromium::create(m_type, path)); which addresses both issues.
Leandro Graciá Gil
Comment 5 2011-05-26 12:06:01 PDT
Leandro Graciá Gil
Comment 6 2011-05-26 12:08:50 PDT
Comment on attachment 94992 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=94992&action=review >> Source/WebKit/chromium/src/DatabaseObserver.cpp:71 >> + return false; > > Lets add ASSERT_NOT_REACHED() here, to document that we don't expect any other case but Document in this case. Fixed. >> Source/WebKit/chromium/src/LocalFileSystemChromium.cpp:101 >> + allowed = false; > > Same as above, ASSERT_NOT_REACHED() could be useful here. Fixed. >>>> Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp:96 >>>> + m_callbacks->didOpenFileSystem(name, AsyncFileSystemChromium::create(m_type, path)); >>> >>> This duplicates a line of code... By placing #if/#endif around if/else, it's possible to avoid that. >> >> Yes, but it may introduce style errors in the bots that don't enable workers. If you think this is ok I'll be happy to fix it like you propose. > > This could do > > OwnPtr<WebFileSystemCallbacksImpl> callbacks(this); > > #if > if (m_context && m_context->isWorkerContext()) { > m_callbacks->didOpenFileSystem(name, WorkerAsyncFileSystemChromium::create(m_context, m_type, path, m_synchronous)); > return; > } > #endif > m_callbacks->didOpenFileSystem(name, AsyncFileSystemChromium::create(m_type, path)); > > which addresses both issues. Thanks for the suggestion! Fixed. However I just realized a compile error here when uploading the patch. Give me a minute and I'll fix it.
Leandro Graciá Gil
Comment 7 2011-05-26 12:13:06 PDT
Created attachment 95018 [details] Patch Fixing build error caused for not using adoptPtr.
Dmitry Titov
Comment 8 2011-05-26 12:22:51 PDT
Comment on attachment 95018 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=95018&action=review One small thing: > Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp:99 > delete this; I think this 'delete' is not needed now since there is OwnPtr for 'this'... While at this, lets add a comment to the OwnPtr about this object self-deleting on exit, to make it more explicit.
Leandro Graciá Gil
Comment 9 2011-05-26 12:28:01 PDT
Created attachment 95020 [details] Patch Performing review fixes.
Leandro Graciá Gil
Comment 10 2011-05-26 12:28:26 PDT
Comment on attachment 95018 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=95018&action=review >> Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp:99 >> delete this; > > I think this 'delete' is not needed now since there is OwnPtr for 'this'... While at this, lets add a comment to the OwnPtr about this object self-deleting on exit, to make it more explicit. Done.
Dmitry Titov
Comment 11 2011-05-26 13:04:14 PDT
Comment on attachment 95020 [details] Patch You could just always do cq? with r? if you intend to use commit queue. Reviewer can flip both at one step if appropriate then.
Leandro Graciá Gil
Comment 12 2011-05-26 13:56:25 PDT
(In reply to comment #11) > (From update of attachment 95020 [details]) > You could just always do cq? with r? if you intend to use commit queue. Reviewer can flip both at one step if appropriate then. I will, at least once the code seems ready to pass. Thanks for the advice.
WebKit Commit Bot
Comment 13 2011-05-26 19:21:11 PDT
The commit-queue encountered the following flaky tests while processing attachment 95020 [details]: inspector/debugger/debugger-scripts.html bug 59921 (authors: pfeldman@chromium.org and podivilov@chromium.org) The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 14 2011-05-26 19:22:51 PDT
Comment on attachment 95020 [details] Patch Clearing flags on attachment: 95020 Committed r87463: <http://trac.webkit.org/changeset/87463>
WebKit Commit Bot
Comment 15 2011-05-26 19:22:57 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.