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

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

Issue 13572005: Fix crash when incognito split mode extension using the WebRequest API was reloaded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/event_router.h" 5 #include "chrome/browser/extensions/event_router.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 250 }
251 } 251 }
252 252
253 void EventRouter::OnListenerRemoved(const EventListener* listener) { 253 void EventRouter::OnListenerRemoved(const EventListener* listener) {
254 const std::string& event_name = listener->event_name; 254 const std::string& event_name = listener->event_name;
255 const EventListenerInfo details(event_name, listener->extension_id); 255 const EventListenerInfo details(event_name, listener->extension_id);
256 ObserverMap::iterator observer = observers_.find(event_name); 256 ObserverMap::iterator observer = observers_.find(event_name);
257 if (observer != observers_.end()) 257 if (observer != observers_.end())
258 observer->second->OnListenerRemoved(details); 258 observer->second->OnListenerRemoved(details);
259 259
260 void* profile =
261 listener->process
262 ? Profile::FromBrowserContext(listener->process->GetBrowserContext())
263 : NULL;
260 BrowserThread::PostTask( 264 BrowserThread::PostTask(
261 BrowserThread::IO, FROM_HERE, 265 BrowserThread::IO, FROM_HERE,
262 base::Bind(&NotifyEventListenerRemovedOnIOThread, 266 base::Bind(&NotifyEventListenerRemovedOnIOThread,
263 profile_, listener->extension_id, event_name)); 267 profile, listener->extension_id, event_name));
264 268
265 const Extension* extension = extensions::ExtensionSystem::Get(profile_)-> 269 const Extension* extension = extensions::ExtensionSystem::Get(profile_)->
266 extension_service()->GetExtensionById(listener->extension_id, 270 extension_service()->GetExtensionById(listener->extension_id,
267 ExtensionService::INCLUDE_ENABLED); 271 ExtensionService::INCLUDE_ENABLED);
268 if (extension) { 272 if (extension) {
269 scoped_ptr<ListValue> args(new ListValue()); 273 scoped_ptr<ListValue> args(new ListValue());
270 activity_log_->LogAPIAction(extension, 274 activity_log_->LogAPIAction(extension,
271 event_name + ".removeListener", 275 event_name + ".removeListener",
272 args.get(), 276 args.get(),
273 ""); 277 "");
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 copy->will_dispatch_callback = will_dispatch_callback; 720 copy->will_dispatch_callback = will_dispatch_callback;
717 return copy; 721 return copy;
718 } 722 }
719 723
720 EventListenerInfo::EventListenerInfo(const std::string& event_name, 724 EventListenerInfo::EventListenerInfo(const std::string& event_name,
721 const std::string& extension_id) 725 const std::string& extension_id)
722 : event_name(event_name), 726 : event_name(event_name),
723 extension_id(extension_id) {} 727 extension_id(extension_id) {}
724 728
725 } // namespace extensions 729 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698