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

Side by Side Diff: chrome/browser/prerender/prerender_local_predictor.h

Issue 10214004: Fix destruction concurrency issue in PrerenderLocalPredictor: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_local_predictor.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_ 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_ 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 // Delay after which to initialize, to avoid putting to much load on the 50 // Delay after which to initialize, to avoid putting to much load on the
51 // database thread early on when Chrome is starting up. 51 // database thread early on when Chrome is starting up.
52 static const int kInitDelayMs = 5 * 1000; 52 static const int kInitDelayMs = 5 * 1000;
53 53
54 CancelableRequestConsumer history_db_consumer_; 54 CancelableRequestConsumer history_db_consumer_;
55 55
56 scoped_ptr<std::vector<history::BriefVisitInfo> > visit_history_; 56 scoped_ptr<std::vector<history::BriefVisitInfo> > visit_history_;
57 bool visit_history_initialized_; 57 bool visit_history_initialized_;
58 58
59 // We keep a reference to the HistoryService which we registered to
60 // observe. On destruction, we have to remove ourselves from that history
61 // service. We can't just grab the HistoryService from the profile, because
62 // the profile may have already given up its reference to it. Doing nothing
63 // in this case may cause crashes, because the HistoryService may outlive the
64 // the PrerenderLocalPredictor.
65 scoped_refptr<HistoryService> observing_history_service_;
66
59 DISALLOW_COPY_AND_ASSIGN(PrerenderLocalPredictor); 67 DISALLOW_COPY_AND_ASSIGN(PrerenderLocalPredictor);
60 }; 68 };
61 69
62 } // namespace prerender 70 } // namespace prerender
63 71
64 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_ 72 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_LOCAL_PREDICTOR_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_local_predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698