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

Side by Side Diff: chrome/browser/autocomplete/chrome_autocomplete_provider_delegate.cc

Issue 511753002: Fix NULL dereference in SearchProviderTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/search_provider_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_delegate.h" 5 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_delegate.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 8 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" 9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
10 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h" 10 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 return scheme_classifier_; 51 return scheme_classifier_;
52 } 52 }
53 53
54 void ChromeAutocompleteProviderDelegate::Classify( 54 void ChromeAutocompleteProviderDelegate::Classify(
55 const base::string16& text, 55 const base::string16& text,
56 bool prefer_keyword, 56 bool prefer_keyword,
57 bool allow_exact_keyword_match, 57 bool allow_exact_keyword_match,
58 metrics::OmniboxEventProto::PageClassification page_classification, 58 metrics::OmniboxEventProto::PageClassification page_classification,
59 AutocompleteMatch* match, 59 AutocompleteMatch* match,
60 GURL* alternate_nav_url) { 60 GURL* alternate_nav_url) {
61 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify( 61 AutocompleteClassifier* classifier =
62 text, prefer_keyword, allow_exact_keyword_match, page_classification, 62 AutocompleteClassifierFactory::GetForProfile(profile_);
63 match, alternate_nav_url); 63 DCHECK(classifier);
64 classifier->Classify(text, prefer_keyword, allow_exact_keyword_match,
65 page_classification, match, alternate_nav_url);
64 } 66 }
65 67
66 history::URLDatabase* ChromeAutocompleteProviderDelegate::InMemoryDatabase() { 68 history::URLDatabase* ChromeAutocompleteProviderDelegate::InMemoryDatabase() {
67 HistoryService* history_service = 69 HistoryService* history_service =
68 HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); 70 HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
69 return history_service ? history_service->InMemoryDatabase() : NULL; 71 return history_service ? history_service->InMemoryDatabase() : NULL;
70 } 72 }
71 73
72 void 74 void
73 ChromeAutocompleteProviderDelegate::DeleteMatchingURLsForKeywordFromHistory( 75 ChromeAutocompleteProviderDelegate::DeleteMatchingURLsForKeywordFromHistory(
(...skipping 14 matching lines...) Expand all
88 syncer::PROXY_TABS) && 90 syncer::PROXY_TABS) &&
89 !service->GetEncryptedDataTypes().Has(syncer::SESSIONS); 91 !service->GetEncryptedDataTypes().Has(syncer::SESSIONS);
90 } 92 }
91 93
92 void ChromeAutocompleteProviderDelegate::PrefetchImage(const GURL& url) { 94 void ChromeAutocompleteProviderDelegate::PrefetchImage(const GURL& url) {
93 BitmapFetcherService* image_service = 95 BitmapFetcherService* image_service =
94 BitmapFetcherServiceFactory::GetForBrowserContext(profile_); 96 BitmapFetcherServiceFactory::GetForBrowserContext(profile_);
95 DCHECK(image_service); 97 DCHECK(image_service);
96 image_service->Prefetch(url); 98 image_service->Prefetch(url);
97 } 99 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/search_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698