Bug 46430 - Platform specific ResourceResponse and ResourceRequest can't fully cross threads.
Summary: Platform specific ResourceResponse and ResourceRequest can't fully cross thre...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Michael Nordman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-23 16:49 PDT by Michael Nordman
Modified: 2010-09-30 00:51 PDT (History)
4 users (show)

See Also:


Attachments
crossThread patch (25.51 KB, patch)
2010-09-28 13:49 PDT, Michael Nordman
no flags Details | Formatted Diff | Diff
crossThread patch (25.53 KB, patch)
2010-09-28 13:56 PDT, Michael Nordman
levin: review+
levin: commit-queue-
Details | Formatted Diff | Diff
crossThread patch (25.45 KB, patch)
2010-09-28 16:13 PDT, Michael Nordman
levin: review-
Details | Formatted Diff | Diff
crossThread patch (25.70 KB, patch)
2010-09-28 16:48 PDT, Michael Nordman
levin: review+
commit-queue: commit-queue-
Details | Formatted Diff | Diff
crossThread patch (25.71 KB, patch)
2010-09-28 18:37 PDT, Michael Nordman
dumi: review+
commit-queue: commit-queue-
Details | Formatted Diff | Diff
crossThread patch (26.34 KB, patch)
2010-09-29 12:57 PDT, Michael Nordman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Nordman 2010-09-23 16:49:09 PDT
Platform specific ResourceResponse and ResourceRequest classes have no means to copy their data via across threads. The CrossThreadResourceRequestData and CrossThreadResourceResponseData structs are fully defined in common code as are the methods to copyData() and adopt(copiedData).
Comment 1 Michael Nordman 2010-09-28 13:49:35 PDT
Created attachment 69096 [details]
crossThread patch
Comment 2 Michael Nordman 2010-09-28 13:56:12 PDT
Created attachment 69098 [details]
crossThread patch

Fixed typos in the ChangeLog.
Comment 3 David Levin 2010-09-28 15:53:33 PDT
Comment on attachment 69098 [details]
crossThread patch

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

Awesome!

> WebCore/platform/network/ResourceRequestBase.h:143
> +        static bool compare(const ResourceRequest& a, const ResourceRequest& b);

When I see "compare", I think stpcmp and expect that 0 means equal. How about isSame or isEqual or equivalent, etc.? Ugh, I see ResourceResponse already has this. I still hate the name but consistency is good, so nevermind :(


Do this: omit "a" and "b" as they add no information. (Yes, ResourceResponseBase.h does the same thing but it is wrong and consistency here adds no value.)

> WebCore/platform/network/android/ResourceRequest.h:58
> +    void doPlatformAdopt(PassOwnPtr<CrossThreadResourceRequestData> data) { }

Omit data here or else you will get unused variable erros/warnings on some platforms (throughout).

> WebCore/platform/network/chromium/ResourceRequest.h:93
> +        PassOwnPtr<CrossThreadResourceRequestData> doPlatformCopyData(PassOwnPtr<CrossThreadResourceRequestData> data) const;

Omit param name "data" here as it adds no information.

> WebCore/platform/network/chromium/ResourceRequest.h:94
> +        void doPlatformAdopt(PassOwnPtr<CrossThreadResourceRequestData> data);

Ditto.
Comment 4 Michael Nordman 2010-09-28 16:13:41 PDT
Created attachment 69126 [details]
crossThread patch

Done... removed param names where possible.
Comment 5 David Levin 2010-09-28 16:47:43 PDT
Comment on attachment 69126 [details]
crossThread patch

Needs minor clean up of nits as discussed.
Comment 6 Michael Nordman 2010-09-28 16:48:03 PDT
Created attachment 69134 [details]
crossThread patch

Fixed a typo in the changeLog, removed param names from ResourceResponseBase::compare, deleted a blank line in ResourceResponseBase.cpp.
Comment 7 WebKit Commit Bot 2010-09-28 17:38:58 PDT
Comment on attachment 69134 [details]
crossThread patch

Rejecting patch 69134 from commit-queue.

Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', 'build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']" exit_code: 2
Building WebKit
Failed to run "['WebKitTools/Scripts/build-webkit', '--debug']" exit_code: 1

Full output: http://queues.webkit.org/results/4163008
Comment 8 Michael Nordman 2010-09-28 18:24:34 PDT
bumping heads with http://trac.webkit.org/changeset/68510?

i'll update my client
Comment 9 Michael Nordman 2010-09-28 18:37:00 PDT
Created attachment 69150 [details]
crossThread patch

updated my client and created a new patch
Comment 10 Dumitru Daniliuc 2010-09-28 20:32:52 PDT
Comment on attachment 69150 [details]
crossThread patch

rs=me, based on dave's r+.
Comment 11 WebKit Commit Bot 2010-09-28 21:00:46 PDT
Comment on attachment 69150 [details]
crossThread patch

Rejecting patch 69150 from commit-queue.

Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', 'build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']" exit_code: 2
Building WebKit
Failed to run "['WebKitTools/Scripts/build-webkit', '--debug']" exit_code: 1

Full output: http://queues.webkit.org/results/4202007
Comment 12 Michael Nordman 2010-09-28 21:14:09 PDT
(In reply to comment #11)
> (From update of attachment 69150 [details])
> Rejecting patch 69150 from commit-queue.
> 
> Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', 'build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']" exit_code: 2
> Building WebKit
> Failed to run "['WebKitTools/Scripts/build-webkit', '--debug']" exit_code: 1
> 
> Full output: http://queues.webkit.org/results/4202007

I guess that's not a merge conflict after all?
WebKitTools/Scripts/build-webkit fails

Looking...
Comment 13 Michael Nordman 2010-09-28 23:06:15 PDT
A link error on mac.

Ld /Users/michaeln/webkit/1/webkit/WebKitBuild/Release/WebCore.framework/Versions/A/WebCore normal i386
 .....
Undefined symbols:
  "__ZN7WebCoreeqERKNS_19ResourceRequestBaseES2_", referenced from:
     -exported_symbols_list command line option
ld: symbol(s) not found
collect2: ld returned 1 exit status
Comment 14 Michael Nordman 2010-09-28 23:34:23 PDT
Ok... need to delete a symbol in WebCore.exp.in
Comment 15 Michael Nordman 2010-09-29 12:57:30 PDT
Created attachment 69241 [details]
crossThread patch

removed the now inlined export from webcore.exp.in
Comment 16 WebKit Commit Bot 2010-09-30 00:51:13 PDT
Comment on attachment 69241 [details]
crossThread patch

Clearing flags on attachment: 69241

Committed r68762: <http://trac.webkit.org/changeset/68762>
Comment 17 WebKit Commit Bot 2010-09-30 00:51:19 PDT
All reviewed patches have been landed.  Closing bug.