Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Issue 2606643002: Supplement should have a Member to the corresponding Supplementable object (Closed)

Created:
3 years, 12 months ago by haraken
Modified:
3 years, 11 months ago
Reviewers:
sof, dcheng
CC:
chromium-reviews, shans, tzik, mlamouri+watch-screen-orientation_chromium.org, johnme+watch_chromium.org, eric.carlson_apple.com, scheib+watch_chromium.org, ortuno+watch_chromium.org, Srirama, kinuko+watch, awdf+watch_chromium.org, toyoshim+midi_chromium.org, iclelland+watch_chromium.org, chasej+watch_chromium.org, hongchan, mlamouri+watch-blink_chromium.org, jkarlin+watch_chromium.org, blink-reviews, harkness+watch_chromium.org, gogerald+paymentswatch_chromium.org, mcasas+watch+mediastream_chromium.org, Eric Willigers, rjwright, Peter Beverloo, timvolodine, Raymond Toy, feature-media-reviews_chromium.org, tommyw+watchlist_chromium.org, nhiroki, darktears, rouslan+payments_chromium.org, iclelland+watch_chromuim.org, blink-reviews-animation_chromium.org, feature-vr-reviews_chromium.org, kinuko+fileapi, mvanouwerkerk+watch_chromium.org, sebsg+paymentswatch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Supplement should have a Member to the corresponding Supplementable object Currently a lot of Supplement objects are observing ContextLifecycleObservers because they cannot access the corresponding Supplementable object, which is silly. This CL adds a strong reference from a Supplement object to the corresponding Supplementable object. That way we can remove a bunch of ContextLifecycleObservers from Supplement objects in follow-up CLs. MSVC requires to include X.h when inheriting from Supplement<X>. This CL adds the necessary include statements. BUG=610176 Committed: https://crrev.com/84f686de38202c5f5b9bb7863a1caea1f659ed59 Cr-Commit-Position: refs/heads/master@{#440733}

Patch Set 1 #

Patch Set 2 : temp #

Patch Set 3 : temp #

Patch Set 4 : temp #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -25 lines) Patch
M third_party/WebKit/Source/core/frame/Navigator.h View 1 2 chunks +9 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/frame/NavigatorCPU.h View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/NavigatorID.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/NavigatorLanguage.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/NavigatorOnLine.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/Screen.h View 1 2 2 chunks +5 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/timing/DOMWindowPerformance.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/timing/SharedWorkerPerformance.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerClients.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerNavigator.h View 1 2 chunks +8 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/modules/background_sync/ServiceWorkerRegistrationSync.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/bluetooth/NavigatorBluetooth.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/budget/NavigatorBudget.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/budget/WorkerNavigatorBudget.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/WindowAnimationWorklet.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/crypto/DOMWindowCrypto.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/WindowPaintWorklet.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/mediastream/NavigatorUserMedia.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/netinfo/NavigatorNetworkInformation.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/netinfo/WorkerNavigatorNetworkInformation.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/nfc/NavigatorNFC.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/payments/HTMLIFrameElementPayments.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/payments/PaymentAppServiceWorkerRegistration.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/permissions/NavigatorPermissions.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/permissions/WorkerNavigatorPermissions.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/plugins/NavigatorPlugins.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/NavigatorPresentation.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/push_messaging/ServiceWorkerRegistrationPush.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/remoteplayback/HTMLMediaElementRemotePlayback.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/screen_orientation/ScreenScreenOrientation.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/storage/DOMWindowStorage.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/vibration/NavigatorVibration.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/vr/NavigatorVR.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webaudio/WindowAudioWorklet.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webshare/NavigatorShare.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webusb/NavigatorUSB.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/Supplementable.h View 2 chunks +10 lines, -1 line 1 comment Download

Messages

