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

Side by Side Diff: content/browser/histogram_synchronizer.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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 "content/browser/histogram_synchronizer.h" 5 #include "content/browser/histogram_synchronizer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 174
175 HistogramSynchronizer::~HistogramSynchronizer() { 175 HistogramSynchronizer::~HistogramSynchronizer() {
176 RequestContext::OnShutdown(); 176 RequestContext::OnShutdown();
177 177
178 // Just in case we have any pending tasks, clear them out. 178 // Just in case we have any pending tasks, clear them out.
179 SetCallbackTaskAndThread(NULL, base::Closure()); 179 SetCallbackTaskAndThread(NULL, base::Closure());
180 } 180 }
181 181
182 HistogramSynchronizer* HistogramSynchronizer::GetInstance() { 182 HistogramSynchronizer* HistogramSynchronizer::GetInstance() {
183 return Singleton<HistogramSynchronizer, 183 return base::Singleton<
184 LeakySingletonTraits<HistogramSynchronizer> >::get(); 184 HistogramSynchronizer,
185 base::LeakySingletonTraits<HistogramSynchronizer>>::get();
185 } 186 }
186 187
187 // static 188 // static
188 void HistogramSynchronizer::FetchHistograms() { 189 void HistogramSynchronizer::FetchHistograms() {
189 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { 190 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
190 BrowserThread::PostTask( 191 BrowserThread::PostTask(
191 BrowserThread::UI, FROM_HERE, 192 BrowserThread::UI, FROM_HERE,
192 base::Bind(&HistogramSynchronizer::FetchHistograms)); 193 base::Bind(&HistogramSynchronizer::FetchHistograms));
193 return; 194 return;
194 } 195 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 kHistogramSynchronizerReservedSequenceNumber + 1; 337 kHistogramSynchronizerReservedSequenceNumber + 1;
337 } 338 }
338 DCHECK_NE(last_used_sequence_number_, 339 DCHECK_NE(last_used_sequence_number_,
339 kHistogramSynchronizerReservedSequenceNumber); 340 kHistogramSynchronizerReservedSequenceNumber);
340 if (requester == ASYNC_HISTOGRAMS) 341 if (requester == ASYNC_HISTOGRAMS)
341 async_sequence_number_ = last_used_sequence_number_; 342 async_sequence_number_ = last_used_sequence_number_;
342 return last_used_sequence_number_; 343 return last_used_sequence_number_;
343 } 344 }
344 345
345 } // namespace content 346 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/histogram_synchronizer.h ('k') | content/browser/in_process_io_surface_manager_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698