Bug 95040 - [chromium] Add CompositorSupport interface for constructing compositor classes
Summary: [chromium] Add CompositorSupport interface for constructing compositor classes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: James Robinson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-26 21:36 PDT by James Robinson
Modified: 2012-08-30 12:52 PDT (History)
8 users (show)

See Also:


Attachments
Patch (28.88 KB, patch)
2012-08-26 21:44 PDT, James Robinson
no flags Details | Formatted Diff | Diff
Patch (32.20 KB, patch)
2012-08-27 13:53 PDT, James Robinson
no flags Details | Formatted Diff | Diff
Remove default WebPassOwnPtr constructor, it's not useful without a copy ctor (32.14 KB, patch)
2012-08-27 14:45 PDT, James Robinson
no flags Details | Formatted Diff | Diff
Patch (32.82 KB, patch)
2012-08-27 17:10 PDT, James Robinson
no flags Details | Formatted Diff | Diff
consistent fallback behavior (32.95 KB, patch)
2012-08-29 16:15 PDT, James Robinson
no flags Details | Formatted Diff | Diff
add example of implementing in WebKit and using on chromium side (33.21 KB, patch)
2012-08-29 16:18 PDT, James Robinson
fishd: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Robinson 2012-08-26 21:36:41 PDT
[chromium] Add CompositorSupport interface for constructing compositor classes
Comment 1 James Robinson 2012-08-26 21:44:10 PDT
Created attachment 160627 [details]
Patch
Comment 2 WebKit Review Bot 2012-08-26 21:47:32 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 3 Adam Barth 2012-08-26 23:48:22 PDT
Comment on attachment 160627 [details]
Patch

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

I was hoping I could review this, but I just have silly comments about whitespace.  :)

> Source/Platform/chromium/public/WebCompositorSupport.h:55
> +    // May return nil if initialization fails. Does not take ownership of the provided client or root layer.

nil -> 0

> Source/Platform/chromium/public/WebCompositorSupport.h:59
> +    // Layers -------------------------------------------------------

Please add a blank line below this line and one more blank line above this line.

> Source/Platform/chromium/public/WebCompositorSupport.h:80
> +    // Animation ----------------------------------------------------

Please add a blank line below this line.

> Source/WebKit/chromium/src/LinkHighlight.cpp:44
> +

This blank line isn't needed.
Comment 4 James Robinson 2012-08-27 13:40:24 PDT
I'll try using the fancy new WebPassOwnPtr<> type here and see how it works out.
Comment 5 Adam Barth 2012-08-27 13:46:50 PDT
Woah, we have WebPassOwnPtr now!  That's exciting.
Comment 6 James Robinson 2012-08-27 13:50:55 PDT
(In reply to comment #5)
> Woah, we have WebPassOwnPtr now!  That's exciting.

Not yet - we will soon though :)
Comment 7 James Robinson 2012-08-27 13:53:22 PDT
Created attachment 160797 [details]
Patch
Comment 8 James Robinson 2012-08-27 13:53:43 PDT
Check it out - I don't have to document ownership transfers any more since it's in the type system. Woohoo!
Comment 9 WebKit Review Bot 2012-08-27 13:55:15 PDT
Attachment 160797 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/Platform/ChangeLog', u'Source/Platf..." exit_code: 1
Source/Platform/chromium/public/WebPassOwnPtr.h:85:  scoped_ptr is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 James Robinson 2012-08-27 14:45:05 PDT
Created attachment 160810 [details]
Remove default WebPassOwnPtr constructor, it's not useful without a copy ctor
Comment 11 WebKit Review Bot 2012-08-27 14:47:28 PDT
Attachment 160810 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/Platform/ChangeLog', u'Source/Platf..." exit_code: 1
Source/Platform/chromium/public/WebPassOwnPtr.h:80:  scoped_ptr is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 James Robinson 2012-08-27 14:47:48 PDT
Darin pointed out it would be super handy to have default implementations of the create..() functions so it's easier to modify the interface without having to land implementations of the new functions chromium-side first.  However, I don't know how to write a default implementation of these since WebPassOwnPtr<T> is not copyable (by design) since users should only be using it to put into a OwnPtr<T> or scoped_ptr<T> depending on which side of the interface they are on.
Comment 13 James Robinson 2012-08-27 17:10:05 PDT
Created attachment 160861 [details]
Patch
Comment 14 James Robinson 2012-08-27 17:12:40 PDT
This provides default implementations of WebCompositorSupport, which Darin points out will make modifying the interface a hell of a lot easier.  To do this we've (mostly accidentally) implemented move emulation for WebPassOwnPtr<> so that we can return a temporary null value.
Comment 15 WebKit Review Bot 2012-08-27 17:13:19 PDT
Attachment 160861 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/Platform/ChangeLog', u'Source/Platf..." exit_code: 1
Source/Platform/chromium/public/WebPassOwnPtr.h:85:  scoped_ptr is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 16 James Robinson 2012-08-27 17:26:32 PDT
One consequence of this is that WebPassOwnPtr<T> is a really weird type.  I think we should just make sure it's never declared as a local or member variable, or really used at all outside of declaring + implementing WebKit APIs.
Comment 17 Darin Fisher (:fishd, Google) 2012-08-28 14:19:47 PDT
Comment on attachment 160861 [details]
Patch

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

> Source/Platform/chromium/public/WebPassOwnPtr.h:35
> +#include "base/memory/scoped_ptr.h"

This adds a new circular dependency between WebKit and Chromium, but it is probably fairly unlikely that this path will ever change.

> Source/Platform/chromium/public/WebPassOwnPtr.h:52
> +//   OwnPtr<Foo> foo = ...->createFoo();

It would be good to complete this by showing how to implement on the WebKit side and call on the Chromium side.
Comment 18 James Robinson 2012-08-29 16:15:54 PDT
Created attachment 161350 [details]
consistent fallback behavior
Comment 19 James Robinson 2012-08-29 16:18:36 PDT
Created attachment 161351 [details]
add example of implementing in WebKit and using on chromium side
Comment 20 James Robinson 2012-08-29 16:19:51 PDT
This assumes that if compositorSupport is not null, it'll return the types we want.
Comment 21 WebKit Review Bot 2012-08-29 16:21:00 PDT
Attachment 161351 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/Platform/ChangeLog', u'Source/Platf..." exit_code: 1
Source/Platform/chromium/public/WebPassOwnPtr.h:98:  scoped_ptr is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 22 James Robinson 2012-08-30 12:52:17 PDT
Committed r127172: <http://trac.webkit.org/changeset/127172>