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

Side by Side Diff: extensions/browser/guest_view/mime_handler_view/mime_handler_stream_manager.h

Issue 2294653002: Some linked_ptr -> unique_ptr conversion in extensions/browser. (Closed)
Patch Set: address comments Created 4 years, 3 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 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_STREAM_MANA GER_H_ 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_STREAM_MANA GER_H_
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_STREAM_MANA GER_H_ 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_STREAM_MANA GER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 11
12 #include "base/memory/linked_ptr.h"
13 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
14 #include "base/scoped_observer.h" 13 #include "base/scoped_observer.h"
15 #include "components/keyed_service/core/keyed_service.h" 14 #include "components/keyed_service/core/keyed_service.h"
16 #include "extensions/browser/extension_registry_observer.h" 15 #include "extensions/browser/extension_registry_observer.h"
17 16
18 namespace content { 17 namespace content {
19 class BrowserContext; 18 class BrowserContext;
20 } 19 }
21 20
22 namespace extensions { 21 namespace extensions {
(...skipping 22 matching lines...) Expand all
45 // ExtensionRegistryObserver override. 44 // ExtensionRegistryObserver override.
46 void OnExtensionUnloaded(content::BrowserContext* browser_context, 45 void OnExtensionUnloaded(content::BrowserContext* browser_context,
47 const Extension* extension, 46 const Extension* extension,
48 UnloadedExtensionInfo::Reason reason) override; 47 UnloadedExtensionInfo::Reason reason) override;
49 48
50 private: 49 private:
51 class EmbedderObserver; 50 class EmbedderObserver;
52 51
53 // Maps view id->StreamContainer to maintain their lifetime until they are 52 // Maps view id->StreamContainer to maintain their lifetime until they are
54 // used or removed. 53 // used or removed.
55 std::map<std::string, linked_ptr<StreamContainer>> streams_; 54 std::map<std::string, std::unique_ptr<StreamContainer>> streams_;
56 55
57 // Maps extension id->view id for removing the associated streams when an 56 // Maps extension id->view id for removing the associated streams when an
58 // extension is unloaded. 57 // extension is unloaded.
59 std::map<std::string, std::set<std::string>> streams_by_extension_id_; 58 std::map<std::string, std::set<std::string>> streams_by_extension_id_;
60 59
61 // Maps view id->EmbedderObserver for maintaining the lifetime of the 60 // Maps view id->EmbedderObserver for maintaining the lifetime of the
62 // EmbedderObserver until it is removed. 61 // EmbedderObserver until it is removed.
63 std::map<std::string, linked_ptr<EmbedderObserver>> embedder_observers_; 62 std::map<std::string, std::unique_ptr<EmbedderObserver>> embedder_observers_;
64 63
65 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> 64 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
66 extension_registry_observer_; 65 extension_registry_observer_;
67 }; 66 };
68 67
69 } // namespace extensions 68 } // namespace extensions
70 69
71 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_STREAM_M ANAGER_H_ 70 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_STREAM_M ANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698