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

Side by Side Diff: chrome/browser/download/download_types.h

Issue 7618048: Move the core download files to content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TYPES_H_
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TYPES_H_
7 #pragma once
8
9 #include <vector>
10
11 #include "base/file_path.h"
12 #include "base/memory/linked_ptr.h"
13 #include "base/synchronization/lock.h"
14 #include "net/base/file_stream.h"
15
16 namespace net {
17 class IOBuffer;
18 }
19
20 // DownloadBuffer is created and populated on the IO thread, and passed to the
21 // file thread for writing. In order to avoid flooding the file thread with too
22 // many small write messages, each write is appended to the DownloadBuffer while
23 // waiting for the task to run on the file thread. Access to the write buffers
24 // is synchronized via the lock. Each entry in 'contents' represents one data
25 // buffer and its size in bytes.
26 struct DownloadBuffer {
27 DownloadBuffer();
28 ~DownloadBuffer();
29
30 base::Lock lock;
31 typedef std::pair<net::IOBuffer*, int> Contents;
32 std::vector<Contents> contents;
33 };
34
35 // Holds the information about how to save a download file.
36 struct DownloadSaveInfo {
37 DownloadSaveInfo();
38 DownloadSaveInfo(const DownloadSaveInfo& info);
39 ~DownloadSaveInfo();
40 DownloadSaveInfo& operator=(const DownloadSaveInfo& info);
41
42 FilePath file_path;
43 linked_ptr<net::FileStream> file_stream;
44 string16 suggested_name;
45 };
46
47 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TYPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698