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

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

Issue 362343006: Fix dangerous pointer use in UserScriptMaster (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_impl.h" 5 #include "chrome/browser/extensions/extension_system_impl.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } // namespace 284 } // namespace
285 285
286 void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) { 286 void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) {
287 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 287 const CommandLine* command_line = CommandLine::ForCurrentProcess();
288 288
289 navigation_observer_.reset(new NavigationObserver(profile_)); 289 navigation_observer_.reset(new NavigationObserver(profile_));
290 290
291 bool allow_noisy_errors = !command_line->HasSwitch(switches::kNoErrorDialogs); 291 bool allow_noisy_errors = !command_line->HasSwitch(switches::kNoErrorDialogs);
292 ExtensionErrorReporter::Init(allow_noisy_errors); 292 ExtensionErrorReporter::Init(allow_noisy_errors);
293 293
294 user_script_master_ = new UserScriptMaster(profile_); 294 user_script_master_.reset(new UserScriptMaster(profile_));
295 295
296 // ExtensionService depends on RuntimeData. 296 // ExtensionService depends on RuntimeData.
297 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_))); 297 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_)));
298 298
299 bool autoupdate_enabled = !profile_->IsGuestSession(); 299 bool autoupdate_enabled = !profile_->IsGuestSession();
300 #if defined(OS_CHROMEOS) 300 #if defined(OS_CHROMEOS)
301 if (!extensions_enabled) 301 if (!extensions_enabled)
302 autoupdate_enabled = false; 302 autoupdate_enabled = false;
303 #endif 303 #endif
304 extension_service_.reset(new ExtensionService( 304 extension_service_.reset(new ExtensionService(
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts( 610 void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts(
611 const std::string& extension_id, 611 const std::string& extension_id,
612 const UnloadedExtensionInfo::Reason reason) { 612 const UnloadedExtensionInfo::Reason reason) {
613 BrowserThread::PostTask( 613 BrowserThread::PostTask(
614 BrowserThread::IO, 614 BrowserThread::IO,
615 FROM_HERE, 615 FROM_HERE,
616 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); 616 base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason));
617 } 617 }
618 618
619 } // namespace extensions 619 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698