Skip to content

Commit

Permalink
Remove sobek from connection.Close
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur22 committed Oct 7, 2024
1 parent 50be4e4 commit 143a8a5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions common/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
cdpruntime "github.com/chromedp/cdproto/runtime"
"github.com/chromedp/cdproto/target"
"github.com/gorilla/websocket"
"github.com/grafana/sobek"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter"
Expand Down Expand Up @@ -51,7 +50,7 @@ type executorEmitter interface {

type connection interface {
executorEmitter
Close(...sobek.Value)
Close(...int)
IgnoreIOErrors()
getSession(target.SessionID) *Session
}
Expand Down Expand Up @@ -566,10 +565,12 @@ func (c *Connection) sendLoop() {

// Close cleanly closes the WebSocket connection.
// It returns an error if sending the Close control frame fails.
func (c *Connection) Close(args ...sobek.Value) {
code := websocket.CloseGoingAway
//
// Optional code to override default websocket.CloseGoingAway (1001).
func (c *Connection) Close(args ...int) {
code := websocket.CloseNormalClosure
if len(args) > 0 {
code = int(args[0].ToInteger())
code = int(args[0])
}
c.logger.Debugf("connection:Close", "wsURL:%q code:%d", c.wsURL, code)
_ = c.close(code)
Expand Down

0 comments on commit 143a8a5

Please sign in to comment.