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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_api_helpers.cc

Issue 16295003: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | Annotate | Revision Log
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 "chrome/browser/extensions/api/web_request/web_request_api_helpers.h" 5 #include "chrome/browser/extensions/api/web_request/web_request_api_helpers.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 } 1256 }
1257 1257
1258 void NotifyWebRequestAPIUsed( 1258 void NotifyWebRequestAPIUsed(
1259 void* profile_id, 1259 void* profile_id,
1260 scoped_refptr<const extensions::Extension> extension) { 1260 scoped_refptr<const extensions::Extension> extension) {
1261 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 1261 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
1262 Profile* profile = reinterpret_cast<Profile*>(profile_id); 1262 Profile* profile = reinterpret_cast<Profile*>(profile_id);
1263 if (!g_browser_process->profile_manager()->IsValidProfile(profile)) 1263 if (!g_browser_process->profile_manager()->IsValidProfile(profile))
1264 return; 1264 return;
1265 1265
1266 if (profile->GetExtensionService()->HasUsedWebRequest(extension)) 1266 if (profile->GetExtensionService()->HasUsedWebRequest(extension.get()))
1267 return; 1267 return;
1268 profile->GetExtensionService()->SetHasUsedWebRequest(extension, true); 1268 profile->GetExtensionService()->SetHasUsedWebRequest(extension.get(), true);
1269 1269
1270 content::BrowserContext* browser_context = profile; 1270 content::BrowserContext* browser_context = profile;
1271 for (content::RenderProcessHost::iterator it = 1271 for (content::RenderProcessHost::iterator it =
1272 content::RenderProcessHost::AllHostsIterator(); 1272 content::RenderProcessHost::AllHostsIterator();
1273 !it.IsAtEnd(); it.Advance()) { 1273 !it.IsAtEnd(); it.Advance()) {
1274 content::RenderProcessHost* host = it.GetCurrentValue(); 1274 content::RenderProcessHost* host = it.GetCurrentValue();
1275 if (host->GetBrowserContext() == browser_context) 1275 if (host->GetBrowserContext() == browser_context)
1276 SendExtensionWebRequestStatusToHost(host); 1276 SendExtensionWebRequestStatusToHost(host);
1277 } 1277 }
1278 } 1278 }
1279 1279
1280 } // namespace extension_web_request_api_helpers 1280 } // namespace extension_web_request_api_helpers
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698