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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/platform_state_store.h

Issue 1870003002: Convert //chrome/browser/safe_browsing from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and address comments Created 4 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 // An interface to platform-specific storage of IncidentReportingService prune 5 // An interface to platform-specific storage of IncidentReportingService prune
6 // state. 6 // state.
7 7
8 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PLATFORM_STATE_STORE_H_ 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PLATFORM_STATE_STORE_H_
9 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PLATFORM_STATE_STORE_H_ 9 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PLATFORM_STATE_STORE_H_
10 10
11 #include <stdint.h> 11 #include <stdint.h>
12
13 #include <memory>
12 #include <string> 14 #include <string>
13 15
14 #include "base/memory/scoped_ptr.h"
15 #include "build/build_config.h" 16 #include "build/build_config.h"
16 17
17 // Certain platforms provide their own storage of protobuf-serialized prune 18 // Certain platforms provide their own storage of protobuf-serialized prune
18 // state. On platforms where it is not supported, Load() and Store() are noops. 19 // state. On platforms where it is not supported, Load() and Store() are noops.
19 #if defined(OS_WIN) 20 #if defined(OS_WIN)
20 // Store the state in the registry on Windows. 21 // Store the state in the registry on Windows.
21 #define USE_PLATFORM_STATE_STORE 22 #define USE_PLATFORM_STATE_STORE
22 #endif 23 #endif
23 24
24 class Profile; 25 class Profile;
25 26
26 namespace base { 27 namespace base {
27 class DictionaryValue; 28 class DictionaryValue;
28 } 29 }
29 30
30 namespace safe_browsing { 31 namespace safe_browsing {
31 namespace platform_state_store { 32 namespace platform_state_store {
32 33
33 // Loads the platform-specific storage for |profile|. Returns null if there is 34 // Loads the platform-specific storage for |profile|. Returns null if there is
34 // no such storage for the current platform or in case of error; otherwise, a 35 // no such storage for the current platform or in case of error; otherwise, a
35 // (possibly empty) dictionary. 36 // (possibly empty) dictionary.
36 scoped_ptr<base::DictionaryValue> Load(Profile* profile); 37 std::unique_ptr<base::DictionaryValue> Load(Profile* profile);
37 38
38 // Stores the state for |profile| in |incidents_sent| into platform-specific 39 // Stores the state for |profile| in |incidents_sent| into platform-specific
39 // storage if there is such for the current platform. 40 // storage if there is such for the current platform.
40 void Store(Profile* profile, const base::DictionaryValue* incidents_sent); 41 void Store(Profile* profile, const base::DictionaryValue* incidents_sent);
41 42
42 #if defined(USE_PLATFORM_STATE_STORE) 43 #if defined(USE_PLATFORM_STATE_STORE)
43 44
44 // All declarations and definitions from this point forward are for use by 45 // All declarations and definitions from this point forward are for use by
45 // implementations in platform-specific source files, or are exposed for the 46 // implementations in platform-specific source files, or are exposed for the
46 // sake of testing. 47 // sake of testing.
(...skipping 29 matching lines...) Expand all
76 PlatformStateStoreLoadResult DeserializeIncidentsSent( 77 PlatformStateStoreLoadResult DeserializeIncidentsSent(
77 const std::string& data, 78 const std::string& data,
78 base::DictionaryValue* value_dict); 79 base::DictionaryValue* value_dict);
79 80
80 #endif // USE_PLATFORM_STATE_STORE 81 #endif // USE_PLATFORM_STATE_STORE
81 82
82 } // namespace platform_state_store 83 } // namespace platform_state_store
83 } // namespace safe_browsing 84 } // namespace safe_browsing
84 85
85 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PLATFORM_STATE_STORE_ H_ 86 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_PLATFORM_STATE_STORE_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698