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/offline_pages/background_loader_offliner.h" | 5 #include "chrome/browser/offline_pages/background_loader_offliner.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 } | 381 } |
382 | 382 |
383 std::unique_ptr<OfflinePageArchiver> archiver( | 383 std::unique_ptr<OfflinePageArchiver> archiver( |
384 new OfflinePageMHTMLArchiver(web_contents)); | 384 new OfflinePageMHTMLArchiver(web_contents)); |
385 | 385 |
386 OfflinePageModel::SavePageParams params; | 386 OfflinePageModel::SavePageParams params; |
387 params.url = web_contents->GetLastCommittedURL(); | 387 params.url = web_contents->GetLastCommittedURL(); |
388 params.client_id = request.client_id(); | 388 params.client_id = request.client_id(); |
389 params.proposed_offline_id = request.request_id(); | 389 params.proposed_offline_id = request.request_id(); |
390 params.is_background = true; | 390 params.is_background = true; |
| 391 params.use_page_problem_detectors = true; |
391 | 392 |
392 // Pass in the original URL if it's different from last committed | 393 // Pass in the original URL if it's different from last committed |
393 // when redirects occur. | 394 // when redirects occur. |
394 if (!request.original_url().is_empty()) | 395 if (!request.original_url().is_empty()) |
395 params.original_url = request.original_url(); | 396 params.original_url = request.original_url(); |
396 else if (params.url != request.url()) | 397 else if (params.url != request.url()) |
397 params.original_url = request.url(); | 398 params.original_url = request.url(); |
398 | 399 |
399 offline_page_model_->SavePage( | 400 offline_page_model_->SavePage( |
400 params, std::move(archiver), | 401 params, std::move(archiver), |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 // Given the choice between int and double, we choose to implicitly convert to | 490 // Given the choice between int and double, we choose to implicitly convert to |
490 // a double since it maintains more precision (we can get a longer time in | 491 // a double since it maintains more precision (we can get a longer time in |
491 // milliseconds than we can with a 2 bit int, 53 bits vs 32). | 492 // milliseconds than we can with a 2 bit int, 53 bits vs 32). |
492 double delay = delay_so_far.InMilliseconds(); | 493 double delay = delay_so_far.InMilliseconds(); |
493 signal_data_.SetDouble(signal_name, delay); | 494 signal_data_.SetDouble(signal_name, delay); |
494 } | 495 } |
495 | 496 |
496 } // namespace offline_pages | 497 } // namespace offline_pages |
497 | 498 |
498 DEFINE_WEB_CONTENTS_USER_DATA_KEY(offline_pages::OfflinerData); | 499 DEFINE_WEB_CONTENTS_USER_DATA_KEY(offline_pages::OfflinerData); |
OLD | NEW |