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

Side by Side Diff: components/password_manager/core/browser/hsts_query.cc

Issue 2714543006: Clean Obsolete HTTP Data from the Password Store (Closed)
Patch Set: Raw Cleaner 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/password_manager/core/browser/hsts_query.h"
6 #include "base/bind.h"
7 #include "base/location.h"
8 #include "base/task_runner_util.h"
9 #include "net/url_request/url_request_context.h"
10 #include "url/gurl.h"
11
12 namespace password_manager {
13
14 namespace {
15
16 bool IsHSTSActiveForHostAndRequestContext(
17 const GURL& origin,
18 const scoped_refptr<net::URLRequestContextGetter>& request_context) {
19 if (!origin.is_valid())
20 return false;
21
22 net::TransportSecurityState* security_state =
23 request_context->GetURLRequestContext()->transport_security_state();
24
25 if (!security_state)
26 return false;
27
28 return security_state->ShouldUpgradeToSSL(origin.host());
29 }
30
31 } // namespace
32
33 void PostHSTSQueryForHostAndRequestContext(
34 const GURL& origin,
35 const scoped_refptr<net::URLRequestContextGetter>& request_context,
36 const HSTSCallback& callback) {
37 base::PostTaskAndReplyWithResult(
38 request_context->GetNetworkTaskRunner().get(), FROM_HERE,
39 base::Bind(&IsHSTSActiveForHostAndRequestContext, origin,
40 request_context),
41 callback);
42 }
43
44 } // namespace password_manager
OLDNEW
« no previous file with comments | « components/password_manager/core/browser/hsts_query.h ('k') | components/password_manager/core/browser/hsts_query_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698