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

Side by Side Diff: extensions/browser/content_verifier_io_data.cc

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 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 #include "extensions/browser/content_verifier_io_data.h" 5 #include "extensions/browser/content_verifier_io_data.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
(...skipping 12 matching lines...) Expand all
23 ContentVerifierIOData::ExtensionData::~ExtensionData() { 23 ContentVerifierIOData::ExtensionData::~ExtensionData() {
24 } 24 }
25 25
26 ContentVerifierIOData::~ContentVerifierIOData() { 26 ContentVerifierIOData::~ContentVerifierIOData() {
27 } 27 }
28 28
29 void ContentVerifierIOData::AddData(const std::string& extension_id, 29 void ContentVerifierIOData::AddData(const std::string& extension_id,
30 std::unique_ptr<ExtensionData> data) { 30 std::unique_ptr<ExtensionData> data) {
31 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 31 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
32 CHECK(data->browser_image_paths.get()); 32 CHECK(data->browser_image_paths.get());
33 data_map_[extension_id] = linked_ptr<ExtensionData>(data.release()); 33 data_map_[extension_id] = std::move(data);
34 } 34 }
35 35
36 void ContentVerifierIOData::RemoveData(const std::string& extension_id) { 36 void ContentVerifierIOData::RemoveData(const std::string& extension_id) {
37 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 37 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
38 std::map<std::string, linked_ptr<ExtensionData> >::iterator found = 38 data_map_.erase(extension_id);
39 data_map_.find(extension_id);
40 if (found != data_map_.end())
41 data_map_.erase(found);
42 } 39 }
43 40
44 void ContentVerifierIOData::Clear() { 41 void ContentVerifierIOData::Clear() {
45 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 42 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
46 data_map_.clear(); 43 data_map_.clear();
47 } 44 }
48 45
49 const ContentVerifierIOData::ExtensionData* ContentVerifierIOData::GetData( 46 const ContentVerifierIOData::ExtensionData* ContentVerifierIOData::GetData(
50 const std::string& extension_id) { 47 const std::string& extension_id) {
51 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 48 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
52 std::map<std::string, linked_ptr<ExtensionData> >::iterator found = 49 std::map<std::string, std::unique_ptr<ExtensionData>>::iterator found =
53 data_map_.find(extension_id); 50 data_map_.find(extension_id);
54 if (found != data_map_.end()) 51 if (found != data_map_.end())
55 return found->second.get(); 52 return found->second.get();
56 else 53 else
57 return NULL; 54 return NULL;
58 } 55 }
59 56
60 } // namespace extensions 57 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/content_verifier_io_data.h ('k') | extensions/browser/declarative_user_script_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698