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

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

Issue 140613002: Cleanup: Replace &LazyInstance::Get() with LazyInstance::Pointer(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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.h" 5 #include "chrome/browser/extensions/api/web_request/web_request_api.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 ExtensionSystem::GetForBrowserContext(browser_context_) 418 ExtensionSystem::GetForBrowserContext(browser_context_)
419 ->event_router() 419 ->event_router()
420 ->UnregisterObserver(this); 420 ->UnregisterObserver(this);
421 } 421 }
422 422
423 static base::LazyInstance<ProfileKeyedAPIFactory<WebRequestAPI> > 423 static base::LazyInstance<ProfileKeyedAPIFactory<WebRequestAPI> >
424 g_factory = LAZY_INSTANCE_INITIALIZER; 424 g_factory = LAZY_INSTANCE_INITIALIZER;
425 425
426 // static 426 // static
427 ProfileKeyedAPIFactory<WebRequestAPI>* WebRequestAPI::GetFactoryInstance() { 427 ProfileKeyedAPIFactory<WebRequestAPI>* WebRequestAPI::GetFactoryInstance() {
428 return &g_factory.Get(); 428 return g_factory.Pointer();
429 } 429 }
430 430
431 void WebRequestAPI::OnListenerRemoved(const EventListenerInfo& details) { 431 void WebRequestAPI::OnListenerRemoved(const EventListenerInfo& details) {
432 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 432 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
433 // Note that details.event_name includes the sub-event details (e.g. "/123"). 433 // Note that details.event_name includes the sub-event details (e.g. "/123").
434 BrowserThread::PostTask(BrowserThread::IO, 434 BrowserThread::PostTask(BrowserThread::IO,
435 FROM_HERE, 435 FROM_HERE,
436 base::Bind(&RemoveEventListenerOnIOThread, 436 base::Bind(&RemoveEventListenerOnIOThread,
437 details.browser_context, 437 details.browser_context,
438 details.extension_id, 438 details.extension_id,
(...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after
2377 } else if ((*it)->name().find("AdBlock") != std::string::npos) { 2377 } else if ((*it)->name().find("AdBlock") != std::string::npos) {
2378 adblock = true; 2378 adblock = true;
2379 } else { 2379 } else {
2380 other = true; 2380 other = true;
2381 } 2381 }
2382 } 2382 }
2383 } 2383 }
2384 2384
2385 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); 2385 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other));
2386 } 2386 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698