| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 // A library to manage RLZ information for access-points shared | 5 // A library to manage RLZ information for access-points shared |
| 6 // across different client applications. | 6 // across different client applications. |
| 7 | 7 |
| 8 #include "rlz/lib/rlz_lib.h" | 8 #include "rlz/lib/rlz_lib.h" |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| 11 #include <aclapi.h> | 11 #include <aclapi.h> |
| 12 #include <stddef.h> | 12 #include <stddef.h> |
| 13 #include <winerror.h> | 13 #include <winerror.h> |
| 14 | 14 |
| 15 #include <memory> |
| 16 |
| 15 #include "base/win/registry.h" | 17 #include "base/win/registry.h" |
| 16 #include "rlz/lib/assert.h" | 18 #include "rlz/lib/assert.h" |
| 17 #include "rlz/lib/rlz_value_store.h" | 19 #include "rlz/lib/rlz_value_store.h" |
| 18 #include "rlz/win/lib/machine_deal.h" | 20 #include "rlz/win/lib/machine_deal.h" |
| 19 #include "rlz/win/lib/rlz_value_store_registry.h" | 21 #include "rlz/win/lib/rlz_value_store_registry.h" |
| 20 | 22 |
| 21 namespace rlz_lib { | 23 namespace rlz_lib { |
| 22 | 24 |
| 23 // OEM Deal confirmation storage functions. | 25 // OEM Deal confirmation storage functions. |
| 24 | 26 |
| 25 template<class T> | 27 template<class T> |
| 26 class typed_buffer_ptr { | 28 class typed_buffer_ptr { |
| 27 scoped_ptr<char[]> buffer_; | 29 std::unique_ptr<char[]> buffer_; |
| 28 | 30 |
| 29 public: | 31 public: |
| 30 typed_buffer_ptr() { | 32 typed_buffer_ptr() { |
| 31 } | 33 } |
| 32 | 34 |
| 33 explicit typed_buffer_ptr(size_t size) : buffer_(new char[size]) { | 35 explicit typed_buffer_ptr(size_t size) : buffer_(new char[size]) { |
| 34 } | 36 } |
| 35 | 37 |
| 36 void reset(size_t size) { | 38 void reset(size_t size) { |
| 37 buffer_.reset(new char[size]); | 39 buffer_.reset(new char[size]); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 return MachineDealCode::Get(dcc, dcc_size); | 202 return MachineDealCode::Get(dcc, dcc_size); |
| 201 } | 203 } |
| 202 | 204 |
| 203 // Combined functions. | 205 // Combined functions. |
| 204 | 206 |
| 205 bool SetMachineDealCodeFromPingResponse(const char* response) { | 207 bool SetMachineDealCodeFromPingResponse(const char* response) { |
| 206 return MachineDealCode::SetFromPingResponse(response); | 208 return MachineDealCode::SetFromPingResponse(response); |
| 207 } | 209 } |
| 208 | 210 |
| 209 } // namespace rlz_lib | 211 } // namespace rlz_lib |
| OLD | NEW |