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

Side by Side Diff: remoting/host/host_key_pair.cc

Issue 3654001: Revert 61899 for breaking cookes on file:// URLs.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « media/filters/omx_video_decoder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "remoting/host/host_key_pair.h" 5 #include "remoting/host/host_key_pair.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return false; 48 return false;
49 } 49 }
50 return LoadFromString(key_base64); 50 return LoadFromString(key_base64);
51 } 51 }
52 52
53 void HostKeyPair::Save(MutableHostConfig* host_config) { 53 void HostKeyPair::Save(MutableHostConfig* host_config) {
54 // Check that the key initialized. 54 // Check that the key initialized.
55 DCHECK(key_.get() != NULL); 55 DCHECK(key_.get() != NULL);
56 56
57 host_config->Update( 57 host_config->Update(
58 NewRunnableMethod(this, 58 NewRunnableMethod(this, &HostKeyPair::DoSave, host_config));
59 &HostKeyPair::DoSave,
60 make_scoped_refptr(host_config)));
61 } 59 }
62 60
63 void HostKeyPair::DoSave(MutableHostConfig* host_config) const { 61 void HostKeyPair::DoSave(MutableHostConfig* host_config) const {
64 std::vector<uint8> key_buf; 62 std::vector<uint8> key_buf;
65 key_->ExportPrivateKey(&key_buf); 63 key_->ExportPrivateKey(&key_buf);
66 std::string key_str(key_buf.begin(), key_buf.end()); 64 std::string key_str(key_buf.begin(), key_buf.end());
67 std::string key_base64; 65 std::string key_base64;
68 base::Base64Encode(key_str, &key_base64); 66 base::Base64Encode(key_str, &key_base64);
69 host_config->SetString(kPrivateKeyConfigPath, key_base64); 67 host_config->SetString(kPrivateKeyConfigPath, key_base64);
70 } 68 }
(...skipping 14 matching lines...) Expand all
85 message.length()); 83 message.length());
86 std::vector<uint8> signature_buf; 84 std::vector<uint8> signature_buf;
87 signature_creator->Final(&signature_buf); 85 signature_creator->Final(&signature_buf);
88 std::string signature_str(signature_buf.begin(), signature_buf.end()); 86 std::string signature_str(signature_buf.begin(), signature_buf.end());
89 std::string signature_base64; 87 std::string signature_base64;
90 base::Base64Encode(signature_str, &signature_base64); 88 base::Base64Encode(signature_str, &signature_base64);
91 return signature_base64; 89 return signature_base64;
92 } 90 }
93 91
94 } // namespace remoting 92 } // namespace remoting
OLDNEW
« no previous file with comments | « media/filters/omx_video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698