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

Side by Side Diff: net/ssl/threaded_ssl_private_key.cc

Issue 1422573008: Plumbing SSLPrivateKey (//net) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing un-needed forward decl. Created 5 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
« no previous file with comments | « net/ssl/threaded_ssl_private_key.h ('k') | net/url_request/url_fetcher_core.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 "net/ssl/threaded_ssl_private_key.h" 5 #include "net/ssl/threaded_ssl_private_key.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 }; 48 };
49 49
50 ThreadedSSLPrivateKey::ThreadedSSLPrivateKey( 50 ThreadedSSLPrivateKey::ThreadedSSLPrivateKey(
51 scoped_ptr<ThreadedSSLPrivateKey::Delegate> delegate, 51 scoped_ptr<ThreadedSSLPrivateKey::Delegate> delegate,
52 scoped_refptr<base::TaskRunner> task_runner) 52 scoped_refptr<base::TaskRunner> task_runner)
53 : core_(new Core(delegate.Pass())), 53 : core_(new Core(delegate.Pass())),
54 task_runner_(task_runner.Pass()), 54 task_runner_(task_runner.Pass()),
55 weak_factory_(this) { 55 weak_factory_(this) {
56 } 56 }
57 57
58 ThreadedSSLPrivateKey::~ThreadedSSLPrivateKey() {
59 }
60
61 SSLPrivateKey::Type ThreadedSSLPrivateKey::GetType() { 58 SSLPrivateKey::Type ThreadedSSLPrivateKey::GetType() {
62 return core_->delegate()->GetType(); 59 return core_->delegate()->GetType();
63 } 60 }
64 61
65 std::vector<SSLPrivateKey::Hash> ThreadedSSLPrivateKey::GetDigestPreferences() { 62 std::vector<SSLPrivateKey::Hash> ThreadedSSLPrivateKey::GetDigestPreferences() {
66 return core_->delegate()->GetDigestPreferences(); 63 return core_->delegate()->GetDigestPreferences();
67 } 64 }
68 65
69 size_t ThreadedSSLPrivateKey::GetMaxSignatureLengthInBytes() { 66 size_t ThreadedSSLPrivateKey::GetMaxSignatureLengthInBytes() {
70 return core_->delegate()->GetMaxSignatureLengthInBytes(); 67 return core_->delegate()->GetMaxSignatureLengthInBytes();
71 } 68 }
72 69
73 void ThreadedSSLPrivateKey::SignDigest( 70 void ThreadedSSLPrivateKey::SignDigest(
74 SSLPrivateKey::Hash hash, 71 SSLPrivateKey::Hash hash,
75 const base::StringPiece& input, 72 const base::StringPiece& input,
76 const SSLPrivateKey::SignCallback& callback) { 73 const SSLPrivateKey::SignCallback& callback) {
77 std::vector<uint8_t>* signature = new std::vector<uint8_t>; 74 std::vector<uint8_t>* signature = new std::vector<uint8_t>;
78 base::PostTaskAndReplyWithResult( 75 base::PostTaskAndReplyWithResult(
79 task_runner_.get(), FROM_HERE, 76 task_runner_.get(), FROM_HERE,
80 base::Bind(&ThreadedSSLPrivateKey::Core::SignDigest, core_, hash, 77 base::Bind(&ThreadedSSLPrivateKey::Core::SignDigest, core_, hash,
81 input.as_string(), base::Unretained(signature)), 78 input.as_string(), base::Unretained(signature)),
82 base::Bind(&DoCallback, weak_factory_.GetWeakPtr(), callback, 79 base::Bind(&DoCallback, weak_factory_.GetWeakPtr(), callback,
83 base::Owned(signature))); 80 base::Owned(signature)));
84 } 81 }
85 82
83 ThreadedSSLPrivateKey::~ThreadedSSLPrivateKey() {}
84
86 } // namespace net 85 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/threaded_ssl_private_key.h ('k') | net/url_request/url_fetcher_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698