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

Side by Side Diff: extensions/browser/api/socket/app_firewall_hole_manager.cc

Issue 2236443003: extensions: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't add braces Created 4 years, 4 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 #include "extensions/browser/api/socket/app_firewall_hole_manager.h" 5 #include "extensions/browser/api/socket/app_firewall_hole_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 firewall_hole_ = std::move(firewall_hole); 103 firewall_hole_ = std::move(firewall_hole);
104 } 104 }
105 } 105 }
106 106
107 AppFirewallHoleManager::AppFirewallHoleManager(BrowserContext* context) 107 AppFirewallHoleManager::AppFirewallHoleManager(BrowserContext* context)
108 : context_(context), observer_(this) { 108 : context_(context), observer_(this) {
109 observer_.Add(AppWindowRegistry::Get(context)); 109 observer_.Add(AppWindowRegistry::Get(context));
110 } 110 }
111 111
112 AppFirewallHoleManager::~AppFirewallHoleManager() { 112 AppFirewallHoleManager::~AppFirewallHoleManager() {
113 STLDeleteValues(&tracked_holes_); 113 base::STLDeleteValues(&tracked_holes_);
114 } 114 }
115 115
116 AppFirewallHoleManager* AppFirewallHoleManager::Get(BrowserContext* context) { 116 AppFirewallHoleManager* AppFirewallHoleManager::Get(BrowserContext* context) {
117 return AppFirewallHoleManagerFactory::GetForBrowserContext(context, true); 117 return AppFirewallHoleManagerFactory::GetForBrowserContext(context, true);
118 } 118 }
119 119
120 std::unique_ptr<AppFirewallHole> AppFirewallHoleManager::Open( 120 std::unique_ptr<AppFirewallHole> AppFirewallHoleManager::Open(
121 AppFirewallHole::PortType type, 121 AppFirewallHole::PortType type,
122 uint16_t port, 122 uint16_t port,
123 const std::string& extension_id) { 123 const std::string& extension_id) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 void AppFirewallHoleManager::OnAppWindowShown(AppWindow* app_window, 158 void AppFirewallHoleManager::OnAppWindowShown(AppWindow* app_window,
159 bool was_hidden) { 159 bool was_hidden) {
160 const auto& range = tracked_holes_.equal_range(app_window->extension_id()); 160 const auto& range = tracked_holes_.equal_range(app_window->extension_id());
161 for (auto iter = range.first; iter != range.second; ++iter) { 161 for (auto iter = range.first; iter != range.second; ++iter) {
162 iter->second->SetVisible(true); 162 iter->second->SetVisible(true);
163 } 163 }
164 } 164 }
165 165
166 } // namespace extensions 166 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698