| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_SUPERVISED_USER_EXPERIMENTAL_SUPERVISED_USER_BLACKLIST_H_ | 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_EXPERIMENTAL_SUPERVISED_USER_BLACKLIST_H_ |
| 6 #define CHROME_BROWSER_SUPERVISED_USER_EXPERIMENTAL_SUPERVISED_USER_BLACKLIST_H_ | 6 #define CHROME_BROWSER_SUPERVISED_USER_EXPERIMENTAL_SUPERVISED_USER_BLACKLIST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <string> | 11 #include <string> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/memory/scoped_ptr.h" | |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/sha1.h" | 17 #include "base/sha1.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class FilePath; | 20 class FilePath; |
| 21 } | 21 } |
| 22 | 22 |
| 23 class GURL; | 23 class GURL; |
| 24 | 24 |
| 25 // Compact list of (SHA1 hashes of) blocked hosts. | 25 // Compact list of (SHA1 hashes of) blocked hosts. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 42 // or not), but not if the SupervisedUserBlacklist is destroyed before that. | 42 // or not), but not if the SupervisedUserBlacklist is destroyed before that. |
| 43 void ReadFromFile(const base::FilePath& path, | 43 void ReadFromFile(const base::FilePath& path, |
| 44 const base::Closure& done_callback); | 44 const base::Closure& done_callback); |
| 45 | 45 |
| 46 bool HasURL(const GURL& url) const; | 46 bool HasURL(const GURL& url) const; |
| 47 | 47 |
| 48 size_t GetEntryCount() const; | 48 size_t GetEntryCount() const; |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 void OnReadFromFileCompleted(const base::Closure& done_callback, | 51 void OnReadFromFileCompleted(const base::Closure& done_callback, |
| 52 scoped_ptr<std::vector<Hash> > host_hashes); | 52 std::unique_ptr<std::vector<Hash>> host_hashes); |
| 53 | 53 |
| 54 std::vector<Hash> host_hashes_; | 54 std::vector<Hash> host_hashes_; |
| 55 | 55 |
| 56 base::WeakPtrFactory<SupervisedUserBlacklist> weak_ptr_factory_; | 56 base::WeakPtrFactory<SupervisedUserBlacklist> weak_ptr_factory_; |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(SupervisedUserBlacklist); | 58 DISALLOW_COPY_AND_ASSIGN(SupervisedUserBlacklist); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 #endif // CHROME_BROWSER_SUPERVISED_USER_EXPERIMENTAL_SUPERVISED_USER_BLACKLIST
_H_ | 61 #endif // CHROME_BROWSER_SUPERVISED_USER_EXPERIMENTAL_SUPERVISED_USER_BLACKLIST
_H_ |
| OLD | NEW |