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

Side by Side Diff: base/metrics/field_trial.cc

Issue 877993003: Pass FROM_HERE to ObserverListThreadSafe::Notify to improve profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « base/memory/memory_pressure_listener.cc ('k') | base/observer_list_threadsafe.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/metrics/field_trial.h" 5 #include "base/metrics/field_trial.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/build_time.h" 9 #include "base/build_time.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 AutoLock auto_lock(global_->lock_); 540 AutoLock auto_lock(global_->lock_);
541 if (field_trial->group_reported_) 541 if (field_trial->group_reported_)
542 return; 542 return;
543 field_trial->group_reported_ = true; 543 field_trial->group_reported_ = true;
544 } 544 }
545 545
546 if (!field_trial->enable_field_trial_) 546 if (!field_trial->enable_field_trial_)
547 return; 547 return;
548 548
549 global_->observer_list_->Notify( 549 global_->observer_list_->Notify(
550 &FieldTrialList::Observer::OnFieldTrialGroupFinalized, 550 FROM_HERE, &FieldTrialList::Observer::OnFieldTrialGroupFinalized,
551 field_trial->trial_name(), 551 field_trial->trial_name(), field_trial->group_name_internal());
552 field_trial->group_name_internal());
553 } 552 }
554 553
555 // static 554 // static
556 size_t FieldTrialList::GetFieldTrialCount() { 555 size_t FieldTrialList::GetFieldTrialCount() {
557 if (!global_) 556 if (!global_)
558 return 0; 557 return 0;
559 AutoLock auto_lock(global_->lock_); 558 AutoLock auto_lock(global_->lock_);
560 return global_->registered_.size(); 559 return global_->registered_.size();
561 } 560 }
562 561
(...skipping 22 matching lines...) Expand all
585 return; 584 return;
586 } 585 }
587 AutoLock auto_lock(global_->lock_); 586 AutoLock auto_lock(global_->lock_);
588 DCHECK(!global_->PreLockedFind(trial->trial_name())); 587 DCHECK(!global_->PreLockedFind(trial->trial_name()));
589 trial->AddRef(); 588 trial->AddRef();
590 trial->SetTrialRegistered(); 589 trial->SetTrialRegistered();
591 global_->registered_[trial->trial_name()] = trial; 590 global_->registered_[trial->trial_name()] = trial;
592 } 591 }
593 592
594 } // namespace base 593 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/memory_pressure_listener.cc ('k') | base/observer_list_threadsafe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698