detached b15abc4

cef: stop wiring transcoding request handlers

commit
b15abc436d2c8dcb3583298034b805621355da1e
author
brice · · 2026-04-28 03:44 UTC
parent
91bd671
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +4 -29
M internal/infrastructure/cef/factory.go +1 -12
@@ -121,19 +121,8 @@ func (f *WebViewFactory) newWebView(ctx context.Context) *WebView {
121121 backgroundColor: f.bgColor.Load(),
122122 }
123123
124- var transcodingHandler purecef.ResourceRequestHandler
125- if f.transcoder != nil {
126- transcodingHandler = newTranscodingRequestHandler(f.transcoder, f.mediaClassifier, func() context.Context {
127- if f.engine != nil {
128- return f.engine.currentContext()
129- }
130- return ctx
131- })
132- }
133-
134124 handlers := &handlerSet{
135- wv: wv,
136- transcodingHandler: transcodingHandler,
125+ wv: wv,
137126 }
138127 wv.handlers = handlers
139128 wv.findCtrl = newFindController()
@@ -121,19 +121,8 @@ func (f *WebViewFactory) newWebView(ctx context.Context) *WebView {
121 backgroundColor: f.bgColor.Load(),121 backgroundColor: f.bgColor.Load(),
122 }122 }
123 123
124- var transcodingHandler purecef.ResourceRequestHandler
125- if f.transcoder != nil {
126- transcodingHandler = newTranscodingRequestHandler(f.transcoder, f.mediaClassifier, func() context.Context {
127- if f.engine != nil {
128- return f.engine.currentContext()
129- }
130- return ctx
131- })
132- }
133-
134 handlers := &handlerSet{124 handlers := &handlerSet{
135- wv: wv,125+ wv: wv,
136- transcodingHandler: transcodingHandler,
137 }126 }
138 wv.handlers = handlers127 wv.handlers = handlers
139 wv.findCtrl = newFindController()128 wv.findCtrl = newFindController()
M internal/infrastructure/cef/webview_handlers.go +3 -17
@@ -8,7 +8,6 @@ import (
88
99 "github.com/bnema/dumber/internal/application/port"
1010 downloadutil "github.com/bnema/dumber/internal/domain/download"
11- "github.com/bnema/dumber/internal/infrastructure/transcoder"
1211 "github.com/bnema/dumber/internal/logging"
1312 )
1413
@@ -23,8 +22,7 @@ const (
2322 // owning WebView. A single struct is used so that the Client's Get*Handler
2423 // methods can return the same receiver, avoiding extra allocations.
2524 type handlerSet struct {
26- wv *WebView
27- transcodingHandler purecef.ResourceRequestHandler
25+ wv *WebView
2826 }
2927
3028 // Compile-time interface checks.
@@ -993,21 +991,9 @@ func (h *handlerSet) OnOpenUrlfromTab(
993991 }
994992
995993 func (h *handlerSet) GetResourceRequestHandler(
996- _ purecef.Browser, _ purecef.Frame, request purecef.Request,
997- _, _ int32, _ string, disableDefaultHandling *int32,
994+ _ purecef.Browser, _ purecef.Frame, _ purecef.Request,
995+ _, _ int32, _ string, _ *int32,
998996 ) purecef.ResourceRequestHandler {
999- if h.transcodingHandler != nil && request != nil && disableDefaultHandling != nil &&
1000- transcoder.IsEagerTranscodeURL(request.GetURL()) {
1001- *disableDefaultHandling = 1
1002- if h.wv != nil && h.wv.ctx != nil {
1003- logging.FromContext(h.wv.ctx).Info().
1004- Str("url", logging.TruncateURL(request.GetURL(), maxTranscodingURLLength)).
1005- Msg("cef: disabled default handling for eager transcode candidate")
1006- }
1007- }
1008- if h.transcodingHandler != nil {
1009- return h.transcodingHandler
1010- }
1011997 return nil
1012998 }
1013999
@@ -8,7 +8,6 @@ import (
8 8
9 "github.com/bnema/dumber/internal/application/port"9 "github.com/bnema/dumber/internal/application/port"
10 downloadutil "github.com/bnema/dumber/internal/domain/download"10 downloadutil "github.com/bnema/dumber/internal/domain/download"
11- "github.com/bnema/dumber/internal/infrastructure/transcoder"
12 "github.com/bnema/dumber/internal/logging"11 "github.com/bnema/dumber/internal/logging"
13 )12 )
14 13
@@ -23,8 +22,7 @@ const (
23 // owning WebView. A single struct is used so that the Client's Get*Handler22 // owning WebView. A single struct is used so that the Client's Get*Handler
24 // methods can return the same receiver, avoiding extra allocations.23 // methods can return the same receiver, avoiding extra allocations.
25 type handlerSet struct {24 type handlerSet struct {
26- wv *WebView25+ wv *WebView
27- transcodingHandler purecef.ResourceRequestHandler
28 }26 }
29 27
30 // Compile-time interface checks.28 // Compile-time interface checks.
@@ -993,21 +991,9 @@ func (h *handlerSet) OnOpenUrlfromTab(
993 }991 }
994 992
995 func (h *handlerSet) GetResourceRequestHandler(993 func (h *handlerSet) GetResourceRequestHandler(
996- _ purecef.Browser, _ purecef.Frame, request purecef.Request,994+ _ purecef.Browser, _ purecef.Frame, _ purecef.Request,
997- _, _ int32, _ string, disableDefaultHandling *int32,995+ _, _ int32, _ string, _ *int32,
998 ) purecef.ResourceRequestHandler {996 ) purecef.ResourceRequestHandler {
999- if h.transcodingHandler != nil && request != nil && disableDefaultHandling != nil &&
1000- transcoder.IsEagerTranscodeURL(request.GetURL()) {
1001- *disableDefaultHandling = 1
1002- if h.wv != nil && h.wv.ctx != nil {
1003- logging.FromContext(h.wv.ctx).Info().
1004- Str("url", logging.TruncateURL(request.GetURL(), maxTranscodingURLLength)).
1005- Msg("cef: disabled default handling for eager transcode candidate")
1006- }
1007- }
1008- if h.transcodingHandler != nil {
1009- return h.transcodingHandler
1010- }
1011 return nil997 return nil
1012 }998 }
1013 999

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close