2 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
3 <html><head><title>Python: module telemetry.internal.platform.network_controller_backend
</title>
5 </head><body bgcolor=
"#f0f0f8">
7 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"heading">
9 <td valign=bottom
> <br>
10 <font color=
"#ffffff" face=
"helvetica, arial"> <br><big><big><strong><a href=
"telemetry.html"><font color=
"#ffffff">telemetry
</font></a>.
<a href=
"telemetry.internal.html"><font color=
"#ffffff">internal
</font></a>.
<a href=
"telemetry.internal.platform.html"><font color=
"#ffffff">platform
</font></a>.network_controller_backend
</strong></big></big></font></td
11 ><td align=right valign=bottom
12 ><font color=
"#ffffff" face=
"helvetica, arial"><a href=
".">index
</a><br><a href=
"../telemetry/internal/platform/network_controller_backend.py">telemetry/internal/platform/network_controller_backend.py
</a></font></td></tr></table>
13 <p><tt>#
Copyright
2014 The
Chromium
Authors.
All
rights
reserved.
<br>
14 #
Use
of
this
source
code
is
governed
by
a
BSD-style
license
that
can
be
<br>
15 #
found
in
the
LICENSE
file.
</tt></p>
17 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"section">
18 <tr bgcolor=
"#aa55cc">
19 <td colspan=
3 valign=bottom
> <br>
20 <font color=
"#ffffff" face=
"helvetica, arial"><big><strong>Modules
</strong></big></font></td></tr>
22 <tr><td bgcolor=
"#aa55cc"><tt> </tt></td><td> </td>
23 <td width=
"100%"><table width=
"100%" summary=
"list"><tr><td width=
"25%" valign=top
><a href=
"telemetry.internal.forwarders.html">telemetry.internal.forwarders
</a><br>
24 </td><td width=
"25%" valign=top
><a href=
"os.html">os
</a><br>
25 </td><td width=
"25%" valign=top
><a href=
"telemetry.internal.util.webpagereplay.html">telemetry.internal.util.webpagereplay
</a><br>
26 </td><td width=
"25%" valign=top
><a href=
"telemetry.util.wpr_modes.html">telemetry.util.wpr_modes
</a><br>
27 </td></tr></table></td></tr></table><p>
28 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"section">
29 <tr bgcolor=
"#ee77aa">
30 <td colspan=
3 valign=bottom
> <br>
31 <font color=
"#ffffff" face=
"helvetica, arial"><big><strong>Classes
</strong></big></font></td></tr>
33 <tr><td bgcolor=
"#ee77aa"><tt> </tt></td><td> </td>
35 <dt><font face=
"helvetica, arial"><a href=
"__builtin__.html#object">__builtin__.object
</a>
38 <dt><font face=
"helvetica, arial"><a href=
"telemetry.internal.platform.network_controller_backend.html#NetworkControllerBackend">NetworkControllerBackend
</a>
41 <dt><font face=
"helvetica, arial"><a href=
"exceptions.html#Exception">exceptions.Exception
</a>(
<a href=
"exceptions.html#BaseException">exceptions.BaseException
</a>)
44 <dt><font face=
"helvetica, arial"><a href=
"telemetry.internal.platform.network_controller_backend.html#ArchiveDoesNotExistError">ArchiveDoesNotExistError
</a>
45 </font></dt><dt><font face=
"helvetica, arial"><a href=
"telemetry.internal.platform.network_controller_backend.html#ReplayAndBrowserPortsError">ReplayAndBrowserPortsError
</a>
50 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"section">
51 <tr bgcolor=
"#ffc8d8">
52 <td colspan=
3 valign=bottom
> <br>
53 <font color=
"#000000" face=
"helvetica, arial"><a name=
"ArchiveDoesNotExistError">class
<strong>ArchiveDoesNotExistError
</strong></a>(
<a href=
"exceptions.html#Exception">exceptions.Exception
</a>)
</font></td></tr>
55 <tr bgcolor=
"#ffc8d8"><td rowspan=
2><tt> </tt></td>
56 <td colspan=
2><tt>Raised
when
the
archive
path
does
not
exist
for
replay
mode.
<br> </tt></td></tr>
58 <td width=
"100%"><dl><dt>Method resolution order:
</dt>
59 <dd><a href=
"telemetry.internal.platform.network_controller_backend.html#ArchiveDoesNotExistError">ArchiveDoesNotExistError
</a></dd>
60 <dd><a href=
"exceptions.html#Exception">exceptions.Exception
</a></dd>
61 <dd><a href=
"exceptions.html#BaseException">exceptions.BaseException
</a></dd>
62 <dd><a href=
"__builtin__.html#object">__builtin__.object
</a></dd>
65 Data descriptors defined here:
<br>
66 <dl><dt><strong>__weakref__
</strong></dt>
67 <dd><tt>list
of
weak
references
to
the
object
(if
defined)
</tt></dd>
70 Methods inherited from
<a href=
"exceptions.html#Exception">exceptions.Exception
</a>:
<br>
71 <dl><dt><a name=
"ArchiveDoesNotExistError-__init__"><strong>__init__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ArchiveDoesNotExistError-__init__">__init__
</a>(...)
initializes
x;
see
help(type(x))
for
signature
</tt></dd></dl>
74 Data and other attributes inherited from
<a href=
"exceptions.html#Exception">exceptions.Exception
</a>:
<br>
75 <dl><dt><strong>__new__
</strong> =
<built-in method __new__ of type object
><dd><tt>T.
<a href=
"#ArchiveDoesNotExistError-__new__">__new__
</a>(S,
...)
-
> a
new
<a href=
"__builtin__.html#object">object
</a> with
type
S,
a
subtype
of
T
</tt></dl>
78 Methods inherited from
<a href=
"exceptions.html#BaseException">exceptions.BaseException
</a>:
<br>
79 <dl><dt><a name=
"ArchiveDoesNotExistError-__delattr__"><strong>__delattr__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ArchiveDoesNotExistError-__delattr__">__delattr__
</a>('name')
<==
> del
x.name
</tt></dd></dl>
81 <dl><dt><a name=
"ArchiveDoesNotExistError-__getattribute__"><strong>__getattribute__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ArchiveDoesNotExistError-__getattribute__">__getattribute__
</a>('name')
<==
> x.name
</tt></dd></dl>
83 <dl><dt><a name=
"ArchiveDoesNotExistError-__getitem__"><strong>__getitem__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ArchiveDoesNotExistError-__getitem__">__getitem__
</a>(y)
<==
> x[y]
</tt></dd></dl>
85 <dl><dt><a name=
"ArchiveDoesNotExistError-__getslice__"><strong>__getslice__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ArchiveDoesNotExistError-__getslice__">__getslice__
</a>(i,
j)
<==
> x[i:j]
<br>
87 Use
of
negative
indices
is
not
supported.
</tt></dd></dl>
89 <dl><dt><a name=
"ArchiveDoesNotExistError-__reduce__"><strong>__reduce__
</strong></a>(...)
</dt></dl>
91 <dl><dt><a name=
"ArchiveDoesNotExistError-__repr__"><strong>__repr__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ArchiveDoesNotExistError-__repr__">__repr__
</a>()
<==
> repr(x)
</tt></dd></dl>
93 <dl><dt><a name=
"ArchiveDoesNotExistError-__setattr__"><strong>__setattr__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ArchiveDoesNotExistError-__setattr__">__setattr__
</a>('name',
value)
<==
> x.name
=
value
</tt></dd></dl>
95 <dl><dt><a name=
"ArchiveDoesNotExistError-__setstate__"><strong>__setstate__
</strong></a>(...)
</dt></dl>
97 <dl><dt><a name=
"ArchiveDoesNotExistError-__str__"><strong>__str__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ArchiveDoesNotExistError-__str__">__str__
</a>()
<==
> str(x)
</tt></dd></dl>
99 <dl><dt><a name=
"ArchiveDoesNotExistError-__unicode__"><strong>__unicode__
</strong></a>(...)
</dt></dl>
102 Data descriptors inherited from
<a href=
"exceptions.html#BaseException">exceptions.BaseException
</a>:
<br>
103 <dl><dt><strong>__dict__
</strong></dt>
105 <dl><dt><strong>args
</strong></dt>
107 <dl><dt><strong>message
</strong></dt>
109 </td></tr></table> <p>
110 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"section">
111 <tr bgcolor=
"#ffc8d8">
112 <td colspan=
3 valign=bottom
> <br>
113 <font color=
"#000000" face=
"helvetica, arial"><a name=
"NetworkControllerBackend">class
<strong>NetworkControllerBackend
</strong></a>(
<a href=
"__builtin__.html#object">__builtin__.object
</a>)
</font></td></tr>
115 <tr bgcolor=
"#ffc8d8"><td rowspan=
2><tt> </tt></td>
116 <td colspan=
2><tt>Control
network
settings
and
servers
to
simulate
the
Web.
<br>
118 Network
changes
include
forwarding
device
ports
to
host
platform
ports.
<br>
119 Web
Page
Replay
is
used
to
record
and
replay
HTTP/HTTPS
responses.
<br> </tt></td></tr>
121 <td width=
"100%">Methods defined here:
<br>
122 <dl><dt><a name=
"NetworkControllerBackend-SetReplayArgs"><strong>SetReplayArgs
</strong></a>(self, archive_path, wpr_mode, netsim, extra_wpr_args, make_javascript_deterministic
<font color=
"#909090">=False
</font>)
</dt><dd><tt>Save
the
arguments
needed
for
replay.
<br>
124 To
make
the
settings
effective,
this
call
must
be
followed
by
a
call
<br>
125 to
UpdateReplay.
<br>
128 archive_path:
a
path
to
a
specific
WPR
archive.
<br>
129 wpr_mode:
one
of
wpr_modes.WPR_OFF,
wpr_modes.WPR_APPEND,
<br>
130 wpr_modes.WPR_REPLAY,
or
wpr_modes.WPR_RECORD.
<br>
131 netsim:
a
net_config
string
('dialup',
'
3g',
'dsl',
'cable',
or
'fios').
<br>
132 extra_wpr_args:
a
list
of
addtional
replay
args
(or
an
empty
list).
<br>
133 make_javascript_deterministic:
True
if
replay
should
inject
a
script
<br>
134 to
make
JavaScript
behave
deterministically
(e.g.,
override
Date()).
</tt></dd></dl>
136 <dl><dt><a name=
"NetworkControllerBackend-StopReplay"><strong>StopReplay
</strong></a>(self)
</dt></dl>
138 <dl><dt><a name=
"NetworkControllerBackend-UpdateReplay"><strong>UpdateReplay
</strong></a>(self, browser_backend
<font color=
"#909090">=None
</font>)
</dt><dd><tt>Start
or
reuse
Web
Page
Replay.
<br>
140 UpdateReplay
must
be
called
after
every
call
to
SetReplayArgs.
<br>
142 TODO(slamm):
Update
replay
in
SetReplayArgs
once
the
browser_backend
<br>
143 dependencies
move
to
platform.
https://crbug.com/
423962<br>
144 browser_backend
properties
used:
<br>
145 -
Input:
wpr_port_pairs
<br>
146 -
Output:
wpr_port_pairs
(browser
uses
for
--testing-fixed-*
flags).
<br>
148 browser_backend:
instance
of
telemetry.core.backends.browser_backend
</tt></dd></dl>
150 <dl><dt><a name=
"NetworkControllerBackend-__init__"><strong>__init__
</strong></a>(self, platform_backend)
</dt></dl>
153 Data descriptors defined here:
<br>
154 <dl><dt><strong>__dict__
</strong></dt>
155 <dd><tt>dictionary
for
instance
variables
(if
defined)
</tt></dd>
157 <dl><dt><strong>__weakref__
</strong></dt>
158 <dd><tt>list
of
weak
references
to
the
object
(if
defined)
</tt></dd>
160 <dl><dt><strong>wpr_http_device_port
</strong></dt>
162 <dl><dt><strong>wpr_https_device_port
</strong></dt>
164 </td></tr></table> <p>
165 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"section">
166 <tr bgcolor=
"#ffc8d8">
167 <td colspan=
3 valign=bottom
> <br>
168 <font color=
"#000000" face=
"helvetica, arial"><a name=
"ReplayAndBrowserPortsError">class
<strong>ReplayAndBrowserPortsError
</strong></a>(
<a href=
"exceptions.html#Exception">exceptions.Exception
</a>)
</font></td></tr>
170 <tr bgcolor=
"#ffc8d8"><td rowspan=
2><tt> </tt></td>
171 <td colspan=
2><tt>Raised
an
existing
browser
would
get
different
remote
replay
ports.
<br> </tt></td></tr>
173 <td width=
"100%"><dl><dt>Method resolution order:
</dt>
174 <dd><a href=
"telemetry.internal.platform.network_controller_backend.html#ReplayAndBrowserPortsError">ReplayAndBrowserPortsError
</a></dd>
175 <dd><a href=
"exceptions.html#Exception">exceptions.Exception
</a></dd>
176 <dd><a href=
"exceptions.html#BaseException">exceptions.BaseException
</a></dd>
177 <dd><a href=
"__builtin__.html#object">__builtin__.object
</a></dd>
180 Data descriptors defined here:
<br>
181 <dl><dt><strong>__weakref__
</strong></dt>
182 <dd><tt>list
of
weak
references
to
the
object
(if
defined)
</tt></dd>
185 Methods inherited from
<a href=
"exceptions.html#Exception">exceptions.Exception
</a>:
<br>
186 <dl><dt><a name=
"ReplayAndBrowserPortsError-__init__"><strong>__init__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ReplayAndBrowserPortsError-__init__">__init__
</a>(...)
initializes
x;
see
help(type(x))
for
signature
</tt></dd></dl>
189 Data and other attributes inherited from
<a href=
"exceptions.html#Exception">exceptions.Exception
</a>:
<br>
190 <dl><dt><strong>__new__
</strong> =
<built-in method __new__ of type object
><dd><tt>T.
<a href=
"#ReplayAndBrowserPortsError-__new__">__new__
</a>(S,
...)
-
> a
new
<a href=
"__builtin__.html#object">object
</a> with
type
S,
a
subtype
of
T
</tt></dl>
193 Methods inherited from
<a href=
"exceptions.html#BaseException">exceptions.BaseException
</a>:
<br>
194 <dl><dt><a name=
"ReplayAndBrowserPortsError-__delattr__"><strong>__delattr__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ReplayAndBrowserPortsError-__delattr__">__delattr__
</a>('name')
<==
> del
x.name
</tt></dd></dl>
196 <dl><dt><a name=
"ReplayAndBrowserPortsError-__getattribute__"><strong>__getattribute__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ReplayAndBrowserPortsError-__getattribute__">__getattribute__
</a>('name')
<==
> x.name
</tt></dd></dl>
198 <dl><dt><a name=
"ReplayAndBrowserPortsError-__getitem__"><strong>__getitem__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ReplayAndBrowserPortsError-__getitem__">__getitem__
</a>(y)
<==
> x[y]
</tt></dd></dl>
200 <dl><dt><a name=
"ReplayAndBrowserPortsError-__getslice__"><strong>__getslice__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ReplayAndBrowserPortsError-__getslice__">__getslice__
</a>(i,
j)
<==
> x[i:j]
<br>
202 Use
of
negative
indices
is
not
supported.
</tt></dd></dl>
204 <dl><dt><a name=
"ReplayAndBrowserPortsError-__reduce__"><strong>__reduce__
</strong></a>(...)
</dt></dl>
206 <dl><dt><a name=
"ReplayAndBrowserPortsError-__repr__"><strong>__repr__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ReplayAndBrowserPortsError-__repr__">__repr__
</a>()
<==
> repr(x)
</tt></dd></dl>
208 <dl><dt><a name=
"ReplayAndBrowserPortsError-__setattr__"><strong>__setattr__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ReplayAndBrowserPortsError-__setattr__">__setattr__
</a>('name',
value)
<==
> x.name
=
value
</tt></dd></dl>
210 <dl><dt><a name=
"ReplayAndBrowserPortsError-__setstate__"><strong>__setstate__
</strong></a>(...)
</dt></dl>
212 <dl><dt><a name=
"ReplayAndBrowserPortsError-__str__"><strong>__str__
</strong></a>(...)
</dt><dd><tt>x.
<a href=
"#ReplayAndBrowserPortsError-__str__">__str__
</a>()
<==
> str(x)
</tt></dd></dl>
214 <dl><dt><a name=
"ReplayAndBrowserPortsError-__unicode__"><strong>__unicode__
</strong></a>(...)
</dt></dl>
217 Data descriptors inherited from
<a href=
"exceptions.html#BaseException">exceptions.BaseException
</a>:
<br>
218 <dl><dt><strong>__dict__
</strong></dt>
220 <dl><dt><strong>args
</strong></dt>
222 <dl><dt><strong>message
</strong></dt>
224 </td></tr></table></td></tr></table>