#ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_HELPER_BROWSERTEST_H_
#define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_HELPER_BROWSERTEST_H_
#include <list>
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
template <typename T>
class BrowsingDataHelperCallback {
public:
BrowsingDataHelperCallback()
: has_result_(false) {
}
const std::list<T>& result() {
base::MessageLoop::current()->Run();
DCHECK(has_result_);
return result_;
}
void callback(const std::list<T>& info) {
result_ = info;
has_result_ = true;
base::MessageLoop::current()->Quit();
}
private:
bool has_result_;
std::list<T> result_;
DISALLOW_COPY_AND_ASSIGN(BrowsingDataHelperCallback);
};
#endif