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

Side by Side Diff: ios/chrome/browser/reading_list/reading_list_download_service.cc

Issue 2648293002: Store the distilled_url in Reading List entry in Reading List on iOS. (Closed)
Patch Set: Created 3 years, 10 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
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 #include "ios/chrome/browser/reading_list/reading_list_download_service.h" 5 #include "ios/chrome/browser/reading_list/reading_list_download_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 void ReadingListDownloadService::OnDownloadEnd( 186 void ReadingListDownloadService::OnDownloadEnd(
187 const GURL& url, 187 const GURL& url,
188 URLDownloader::SuccessState success, 188 URLDownloader::SuccessState success,
189 const base::FilePath& distilled_path, 189 const base::FilePath& distilled_path,
190 const std::string& title) { 190 const std::string& title) {
191 DCHECK(reading_list_model_->loaded()); 191 DCHECK(reading_list_model_->loaded());
192 if ((success == URLDownloader::DOWNLOAD_SUCCESS || 192 if ((success == URLDownloader::DOWNLOAD_SUCCESS ||
193 success == URLDownloader::DOWNLOAD_EXISTS) && 193 success == URLDownloader::DOWNLOAD_EXISTS) &&
194 !distilled_path.empty()) { 194 !distilled_path.empty()) {
195 reading_list_model_->SetEntryDistilledPath(url, distilled_path); 195 reading_list_model_->SetEntryDistilledInfo(url, distilled_path, url);
196 if (!title.empty()) 196 if (!title.empty())
197 reading_list_model_->SetEntryTitle(url, title); 197 reading_list_model_->SetEntryTitle(url, title);
198 198
199 const ReadingListEntry* entry = reading_list_model_->GetEntryByURL(url); 199 const ReadingListEntry* entry = reading_list_model_->GetEntryByURL(url);
200 if (entry) 200 if (entry)
201 UMA_HISTOGRAM_COUNTS_100("ReadingList.Download.Failures", 201 UMA_HISTOGRAM_COUNTS_100("ReadingList.Download.Failures",
202 entry->FailedDownloadCounter()); 202 entry->FailedDownloadCounter());
203 UMA_HISTOGRAM_ENUMERATION("ReadingList.Download.Status", SUCCESS, 203 UMA_HISTOGRAM_ENUMERATION("ReadingList.Download.Status", SUCCESS,
204 STATUS_MAX); 204 STATUS_MAX);
205 205
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 for (auto& url : url_to_download_cellular_) { 242 for (auto& url : url_to_download_cellular_) {
243 ScheduleDownloadEntry(url); 243 ScheduleDownloadEntry(url);
244 } 244 }
245 } 245 }
246 if (type == net::NetworkChangeNotifier::CONNECTION_WIFI) { 246 if (type == net::NetworkChangeNotifier::CONNECTION_WIFI) {
247 for (auto& url : url_to_download_wifi_) { 247 for (auto& url : url_to_download_wifi_) {
248 ScheduleDownloadEntry(url); 248 ScheduleDownloadEntry(url);
249 } 249 }
250 } 250 }
251 } 251 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698