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