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

Side by Side Diff: chrome/browser/extensions/extension_system.cc

Issue 10076001: Fix memory leak caused by Rules Registries (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/extension_system.h" 5 #include "chrome/browser/extensions/extension_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/string_tokenizer.h" 10 #include "base/string_tokenizer.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 // 57 //
58 // ExtensionSystemImpl::Shared 58 // ExtensionSystemImpl::Shared
59 // 59 //
60 60
61 ExtensionSystemImpl::Shared::Shared(Profile* profile) 61 ExtensionSystemImpl::Shared::Shared(Profile* profile)
62 : profile_(profile) { 62 : profile_(profile) {
63 } 63 }
64 64
65 ExtensionSystemImpl::Shared::~Shared() { 65 ExtensionSystemImpl::Shared::~Shared() {
66 rules_registry_service_->Shutdown();
Matt Perry 2012/04/12 21:46:19 When is this called? If it's during shutdown, then
battre 2012/04/12 22:20:52 ExtensionSystemImpl::Shared is ref counted so it i
66 } 67 }
67 68
68 void ExtensionSystemImpl::Shared::InitPrefs() { 69 void ExtensionSystemImpl::Shared::InitPrefs() {
69 bool extensions_disabled = 70 bool extensions_disabled =
70 profile_->GetPrefs()->GetBoolean(prefs::kDisableExtensions) || 71 profile_->GetPrefs()->GetBoolean(prefs::kDisableExtensions) ||
71 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableExtensions); 72 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableExtensions);
72 extension_prefs_.reset(new ExtensionPrefs( 73 extension_prefs_.reset(new ExtensionPrefs(
73 profile_->GetPrefs(), 74 profile_->GetPrefs(),
74 profile_->GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), 75 profile_->GetPath().AppendASCII(ExtensionService::kInstallDirectoryName),
75 ExtensionPrefValueMapFactory::GetForProfile(profile_))); 76 ExtensionPrefValueMapFactory::GetForProfile(profile_)));
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 } 311 }
311 312
312 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( 313 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts(
313 const std::string& extension_id, 314 const std::string& extension_id,
314 const extension_misc::UnloadedExtensionReason reason) { 315 const extension_misc::UnloadedExtensionReason reason) {
315 BrowserThread::PostTask( 316 BrowserThread::PostTask(
316 BrowserThread::IO, FROM_HERE, 317 BrowserThread::IO, FROM_HERE,
317 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(), 318 base::Bind(&ExtensionInfoMap::RemoveExtension, info_map(),
318 extension_id, reason)); 319 extension_id, reason));
319 } 320 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/declarative/rules_registry_service.cc ('k') | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698