Bug 111376

Summary: Make AsyncFileReader work without ScriptExecutionContext
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: PlatformAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, esprehn+autocc, japhet, levin+threading, ojan.autocc, rniwa, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch
andersca: review+, buildbot: commit-queue-
run it by EWS again none

Description Alexey Proskuryakov 2013-03-04 16:11:57 PST
It's way lower level than that, and relying on ScriptExecutionContext prevents using AsyncFileReader in NetworkProcess.
Comment 1 Alexey Proskuryakov 2013-03-04 16:38:13 PST
Created attachment 191346 [details]
proposed patch
Comment 2 WebKit Review Bot 2013-03-04 16:40:16 PST
Attachment 191346 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/WebCore.xcodeproj/project.pbxproj', u'Source/WebCore/dom/ScriptExecutionContext.cpp', u'Source/WebCore/dom/ScriptExecutionContext.h', u'Source/WebCore/fileapi/AsyncFileStream.cpp', u'Source/WebCore/fileapi/AsyncFileStream.h', u'Source/WebCore/loader/ResourceLoader.cpp', u'Source/WebCore/loader/ResourceLoader.h', u'Source/WebCore/platform/MainThreadTask.h', u'Source/WebCore/platform/network/BlobResourceHandle.cpp', u'Source/WebCore/platform/network/ResourceHandleClient.h', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp', u'Source/WebKit2/NetworkProcess/NetworkResourceLoader.h']" exit_code: 1
Source/WebCore/platform/MainThreadTask.h:484:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/platform/MainThreadTask.h:485:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/platform/MainThreadTask.h:486:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/platform/MainThreadTask.h:487:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/platform/MainThreadTask.h:488:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 5 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Anders Carlsson 2013-03-04 16:47:42 PST
Comment on attachment 191346 [details]
proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=191346&action=review

Instead of adding MainThreadTask, I think you should use something more like WTF::Function from Functional.h - I don’t think that blocks landing this though.

> Source/WebCore/fileapi/AsyncFileStream.cpp:54
> +    return thread;

return thread.release(); (Not that it matters :)
Comment 4 Build Bot 2013-03-04 18:00:04 PST
Comment on attachment 191346 [details]
proposed patch

Attachment 191346 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-commit-queue.appspot.com/results/16937010
Comment 5 Build Bot 2013-03-04 19:13:28 PST
Comment on attachment 191346 [details]
proposed patch

Attachment 191346 [details] did not pass mac-ews (mac):
Output: http://webkit-commit-queue.appspot.com/results/16969103
Comment 6 Build Bot 2013-03-04 20:20:46 PST
Comment on attachment 191346 [details]
proposed patch

Attachment 191346 [details] did not pass mac-ews (mac):
Output: http://webkit-commit-queue.appspot.com/results/16996009
Comment 7 Alexey Proskuryakov 2013-03-04 22:58:45 PST
Created attachment 191406 [details]
run it by EWS again

With a build fix.

> Instead of adding MainThreadTask, I think you should use something more like WTF::Function from Functional.h - I don’t think that blocks landing this though.

We'll need to come up with a way to use something like CrossThreadCopier with Functional to replace this.
Comment 8 WebKit Review Bot 2013-03-04 23:02:17 PST
Attachment 191406 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/GNUmakefile.list.am', u'Source/WebCore/Target.pri', u'Source/WebCore/WebCore.vcproj/WebCore.vcproj', u'Source/WebCore/WebCore.vcxproj/WebCore.vcxproj', u'Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters', u'Source/WebCore/WebCore.xcodeproj/project.pbxproj', u'Source/WebCore/dom/ScriptExecutionContext.cpp', u'Source/WebCore/dom/ScriptExecutionContext.h', u'Source/WebCore/fileapi/AsyncFileStream.cpp', u'Source/WebCore/fileapi/AsyncFileStream.h', u'Source/WebCore/loader/ResourceLoader.cpp', u'Source/WebCore/loader/ResourceLoader.h', u'Source/WebCore/platform/MainThreadTask.h', u'Source/WebCore/platform/network/BlobResourceHandle.cpp', u'Source/WebCore/platform/network/ResourceHandleClient.h', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp', u'Source/WebKit2/NetworkProcess/NetworkResourceLoader.h']" exit_code: 1
Source/WebCore/platform/MainThreadTask.h:484:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/platform/MainThreadTask.h:485:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/platform/MainThreadTask.h:486:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/platform/MainThreadTask.h:487:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebCore/platform/MainThreadTask.h:488:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 5 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Alexey Proskuryakov 2013-03-05 09:45:04 PST
Committed <http://trac.webkit.org/changeset/144770>.