| OLD | NEW |
| 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/background_loader_offliner.h" | 5 #include "chrome/browser/android/offline_pages/background_loader_offliner.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
| 9 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" | 9 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" |
| 10 #include "chrome/browser/android/offline_pages/offliner_helper.h" | 10 #include "chrome/browser/android/offline_pages/offliner_helper.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 const OfflinerPolicy* policy, | 71 const OfflinerPolicy* policy, |
| 72 OfflinePageModel* offline_page_model) | 72 OfflinePageModel* offline_page_model) |
| 73 : browser_context_(browser_context), | 73 : browser_context_(browser_context), |
| 74 offline_page_model_(offline_page_model), | 74 offline_page_model_(offline_page_model), |
| 75 policy_(policy), | 75 policy_(policy), |
| 76 is_low_end_device_(base::SysInfo::IsLowEndDevice()), | 76 is_low_end_device_(base::SysInfo::IsLowEndDevice()), |
| 77 save_state_(NONE), | 77 save_state_(NONE), |
| 78 page_load_state_(SUCCESS), | 78 page_load_state_(SUCCESS), |
| 79 page_delay_ms_(kOfflinePageDelayMs), | 79 page_delay_ms_(kOfflinePageDelayMs), |
| 80 network_bytes_(0LL), | 80 network_bytes_(0LL), |
| 81 is_low_bar_met_(false), |
| 82 did_snapshot_on_last_retry_(false), |
| 81 weak_ptr_factory_(this) { | 83 weak_ptr_factory_(this) { |
| 82 DCHECK(offline_page_model_); | 84 DCHECK(offline_page_model_); |
| 83 DCHECK(browser_context_); | 85 DCHECK(browser_context_); |
| 84 } | 86 } |
| 85 | 87 |
| 86 BackgroundLoaderOffliner::~BackgroundLoaderOffliner() {} | 88 BackgroundLoaderOffliner::~BackgroundLoaderOffliner() {} |
| 87 | 89 |
| 88 // static | 90 // static |
| 89 BackgroundLoaderOffliner* BackgroundLoaderOffliner::FromWebContents( | 91 BackgroundLoaderOffliner* BackgroundLoaderOffliner::FromWebContents( |
| 90 content::WebContents* contents) { | 92 content::WebContents* contents) { |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 int64_t offline_id) { | 415 int64_t offline_id) { |
| 414 // If for some reason the request was reset during while waiting for callback | 416 // If for some reason the request was reset during while waiting for callback |
| 415 // ignore the completion callback. | 417 // ignore the completion callback. |
| 416 if (pending_request_ && pending_request_->request_id() != offline_id) | 418 if (pending_request_ && pending_request_->request_id() != offline_id) |
| 417 return; | 419 return; |
| 418 completion_callback_.Run(request, RequestStatus::FOREGROUND_CANCELED); | 420 completion_callback_.Run(request, RequestStatus::FOREGROUND_CANCELED); |
| 419 } | 421 } |
| 420 } // namespace offline_pages | 422 } // namespace offline_pages |
| 421 | 423 |
| 422 DEFINE_WEB_CONTENTS_USER_DATA_KEY(offline_pages::OfflinerData); | 424 DEFINE_WEB_CONTENTS_USER_DATA_KEY(offline_pages::OfflinerData); |
| OLD | NEW |