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

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

Issue 2370633002: replace deprecated version of SetWithoutPathExpansion (Closed)
Patch Set: use MakeUnique Created 4 years, 2 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 (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 "extensions/browser/event_router.h" 5 #include "extensions/browser/event_router.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <tuple> 9 #include <tuple>
10 #include <utility> 10 #include <utility>
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 401
402 void EventRouter::AddFilterToEvent(const std::string& event_name, 402 void EventRouter::AddFilterToEvent(const std::string& event_name,
403 const std::string& extension_id, 403 const std::string& extension_id,
404 const DictionaryValue* filter) { 404 const DictionaryValue* filter) {
405 ExtensionPrefs::ScopedDictionaryUpdate update( 405 ExtensionPrefs::ScopedDictionaryUpdate update(
406 extension_prefs_, extension_id, kFilteredEvents); 406 extension_prefs_, extension_id, kFilteredEvents);
407 DictionaryValue* filtered_events = update.Get(); 407 DictionaryValue* filtered_events = update.Get();
408 if (!filtered_events) 408 if (!filtered_events)
409 filtered_events = update.Create(); 409 filtered_events = update.Create();
410 410
411 ListValue* filter_list = NULL; 411 ListValue* filter_list = nullptr;
412 if (!filtered_events->GetList(event_name, &filter_list)) { 412 if (!filtered_events->GetList(event_name, &filter_list)) {
413 filter_list = new ListValue; 413 filter_list = new ListValue;
414 filtered_events->SetWithoutPathExpansion(event_name, filter_list); 414 filtered_events->SetWithoutPathExpansion(event_name,
415 base::WrapUnique(filter_list));
415 } 416 }
416 417
417 filter_list->Append(filter->CreateDeepCopy()); 418 filter_list->Append(filter->CreateDeepCopy());
418 } 419 }
419 420
420 void EventRouter::RemoveFilterFromEvent(const std::string& event_name, 421 void EventRouter::RemoveFilterFromEvent(const std::string& event_name,
421 const std::string& extension_id, 422 const std::string& extension_id,
422 const DictionaryValue* filter) { 423 const DictionaryValue* filter) {
423 ExtensionPrefs::ScopedDictionaryUpdate update( 424 ExtensionPrefs::ScopedDictionaryUpdate update(
424 extension_prefs_, extension_id, kFilteredEvents); 425 extension_prefs_, extension_id, kFilteredEvents);
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 const std::string& extension_id, 894 const std::string& extension_id,
894 const GURL& listener_url, 895 const GURL& listener_url,
895 content::BrowserContext* browser_context) 896 content::BrowserContext* browser_context)
896 : event_name(event_name), 897 : event_name(event_name),
897 extension_id(extension_id), 898 extension_id(extension_id),
898 listener_url(listener_url), 899 listener_url(listener_url),
899 browser_context(browser_context) { 900 browser_context(browser_context) {
900 } 901 }
901 902
902 } // namespace extensions 903 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/app_window/app_window_geometry_cache_unittest.cc ('k') | extensions/browser/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698