| 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 #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 |
| 11 namespace extensions { | 11 namespace extensions { |
| 12 | 12 |
| 13 ContentVerifierIOData::ExtensionData::ExtensionData( | 13 ContentVerifierIOData::ExtensionData::ExtensionData( |
| 14 scoped_ptr<std::set<base::FilePath>> browser_image_paths, | 14 std::unique_ptr<std::set<base::FilePath>> browser_image_paths, |
| 15 const base::Version& version) { | 15 const base::Version& version) { |
| 16 this->browser_image_paths = std::move(browser_image_paths); | 16 this->browser_image_paths = std::move(browser_image_paths); |
| 17 this->version = version; | 17 this->version = version; |
| 18 } | 18 } |
| 19 | 19 |
| 20 ContentVerifierIOData::ContentVerifierIOData() { | 20 ContentVerifierIOData::ContentVerifierIOData() { |
| 21 } | 21 } |
| 22 | 22 |
| 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 scoped_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] = linked_ptr<ExtensionData>(data.release()); |
| 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 std::map<std::string, linked_ptr<ExtensionData> >::iterator found = |
| 39 data_map_.find(extension_id); | 39 data_map_.find(extension_id); |
| 40 if (found != data_map_.end()) | 40 if (found != data_map_.end()) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 51 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 51 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 52 std::map<std::string, linked_ptr<ExtensionData> >::iterator found = | 52 std::map<std::string, linked_ptr<ExtensionData> >::iterator found = |
| 53 data_map_.find(extension_id); | 53 data_map_.find(extension_id); |
| 54 if (found != data_map_.end()) | 54 if (found != data_map_.end()) |
| 55 return found->second.get(); | 55 return found->second.get(); |
| 56 else | 56 else |
| 57 return NULL; | 57 return NULL; |
| 58 } | 58 } |
| 59 | 59 |
| 60 } // namespace extensions | 60 } // namespace extensions |
| OLD | NEW |