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

Side by Side Diff: ios/chrome/browser/reading_list/url_downloader.h

Issue 2507703002: Make offline directory name public. (Closed)
Patch Set: add an S Created 4 years, 1 month 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
« no previous file with comments | « no previous file | ios/chrome/browser/reading_list/url_downloader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef IOS_CHROME_BROWSER_READING_LIST_URL_DOWNLOADER_H_ 5 #ifndef IOS_CHROME_BROWSER_READING_LIST_URL_DOWNLOADER_H_
6 #define IOS_CHROME_BROWSER_READING_LIST_URL_DOWNLOADER_H_ 6 #define IOS_CHROME_BROWSER_READING_LIST_URL_DOWNLOADER_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/task/cancelable_task_tracker.h" 11 #include "base/task/cancelable_task_tracker.h"
12 #include "ios/chrome/browser/dom_distiller/distiller_viewer.h" 12 #include "ios/chrome/browser/dom_distiller/distiller_viewer.h"
13 13
14 class PrefService; 14 class PrefService;
15 class GURL; 15 class GURL;
16 namespace base { 16 namespace base {
17 class FilePath; 17 class FilePath;
18 } 18 }
19 19
20 namespace dom_distiller { 20 namespace dom_distiller {
21 class DomDistillerService; 21 class DomDistillerService;
22 } 22 }
23 23
24 // This string contains the directory name in which offline pages are saved.
25 // The directory is located in the profile directory.
26 extern const char kReadingListOfflineDirectory[];
27
24 // This class downloads and deletes offline versions of URLs using DOM distiller 28 // This class downloads and deletes offline versions of URLs using DOM distiller
25 // to fetch the page and simplify it. Only one item is downloaded or deleted at 29 // to fetch the page and simplify it. Only one item is downloaded or deleted at
26 // a time using a queue of tasks that are handled sequentially. Items (page + 30 // a time using a queue of tasks that are handled sequentially. Items (page +
27 // images) are saved to individual folders within an offline folder, using md5 31 // images) are saved to individual folders within an offline folder, using md5
28 // hashing to create unique file names. When a deletion is requested, all 32 // hashing to create unique file names. When a deletion is requested, all
29 // previous downloads for that URL are cancelled as they would be deleted. 33 // previous downloads for that URL are cancelled as they would be deleted.
30 class URLDownloader { 34 class URLDownloader {
31 friend class MockURLDownloader; 35 friend class MockURLDownloader;
32 36
33 public: 37 public:
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 std::deque<Task> tasks_; 147 std::deque<Task> tasks_;
144 bool working_; 148 bool working_;
145 base::FilePath base_directory_; 149 base::FilePath base_directory_;
146 std::unique_ptr<dom_distiller::DistillerViewerInterface> distiller_; 150 std::unique_ptr<dom_distiller::DistillerViewerInterface> distiller_;
147 base::CancelableTaskTracker task_tracker_; 151 base::CancelableTaskTracker task_tracker_;
148 152
149 DISALLOW_COPY_AND_ASSIGN(URLDownloader); 153 DISALLOW_COPY_AND_ASSIGN(URLDownloader);
150 }; 154 };
151 155
152 #endif // IOS_CHROME_BROWSER_READING_LIST_URL_DOWNLOADER_H_ 156 #endif // IOS_CHROME_BROWSER_READING_LIST_URL_DOWNLOADER_H_
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/reading_list/url_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698