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

Side by Side Diff: chrome/browser/content_settings/host_content_settings_map_unittest.cc

Issue 1918083002: Convert //components/[f-n]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: … Created 4 years, 7 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 #include <memory> 5 #include <memory>
6 #include <string> 6 #include <string>
7 7
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 ContentSettingsPattern::FromString(exception); 92 ContentSettingsPattern::FromString(exception);
93 host_content_settings_map_->SetContentSettingCustomScope( 93 host_content_settings_map_->SetContentSettingCustomScope(
94 pattern, pattern, content_type_, std::string(), content_settings); 94 pattern, pattern, content_type_, std::string(), content_settings);
95 } 95 }
96 96
97 // Wrapper to query GetWebsiteSetting(), and only return the source. 97 // Wrapper to query GetWebsiteSetting(), and only return the source.
98 content_settings::SettingSource GetSettingSourceForURL( 98 content_settings::SettingSource GetSettingSourceForURL(
99 const std::string& url_str) { 99 const std::string& url_str) {
100 GURL url(url_str); 100 GURL url(url_str);
101 content_settings::SettingInfo setting_info; 101 content_settings::SettingInfo setting_info;
102 scoped_ptr<base::Value> result = 102 std::unique_ptr<base::Value> result =
103 host_content_settings_map_->GetWebsiteSetting( 103 host_content_settings_map_->GetWebsiteSetting(
104 url, url, content_type_, std::string(), 104 url, url, content_type_, std::string(), &setting_info);
105 &setting_info);
106 return setting_info.source; 105 return setting_info.source;
107 }; 106 };
108 107
109 private: 108 private:
110 syncable_prefs::TestingPrefServiceSyncable* prefs_; 109 syncable_prefs::TestingPrefServiceSyncable* prefs_;
111 HostContentSettingsMap* host_content_settings_map_; 110 HostContentSettingsMap* host_content_settings_map_;
112 ContentSettingsType content_type_; 111 ContentSettingsType content_type_;
113 const char* policy_default_setting_; 112 const char* policy_default_setting_;
114 113
115 DISALLOW_COPY_AND_ASSIGN(TesterForType); 114 DISALLOW_COPY_AND_ASSIGN(TesterForType);
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 host, host, CONTENT_SETTINGS_TYPE_KEYGEN, std::string())); 1312 host, host, CONTENT_SETTINGS_TYPE_KEYGEN, std::string()));
1314 1313
1315 // After migrating old settings, changes to the setting works. 1314 // After migrating old settings, changes to the setting works.
1316 host_content_settings_map->SetContentSettingDefaultScope( 1315 host_content_settings_map->SetContentSettingDefaultScope(
1317 host, GURL(), CONTENT_SETTINGS_TYPE_KEYGEN, std::string(), 1316 host, GURL(), CONTENT_SETTINGS_TYPE_KEYGEN, std::string(),
1318 CONTENT_SETTING_BLOCK); 1317 CONTENT_SETTING_BLOCK);
1319 EXPECT_EQ(CONTENT_SETTING_BLOCK, 1318 EXPECT_EQ(CONTENT_SETTING_BLOCK,
1320 host_content_settings_map->GetContentSetting( 1319 host_content_settings_map->GetContentSetting(
1321 host, host, CONTENT_SETTINGS_TYPE_KEYGEN, std::string())); 1320 host, host, CONTENT_SETTINGS_TYPE_KEYGEN, std::string()));
1322 } 1321 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/net/wake_on_wifi_manager_unittest.cc ('k') | chrome/browser/net/nss_context_chromeos_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698