summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/history_quick_provider.h
blob: c0dcc15272e12a1417e10838188841e9f7c961cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_
#define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_

#include "chrome/browser/autocomplete/autocomplete.h"

// This class is an autocomplete provider (a pseudo-internal component of
// the history system) which quickly (and synchronously) provides matching
// results from recently or frequently visited sites in the profile's
// history.
//
// TODO(mrossetti): Review to see if the following applies since we're not
// using the database during the autocomplete pass.
//
// Note: This object can get leaked on shutdown if there are pending
// requests on the database (which hold a reference to us). Normally, these
// messages get flushed for each thread. We do a round trip from main, to
// history, back to main while holding a reference. If the main thread
// completes before the history thread, the message to delegate back to the
// main thread will not run and the reference will leak. Therefore, don't do
// anything on destruction.
class HistoryQuickProvider : public AutocompleteProvider {
 public:
  HistoryQuickProvider(ACProviderListener* listener, Profile* profile)
      : AutocompleteProvider(listener, profile, "HistoryQuickProvider") {}

  // no destructor (see note above)

  // AutocompleteProvider
  void Start(const AutocompleteInput& input, bool minimal_changes);

 private:
  ~HistoryQuickProvider() {}
};

#endif  // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_