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

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

Issue 2363623002: Remove SecurityStateModel memoization (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/offline_page_mhtml_archiver.h" 5 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 base::Bind(callback_, this, ArchiverResult::SUCCESSFULLY_CREATED, url, 157 base::Bind(callback_, this, ArchiverResult::SUCCESSFULLY_CREATED, url,
158 file_path, title, file_size)); 158 file_path, title, file_size));
159 } 159 }
160 } 160 }
161 161
162 bool OfflinePageMHTMLArchiver::HasConnectionSecurityError() { 162 bool OfflinePageMHTMLArchiver::HasConnectionSecurityError() {
163 ChromeSecurityStateModelClient::CreateForWebContents(web_contents_); 163 ChromeSecurityStateModelClient::CreateForWebContents(web_contents_);
164 ChromeSecurityStateModelClient* model_client = 164 ChromeSecurityStateModelClient* model_client =
165 ChromeSecurityStateModelClient::FromWebContents(web_contents_); 165 ChromeSecurityStateModelClient::FromWebContents(web_contents_);
166 DCHECK(model_client); 166 DCHECK(model_client);
167 security_state::SecurityStateModel::SecurityInfo security_info;
168 model_client->GetSecurityInfo(&security_info);
167 return security_state::SecurityStateModel::SecurityLevel::SECURITY_ERROR == 169 return security_state::SecurityStateModel::SecurityLevel::SECURITY_ERROR ==
168 model_client->GetSecurityInfo().security_level; 170 security_info.security_level;
169 } 171 }
170 172
171 void OfflinePageMHTMLArchiver::ReportFailure(ArchiverResult result) { 173 void OfflinePageMHTMLArchiver::ReportFailure(ArchiverResult result) {
172 DCHECK(result != ArchiverResult::SUCCESSFULLY_CREATED); 174 DCHECK(result != ArchiverResult::SUCCESSFULLY_CREATED);
173 base::ThreadTaskRunnerHandle::Get()->PostTask( 175 base::ThreadTaskRunnerHandle::Get()->PostTask(
174 FROM_HERE, base::Bind(callback_, this, result, GURL(), base::FilePath(), 176 FROM_HERE, base::Bind(callback_, this, result, GURL(), base::FilePath(),
175 base::string16(), 0)); 177 base::string16(), 0));
176 } 178 }
177 179
178 } // namespace offline_pages 180 } // namespace offline_pages
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698