struct TorrentSource TorrentSource const base FilePath torrent_path co

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
struct TorrentSource
{
TorrentSource(const base::FilePath& torrent_path, const content::WebContents* contents);
TorrentSource(const GURL& magnet_uri, const content::WebContents* contents);
base::FilePath torrent_path;
GURL magnet_uri;
bool from_incognito;
int render_process_id;
int render_view_id;
private:
TorrentSource(const content::WebContents* contents);
};
TorrentSource::TorrentSource(const base::FilePath& path, const content::WebContents* contents)
: TorrentSource(contents)
{
torrent_path = path;
}
TorrentSource::TorrentSource(const GURL& uri, const content::WebContents* contents)
: TorrentSource(contents)
{
magnet_uri = uri;
}
TorrentSource::TorrentSource(const content::WebContents* contents)
: from_incognito(false),
render_process_id(content::ChildProcessHost::kInvalidUniqueID),
render_view_id(MSG_ROUTING_NONE)
{
if (!contents)
return;
render_view_id = contents->GetRoutingID();
content::RenderProcessHost* process_host = contents->GetRenderProcessHost();
if (process_host)
render_process_id = process_host->GetID();
}