line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::UserAgentClientHints::BrandVersion; |
2
|
3
|
|
|
3
|
|
89227
|
use strict; |
|
3
|
|
|
|
|
13
|
|
|
3
|
|
|
|
|
74
|
|
3
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
61
|
|
4
|
3
|
|
|
3
|
|
1062
|
use HTTP::UserAgentClientHints::Util; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
659
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
3
|
|
|
3
|
1
|
77
|
my ($class, $raw_brand_version) = @_; |
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
|
|
8
|
bless { |
10
|
|
|
|
|
|
|
_parsed_brand_version => $class->_parse_brand_version($raw_brand_version), |
11
|
|
|
|
|
|
|
}, $class; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub brands { |
15
|
2
|
|
|
2
|
1
|
1203
|
my $self = shift; |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
|
|
3
|
return [keys %{$self->{_parsed_brand_version}}]; |
|
2
|
|
|
|
|
14
|
|
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub brand_version { |
21
|
3
|
|
|
3
|
1
|
603
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
6
|
return {%{$self->{_parsed_brand_version}}}; |
|
3
|
|
|
|
|
34
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub _parse_brand_version { |
27
|
3
|
|
|
3
|
|
8
|
my ($self, $raw_brand_version) = @_; |
28
|
|
|
|
|
|
|
|
29
|
3
|
|
|
|
|
17
|
my @pairs = split /,\s*/, $raw_brand_version; |
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
|
|
6
|
my %brand_version; |
32
|
3
|
|
|
|
|
6
|
for my $pair (@pairs) { |
33
|
9
|
|
|
|
|
30
|
my ($brand, $version) = map { HTTP::UserAgentClientHints::Util->strip_quote($_) } split /;\s*v=/, $pair; |
|
18
|
|
|
|
|
41
|
|
34
|
9
|
|
|
|
|
23
|
$brand_version{$brand} = $version; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
3
|
|
|
|
|
13
|
return \%brand_version; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |