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 3 // found in the LICENSE file. 4 5 #ifndef CONTENT_PUBLIC_BROWSER_HISTOGRAM_FETCHER_H_ 6 #define CONTENT_PUBLIC_BROWSER_HISTOGRAM_FETCHER_H_ 7 8 #include "base/callback.h" 9 #include "base/task_runner.h" 10 #include "base/time/time.h" 11 #include "content/common/content_export.h" 12 13 namespace content { 14 15 // Fetch histogram data asynchronously from the various child processes, into 16 // the browser process. This method is used by the metrics services in 17 // preparation for a log upload. It contacts all processes, and get them to 18 // upload to the browser any/all changes to histograms. When all changes have 19 // been acquired, or when the wait time expires (whichever is sooner), post the 20 // callback to the specified TaskRunner. Note the callback is posted exactly 21 // once. 22 CONTENT_EXPORT void FetchHistogramsAsynchronously( 23 scoped_refptr<base::TaskRunner> task_runner, 24 base::OnceClosure callback, 25 base::TimeDelta wait_time); 26 27 } // namespace content 28 29 #endif // CONTENT_PUBLIC_BROWSER_HISTOGRAM_FETCHER_H_ 30