Bug 111376 - Make AsyncFileReader work without ScriptExecutionContext
Summary: Make AsyncFileReader work without ScriptExecutionContext
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-04 16:11 PST by Alexey Proskuryakov
Modified: 2013-03-05 09:45 PST (History)
7 users (show)

See Also:


Attachments
proposed patch (46.68 KB, patch)
2013-03-04 16:38 PST, Alexey Proskuryakov
andersca: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
run it by EWS again (49.31 KB, patch)
2013-03-04 22:58 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>.