diff options
Diffstat (limited to 'chrome/browser/autocomplete/history_quick_provider.h')
-rw-r--r-- | chrome/browser/autocomplete/history_quick_provider.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/history_quick_provider.h b/chrome/browser/autocomplete/history_quick_provider.h new file mode 100644 index 0000000..c0dcc15 --- /dev/null +++ b/chrome/browser/autocomplete/history_quick_provider.h @@ -0,0 +1,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_ |