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

Side by Side Diff: chrome/browser/browsing_data_helper_browsertest.h

Issue 6246105: Only invoke WebKit methods in browsing data helpers on the WEBKIT thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 // Contains code shared by all browsing data browsertests.
6
7 #ifndef CHROME_BROWSER_BROWSING_DATA_HELPER_BROWSERTEST_H_
8 #define CHROME_BROWSER_BROWSING_DATA_HELPER_BROWSERTEST_H_
9 #pragma once
10
11 #include <vector>
12
13 #include "base/basictypes.h"
14 #include "base/message_loop.h"
15
16 // This template can be used for the StartFetching methods of the browsing data
17 // helper classes. It is supposed to be instantiated with the respective browsin g
18 // data info type.
19 template <typename T>
20 class BrowsingDataHelperCallback {
21 public:
22 BrowsingDataHelperCallback() {}
23
24 const std::vector<T>& result()
25 {
26 MessageLoop::current()->Run();
Bernhard Bauer 2011/02/10 12:52:19 Maybe you could DCHECK that |result_| was actually
27 return result_;
28 }
29
30 void callback(const std::vector<T>& info) {
31 result_ = info;
32 MessageLoop::current()->Quit();
33 }
34
35 private:
36 std::vector<T> result_;
37
38 DISALLOW_COPY_AND_ASSIGN(BrowsingDataHelperCallback);
39 };
40
41 #endif // CHROME_BROWSER_BROWSING_DATA_HELPER_BROWSERTEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698