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

Side by Side Diff: chrome/browser/extensions/external_loader.h

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header 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 (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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_LOADER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_LOADER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_LOADER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_LOADER_H_
7 7
8 #include <memory>
9
8 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h"
12 13
13 namespace base { 14 namespace base {
14 class DictionaryValue; 15 class DictionaryValue;
15 } 16 }
16 17
17 namespace extensions { 18 namespace extensions {
18 class ExternalProviderImpl; 19 class ExternalProviderImpl;
19 20
20 // Base class for gathering a list of external extensions. Subclasses 21 // Base class for gathering a list of external extensions. Subclasses
21 // implement loading from registry, JSON file, policy. 22 // implement loading from registry, JSON file, policy.
(...skipping 30 matching lines...) Expand all
52 // are not allowed. 53 // are not allowed.
53 virtual const base::FilePath GetBaseCrxFilePath(); 54 virtual const base::FilePath GetBaseCrxFilePath();
54 55
55 protected: 56 protected:
56 virtual ~ExternalLoader(); 57 virtual ~ExternalLoader();
57 58
58 // Notifies the provider that the list of extensions has been loaded. 59 // Notifies the provider that the list of extensions has been loaded.
59 virtual void LoadFinished(); 60 virtual void LoadFinished();
60 61
61 // Notifies the provider that the list of extensions has been updated. 62 // Notifies the provider that the list of extensions has been updated.
62 virtual void OnUpdated(scoped_ptr<base::DictionaryValue> updated_prefs); 63 virtual void OnUpdated(std::unique_ptr<base::DictionaryValue> updated_prefs);
63 64
64 // Used for passing the list of extensions from the method that loads them 65 // Used for passing the list of extensions from the method that loads them
65 // to |LoadFinished|. To ensure thread safety, the rules are the following: 66 // to |LoadFinished|. To ensure thread safety, the rules are the following:
66 // if this value is written on another thread than the UI, then it should 67 // if this value is written on another thread than the UI, then it should
67 // only be written in a task that was posted from |StartLoading|. After that, 68 // only be written in a task that was posted from |StartLoading|. After that,
68 // this task should invoke |LoadFinished| with a PostTask. This scheme of 69 // this task should invoke |LoadFinished| with a PostTask. This scheme of
69 // posting tasks will avoid concurrent access and imply the necessary memory 70 // posting tasks will avoid concurrent access and imply the necessary memory
70 // barriers. 71 // barriers.
71 scoped_ptr<base::DictionaryValue> prefs_; 72 std::unique_ptr<base::DictionaryValue> prefs_;
72 73
73 private: 74 private:
74 friend class base::RefCountedThreadSafe<ExternalLoader>; 75 friend class base::RefCountedThreadSafe<ExternalLoader>;
75 76
76 ExternalProviderImpl* owner_; // weak 77 ExternalProviderImpl* owner_; // weak
77 78
78 DISALLOW_COPY_AND_ASSIGN(ExternalLoader); 79 DISALLOW_COPY_AND_ASSIGN(ExternalLoader);
79 }; 80 };
80 81
81 } // namespace extensions 82 } // namespace extensions
82 83
83 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_LOADER_H_ 84 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_LOADER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/external_install_manager.cc ('k') | chrome/browser/extensions/external_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698