| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/base64.h" | 5 #include "base/base64.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/metrics/sparse_histogram.h" | 9 #include "base/metrics/sparse_histogram.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 V4Store::V4Store(const scoped_refptr<base::SequencedTaskRunner>& task_runner, | 60 V4Store::V4Store(const scoped_refptr<base::SequencedTaskRunner>& task_runner, |
| 61 const base::FilePath& store_path) | 61 const base::FilePath& store_path) |
| 62 : store_path_(store_path), task_runner_(task_runner) {} | 62 : store_path_(store_path), task_runner_(task_runner) {} |
| 63 | 63 |
| 64 V4Store::~V4Store() {} | 64 V4Store::~V4Store() {} |
| 65 | 65 |
| 66 std::string V4Store::DebugString() const { | 66 std::string V4Store::DebugString() const { |
| 67 std::string state_base64; | 67 std::string state_base64; |
| 68 base::Base64Encode(state_, &state_base64); | 68 base::Base64Encode(state_, &state_base64); |
| 69 | 69 |
| 70 return base::StringPrintf("path: %s; state: %s", store_path_.value().c_str(), | 70 return base::StringPrintf("path: %" PRIsFP "; state: %s", |
| 71 state_base64.c_str()); | 71 store_path_.value().c_str(), state_base64.c_str()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool V4Store::Reset() { | 74 bool V4Store::Reset() { |
| 75 // TODO(vakh): Implement skeleton. | 75 // TODO(vakh): Implement skeleton. |
| 76 state_ = ""; | 76 state_ = ""; |
| 77 return true; | 77 return true; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void V4Store::ApplyUpdate( | 80 void V4Store::ApplyUpdate( |
| 81 std::unique_ptr<ListUpdateResponse> response, | 81 std::unique_ptr<ListUpdateResponse> response, |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 if (!base::Move(new_filename, store_path_)) { | 175 if (!base::Move(new_filename, store_path_)) { |
| 176 DVLOG(1) << "store_path_: " << store_path_.value(); | 176 DVLOG(1) << "store_path_: " << store_path_.value(); |
| 177 return UNABLE_TO_RENAME_FAILURE; | 177 return UNABLE_TO_RENAME_FAILURE; |
| 178 } | 178 } |
| 179 | 179 |
| 180 return WRITE_SUCCESS; | 180 return WRITE_SUCCESS; |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace safe_browsing | 183 } // namespace safe_browsing |
| OLD | NEW |