Total messages: 28 (19 generated)
haraken
PTAL (This is a revised version of https://codereview.chromium.org/2150443002/, which was already reviewed by Sigbjorn, who ...
3 years, 12 months ago (2016-12-26 11:03:23 UTC) #15
dcheng
lgtm
3 years, 12 months ago (2016-12-27 05:21:23 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2606643002/60001
3 years, 12 months ago (2016-12-27 05:24:32 UTC) #18
commit-bot: I haz the power
Committed patchset #4 (id:60001)
3 years, 12 months ago (2016-12-27 05:29:56 UTC) #21
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/84f686de38202c5f5b9bb7863a1caea1f659ed59 Cr-Commit-Position: refs/heads/master@{#440733}
3 years, 11 months ago (2017-01-02 15:45:34 UTC) #23
sof
https://codereview.chromium.org/2606643002/diff/60001/third_party/WebKit/Source/platform/Supplementable.h File third_party/WebKit/Source/platform/Supplementable.h (right): https://codereview.chromium.org/2606643002/diff/60001/third_party/WebKit/Source/platform/Supplementable.h#newcode98 third_party/WebKit/Source/platform/Supplementable.h:98: // TODO(haraken): Remove the default constructor. I'd argue that ...
3 years, 11 months ago (2017-01-19 07:38:39 UTC) #25
haraken
On 2017/01/19 07:38:39, sof wrote: > https://codereview.chromium.org/2606643002/diff/60001/third_party/WebKit/Source/platform/Supplementable.h > File third_party/WebKit/Source/platform/Supplementable.h (right): > > https://codereview.chromium.org/2606643002/diff/60001/third_party/WebKit/Source/platform/Supplementable.h#newcode98 > ...
3 years, 11 months ago (2017-01-19 08:27:01 UTC) #26
sof
On 2017/01/19 08:27:01, haraken wrote: > On 2017/01/19 07:38:39, sof wrote: > > > https://codereview.chromium.org/2606643002/diff/60001/third_party/WebKit/Source/platform/Supplementable.h ...
3 years, 11 months ago (2017-01-19 08:57:26 UTC) #27
haraken
3 years, 11 months ago (2017-01-19 09:07:35 UTC) #28
Message was sent while issue was closed.
On 2017/01/19 08:57:26, sof wrote:
> On 2017/01/19 08:27:01, haraken wrote:
> > On 2017/01/19 07:38:39, sof wrote:
> > >
> >
>
https://codereview.chromium.org/2606643002/diff/60001/third_party/WebKit/Sour...
> > > File third_party/WebKit/Source/platform/Supplementable.h (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/2606643002/diff/60001/third_party/WebKit/Sour...
> > > third_party/WebKit/Source/platform/Supplementable.h:98: // TODO(haraken):
> > Remove
> > > the default constructor.
> > > I'd argue that this isn't a natural goal for all supplements -- there are
> some
> > > implementations where the extension/supplement effectively only wants to
be
> > > anonymously hosted somewhere once instantiated.
> > > 
> > > Which allows them to be a declared supplement of several potential hosts,
> but
> > > only register with one (e.g., LocalFileSystem, ImageBitmapFactories).
> > Recasting
> > > their implementations to be single-hosted could be done, but the result
> feels
> > > cumbersome.
> > > 
> > > (https://codereview.chromium.org/2645613004/ is a trial example how it
comes
> > out
> > > for LocalFileSystem.)
> > 
> > I think the underlying problem is that we don't have a good abstraction
layer
> > for a "frame" on a worker.
> > 
> > These supplement objects are supplementing WorkerClient and LocalFrame (or
> > LocalDOMWindow etc) because the supplement objects are accessed by the main
> > thread and worker threads. If we have a notion like "FrameBase", the
> supplement
> > objects can just supplement the FrameBase and always provide a non-null
> pointer
> > to the constructor.
> > 
> > Nit: Another weird thing is that we have pretty different ways to install
> > supplements between the main thread (ChromeClient) and worker threads
> > (WorkerClient).
> 
> That could be the way to unify and address the two.
> 
> An alternative is to support explicit supplementable registration over some
> shared GC mixin interface, which these multi-supplement implementations would
> derive from rather than Supplement<T>s.

There's some discussion in the worker team to introduce a FrameBase to share
more code between the main thread and workers, so that seems like a right way to
go (though they might not have a bandwidth to work on it).

Powered by Google App Engine
This is Rietveld 408576698