Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(762)

Side by Side Diff: chrome/browser/download/download_process_handle.cc

Issue 6932046: Added DownloadProcessHandle class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup per Pawel's comments. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/download/download_process_handle.h"
6
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/tab_contents/tab_util.h"
9 #include "content/browser/browser_thread.h"
10 #include "content/browser/tab_contents/tab_contents.h"
11
12 DownloadProcessHandle::DownloadProcessHandle()
13 : child_id_(-1), render_view_id_(-1), request_id_(-1) {
14 }
15
16 DownloadProcessHandle::DownloadProcessHandle(int child_id,
17 int render_view_id,
18 int request_id)
19 : child_id_(child_id),
20 render_view_id_(render_view_id),
21 request_id_(request_id) {
22 }
23
24 TabContents* DownloadProcessHandle::GetTabContents() {
25 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
26 return tab_util::GetTabContentsByID(child_id_, render_view_id_);
27 }
28
29 DownloadManager* DownloadProcessHandle::GetDownloadManager() {
30 TabContents* contents = GetTabContents();
31 if (!contents)
32 return NULL;
33
34 Profile* profile = contents->profile();
35 if (!profile)
36 return NULL;
37
38 return profile->GetDownloadManager();
39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698