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

Side by Side Diff: components/offline_pages/core/offline_page_model_impl.cc

Issue 2810913002: [Offline pages] Add new Error page failure status inside the MHTML archiver and update correspondin… (Closed)
Patch Set: add comments and fix tests Created 3 years, 8 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 "components/offline_pages/core/offline_page_model_impl.h" 5 #include "components/offline_pages/core/offline_page_model_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 break; 65 break;
66 case ArchiverResult::ERROR_ARCHIVE_CREATION_FAILED: 66 case ArchiverResult::ERROR_ARCHIVE_CREATION_FAILED:
67 result = SavePageResult::ARCHIVE_CREATION_FAILED; 67 result = SavePageResult::ARCHIVE_CREATION_FAILED;
68 break; 68 break;
69 case ArchiverResult::ERROR_CANCELED: 69 case ArchiverResult::ERROR_CANCELED:
70 result = SavePageResult::CANCELLED; 70 result = SavePageResult::CANCELLED;
71 break; 71 break;
72 case ArchiverResult::ERROR_SECURITY_CERTIFICATE: 72 case ArchiverResult::ERROR_SECURITY_CERTIFICATE:
73 result = SavePageResult::SECURITY_CERTIFICATE_ERROR; 73 result = SavePageResult::SECURITY_CERTIFICATE_ERROR;
74 break; 74 break;
75 case ArchiverResult::ERROR_ERROR_PAGE:
76 result = SavePageResult::ERROR_PAGE;
77 break;
78 case ArchiverResult::ERROR_INTERSTITIAL_PAGE:
79 result = SavePageResult::INTERSTITIAL_PAGE;
75 default: 80 default:
76 NOTREACHED(); 81 NOTREACHED();
77 result = SavePageResult::CONTENT_UNAVAILABLE; 82 result = SavePageResult::CONTENT_UNAVAILABLE;
78 } 83 }
79 return result; 84 return result;
80 } 85 }
81 86
82 std::string AddHistogramSuffix(const ClientId& client_id, 87 std::string AddHistogramSuffix(const ClientId& client_id,
83 const char* histogram_name) { 88 const char* histogram_name) {
84 if (client_id.name_space.empty()) { 89 if (client_id.name_space.empty()) {
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 } 1092 }
1088 1093
1089 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, task); 1094 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, task);
1090 } 1095 }
1091 1096
1092 base::Time OfflinePageModelImpl::GetCurrentTime() const { 1097 base::Time OfflinePageModelImpl::GetCurrentTime() const {
1093 return testing_clock_ ? testing_clock_->Now() : base::Time::Now(); 1098 return testing_clock_ ? testing_clock_->Now() : base::Time::Now();
1094 } 1099 }
1095 1100
1096 } // namespace offline_pages 1101 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/core/offline_page_archiver.h ('k') | components/offline_pages/core/offline_page_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698