Update chromedp to fix console errors (#1521)

This commit is contained in:
peolic
2021-06-23 01:05:58 +03:00
committed by GitHub
parent ae3400a9b1
commit be2fe1de26
526 changed files with 55061 additions and 30300 deletions

6
vendor/github.com/chromedp/sysutil/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,6 @@
dist: bionic
language: go
go:
- 1.13.x
script:
- go test -v -coverprofile=coverage.out

21
vendor/github.com/chromedp/sysutil/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016-2017 Kenneth Shaw
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

6
vendor/github.com/chromedp/sysutil/README.md generated vendored Normal file
View File

@@ -0,0 +1,6 @@
# About sysutil
Package sysutil provides some utilities for working with cross platform
systems.
Inspired by the Go version of Sigar, but written to be "idiomatic" Go.

3
vendor/github.com/chromedp/sysutil/go.mod generated vendored Normal file
View File

@@ -0,0 +1,3 @@
module github.com/chromedp/sysutil
go 1.15

15
vendor/github.com/chromedp/sysutil/sysutil.go generated vendored Normal file
View File

@@ -0,0 +1,15 @@
package sysutil
import "time"
var btime time.Time
// BootTime returns the time the system was started.
func BootTime() time.Time {
return btime
}
// Uptime returns the duration the system has been up.
func Uptime() time.Duration {
return time.Now().Sub(btime)
}

26
vendor/github.com/chromedp/sysutil/sysutil_bsd.go generated vendored Normal file
View File

@@ -0,0 +1,26 @@
// +build darwin freebsd openbsd netbsd
package sysutil
import (
"bytes"
"encoding/binary"
"syscall"
"time"
)
func init() {
// get boot time
res, err := syscall.Sysctl("kern.boottime")
if err != nil {
btime = time.Now()
return
}
// decode
var t timeval
if err = binary.Read(bytes.NewBuffer([]byte(res)), binary.LittleEndian, &t); err != nil {
btime = time.Now()
return
}
btime = time.Unix(int64(t.Sec), int64(t.Usec))
}

34
vendor/github.com/chromedp/sysutil/sysutil_linux.go generated vendored Normal file
View File

@@ -0,0 +1,34 @@
// +build linux
package sysutil
import (
"bytes"
"io/ioutil"
"strconv"
"time"
)
var (
btimePrefix = []byte("btime ")
lineEnd = []byte("\n")
)
func init() {
buf, err := ioutil.ReadFile("/proc/stat")
if err != nil {
btime = time.Now()
return
}
for _, line := range bytes.SplitN(buf, lineEnd, -1) {
if bytes.HasPrefix(line, btimePrefix) {
t, err := strconv.ParseInt(string(line[len(btimePrefix):]), 10, 64)
if err != nil {
btime = time.Now()
return
}
btime = time.Unix(t, 0)
break
}
}
}

9
vendor/github.com/chromedp/sysutil/sysutil_other.go generated vendored Normal file
View File

@@ -0,0 +1,9 @@
// +build !linux,!windows,!darwin,!freebsd,!openbsd,!netbsd
package sysutil
import "time"
func init() {
btime = time.Now()
}

22
vendor/github.com/chromedp/sysutil/sysutil_windows.go generated vendored Normal file
View File

@@ -0,0 +1,22 @@
// +build windows
package sysutil
import (
"syscall"
"time"
)
var (
kernel32DLL = syscall.MustLoadDLL("kernel32")
procGetTickCount64 = kernel32DLL.MustFindProc("GetTickCount64")
)
func init() {
res, _, err := syscall.Syscall(procGetTickCount64.Addr(), 0, 0, 0, 0)
if err != 0 {
btime = time.Now()
return
}
btime = time.Now().Add(time.Duration(-res) * time.Millisecond)
}

9
vendor/github.com/chromedp/sysutil/timeval.go generated vendored Normal file
View File

@@ -0,0 +1,9 @@
// +build openbsd netbsd
package sysutil
import (
"syscall"
)
type timeval syscall.Timeval

8
vendor/github.com/chromedp/sysutil/timeval32.go generated vendored Normal file
View File

@@ -0,0 +1,8 @@
// +build darwin freebsd
package sysutil
type timeval struct {
Sec int32
Usec int32
}