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

Side by Side Diff: chrome/browser/permissions/permission_manager.cc

Issue 1885823002: Fix bug: MIDI causes crash on onContentSettingChanged() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/permissions/permission_manager.h" 5 #include "chrome/browser/permissions/permission_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 void PermissionManager::OnContentSettingChanged( 391 void PermissionManager::OnContentSettingChanged(
392 const ContentSettingsPattern& primary_pattern, 392 const ContentSettingsPattern& primary_pattern,
393 const ContentSettingsPattern& secondary_pattern, 393 const ContentSettingsPattern& secondary_pattern,
394 ContentSettingsType content_type, 394 ContentSettingsType content_type,
395 std::string resource_identifier) { 395 std::string resource_identifier) {
396 std::list<base::Closure> callbacks; 396 std::list<base::Closure> callbacks;
397 397
398 for (SubscriptionsMap::iterator iter(&subscriptions_); 398 for (SubscriptionsMap::iterator iter(&subscriptions_);
399 !iter.IsAtEnd(); iter.Advance()) { 399 !iter.IsAtEnd(); iter.Advance()) {
400 Subscription* subscription = iter.GetCurrentValue(); 400 Subscription* subscription = iter.GetCurrentValue();
401 if (IsConstantPermission(subscription->permission)) {
402 continue;
403 }
raymes 2016/04/13 04:11:36 nit: no {}
401 if (PermissionTypeToContentSetting(subscription->permission) != 404 if (PermissionTypeToContentSetting(subscription->permission) !=
402 content_type) { 405 content_type) {
403 continue; 406 continue;
404 } 407 }
405 408
406 if (primary_pattern.IsValid() && 409 if (primary_pattern.IsValid() &&
407 !primary_pattern.Matches(subscription->requesting_origin)) 410 !primary_pattern.Matches(subscription->requesting_origin))
408 continue; 411 continue;
409 if (secondary_pattern.IsValid() && 412 if (secondary_pattern.IsValid() &&
410 !secondary_pattern.Matches(subscription->embedding_origin)) 413 !secondary_pattern.Matches(subscription->embedding_origin))
(...skipping 11 matching lines...) Expand all
422 // Add the callback to |callbacks| which will be run after the loop to 425 // Add the callback to |callbacks| which will be run after the loop to
423 // prevent re-entrance issues. 426 // prevent re-entrance issues.
424 callbacks.push_back( 427 callbacks.push_back(
425 base::Bind(subscription->callback, 428 base::Bind(subscription->callback,
426 ContentSettingToPermissionStatus(new_value))); 429 ContentSettingToPermissionStatus(new_value)));
427 } 430 }
428 431
429 for (const auto& callback : callbacks) 432 for (const auto& callback : callbacks)
430 callback.Run(); 433 callback.Run();
431 } 434 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698