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

Side by Side Diff: chrome/browser/android/offline_pages/prerendering_offliner.cc

Issue 2624833002: Revert of [Offline Pages] Remove need for OfflinePolicy when constructing an Offliner. (Closed)
Patch Set: Created 3 years, 11 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 "chrome/browser/android/offline_pages/prerendering_offliner.h" 5 #include "chrome/browser/android/offline_pages/prerendering_offliner.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/sys_info.h" 9 #include "base/sys_info.h"
10 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" 10 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h"
(...skipping 28 matching lines...) Expand all
39 THIRD_PARTY_COOKIES_DISABLED, 39 THIRD_PARTY_COOKIES_DISABLED,
40 NETWORK_PREDICTION_DISABLED, 40 NETWORK_PREDICTION_DISABLED,
41 }; 41 };
42 42
43 } // namespace 43 } // namespace
44 44
45 namespace offline_pages { 45 namespace offline_pages {
46 46
47 PrerenderingOffliner::PrerenderingOffliner( 47 PrerenderingOffliner::PrerenderingOffliner(
48 content::BrowserContext* browser_context, 48 content::BrowserContext* browser_context,
49 const OfflinerPolicy* policy,
49 OfflinePageModel* offline_page_model) 50 OfflinePageModel* offline_page_model)
50 : browser_context_(browser_context), 51 : browser_context_(browser_context),
51 offline_page_model_(offline_page_model), 52 offline_page_model_(offline_page_model),
52 pending_request_(nullptr), 53 pending_request_(nullptr),
53 is_low_end_device_(base::SysInfo::IsLowEndDevice()), 54 is_low_end_device_(base::SysInfo::IsLowEndDevice()),
54 app_listener_(nullptr), 55 app_listener_(nullptr),
55 weak_ptr_factory_(this) {} 56 weak_ptr_factory_(this) {}
56 57
57 PrerenderingOffliner::~PrerenderingOffliner() {} 58 PrerenderingOffliner::~PrerenderingOffliner() {}
58 59
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) { 263 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) {
263 DVLOG(1) << "App became active, canceling current offlining request"; 264 DVLOG(1) << "App became active, canceling current offlining request";
264 SavePageRequest* request = pending_request_.get(); 265 SavePageRequest* request = pending_request_.get();
265 Cancel(); 266 Cancel();
266 completion_callback_.Run(*request, 267 completion_callback_.Run(*request,
267 Offliner::RequestStatus::FOREGROUND_CANCELED); 268 Offliner::RequestStatus::FOREGROUND_CANCELED);
268 } 269 }
269 } 270 }
270 271
271 } // namespace offline_pages 272 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698