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

Side by Side Diff: net/quic/crypto/channel_id_chromium.cc

Issue 1223983002: Move WriteInto to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « net/proxy/proxy_resolver_v8.cc ('k') | pdf/pdfium/pdfium_api_string_buffer_adapter.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/quic/crypto/channel_id_chromium.h" 5 #include "net/quic/crypto/channel_id_chromium.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 26 matching lines...) Expand all
37 memcpy(&data[len1], ChannelIDVerifier::kClientToServerStr, len2); 37 memcpy(&data[len1], ChannelIDVerifier::kClientToServerStr, len2);
38 memcpy(&data[len1 + len2], signed_data.data(), signed_data.size()); 38 memcpy(&data[len1 + len2], signed_data.data(), signed_data.size());
39 std::vector<uint8> der_signature; 39 std::vector<uint8> der_signature;
40 if (!sig_creator->Sign(&data[0], data.size(), &der_signature)) { 40 if (!sig_creator->Sign(&data[0], data.size(), &der_signature)) {
41 return false; 41 return false;
42 } 42 }
43 std::vector<uint8> raw_signature; 43 std::vector<uint8> raw_signature;
44 if (!sig_creator->DecodeSignature(der_signature, &raw_signature)) { 44 if (!sig_creator->DecodeSignature(der_signature, &raw_signature)) {
45 return false; 45 return false;
46 } 46 }
47 memcpy(WriteInto(out_signature, raw_signature.size() + 1), 47 memcpy(base::WriteInto(out_signature, raw_signature.size() + 1),
48 &raw_signature[0], raw_signature.size()); 48 &raw_signature[0], raw_signature.size());
49 return true; 49 return true;
50 } 50 }
51 51
52 std::string ChannelIDKeyChromium::SerializeKey() const { 52 std::string ChannelIDKeyChromium::SerializeKey() const {
53 std::string out_key; 53 std::string out_key;
54 if (!ec_private_key_->ExportRawPublicKey(&out_key)) { 54 if (!ec_private_key_->ExportRawPublicKey(&out_key)) {
55 return std::string(); 55 return std::string();
56 } 56 }
57 return out_key; 57 return out_key;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 return status; 224 return status;
225 } 225 }
226 226
227 void ChannelIDSourceChromium::OnJobComplete(Job* job) { 227 void ChannelIDSourceChromium::OnJobComplete(Job* job) {
228 active_jobs_.erase(job); 228 active_jobs_.erase(job);
229 delete job; 229 delete job;
230 } 230 }
231 231
232 } // namespace net 232 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_resolver_v8.cc ('k') | pdf/pdfium/pdfium_api_string_buffer_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698