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

Side by Side Diff: chrome/browser/ssl/ssl_add_certificate.cc

Issue 11266008: Fix certificate and keychain installation on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: move some code to chrome/browser/ssl/ Created 8 years, 1 month 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 (c) 2012 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 "chrome/browser/ssl/ssl_add_certificate.h"
6
7 #include "chrome/browser/ssl/ssl_add_cert_handler.h"
8 #include "net/base/x509_certificate.h"
9
10 void chrome::SSLAddCertificate(
darin (slow to review) 2012/11/26 19:53:43 nit: use "namespace chrome {" instead.
digit1 2012/11/26 21:41:35 Done.
11 net::URLRequest* request,
12 net::CertificateType cert_type,
13 const void* cert_data,
14 size_t cert_size,
15 int render_process_id,
16 int render_view_id) {
17 // Chromium only supports X.509 User certificates on non-Android
18 // platforms. Note that this method should not be called for other
19 // certificate types. See net::GetCertificateTypeFromMimeType().
20 if (cert_type == net::CERTIFICATE_TYPE_X509_USER_CERT) {
darin (slow to review) 2012/11/26 19:53:43 nit: how about returning early when cert_type is n
digit1 2012/11/26 21:41:35 Done.
21 scoped_refptr<net::X509Certificate> cert;
22 if (cert_data != NULL) {
23 cert = net::X509Certificate::CreateFromBytes(
darin (slow to review) 2012/11/26 19:53:43 nit: indentation is wrong here
digit1 2012/11/26 21:41:35 Done.
24 reinterpret_cast<const char*>(cert_data), cert_size);
25 }
26 // NOTE: Passing a NULL cert pointer if |cert_data| was NULL is
27 // intentional here.
28
29 // The handler will run the UI and delete itself when it's finished.
30 new SSLAddCertHandler(request, cert, render_process_id, render_view_id);
31 }
32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698