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

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

Issue 7259019: Move base/values.h into the base namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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_HISTORY_H_ 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_HISTORY_H_
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_HISTORY_H_ 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_HISTORY_H_
7 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 10
11 #include "base/threading/non_thread_safe.h" 11 #include "base/threading/non_thread_safe.h"
12 #include "base/time.h" 12 #include "base/time.h"
13 #include "chrome/browser/prerender/prerender_final_status.h" 13 #include "chrome/browser/prerender/prerender_final_status.h"
14 #include "chrome/browser/prerender/prerender_origin.h" 14 #include "chrome/browser/prerender/prerender_origin.h"
15 #include "googleurl/src/gurl.h" 15 #include "googleurl/src/gurl.h"
16 16
17 namespace base {
17 class Value; 18 class Value;
19 }
18 20
19 namespace prerender { 21 namespace prerender {
20 22
21 // PrerenderHistory maintains a per-session history of prerendered pages 23 // PrerenderHistory maintains a per-session history of prerendered pages
22 // and their final dispositions. It has a fixed maximum capacity, and old 24 // and their final dispositions. It has a fixed maximum capacity, and old
23 // items in history will be removed when the capacity is reached. 25 // items in history will be removed when the capacity is reached.
24 class PrerenderHistory : public base::NonThreadSafe { 26 class PrerenderHistory : public base::NonThreadSafe {
25 public: 27 public:
26 // Entry is an individual entry in the history list. It corresponds to a 28 // Entry is an individual entry in the history list. It corresponds to a
27 // specific prerendered page. 29 // specific prerendered page.
(...skipping 29 matching lines...) Expand all
57 explicit PrerenderHistory(size_t max_items); 59 explicit PrerenderHistory(size_t max_items);
58 ~PrerenderHistory(); 60 ~PrerenderHistory();
59 61
60 // Adds |entry| to the history. If at capacity, the oldest entry is dropped. 62 // Adds |entry| to the history. If at capacity, the oldest entry is dropped.
61 void AddEntry(const Entry& entry); 63 void AddEntry(const Entry& entry);
62 64
63 // Deletes all history entries. 65 // Deletes all history entries.
64 void Clear(); 66 void Clear();
65 67
66 // Retrieves the entries as a value which can be displayed. 68 // Retrieves the entries as a value which can be displayed.
67 Value* GetEntriesAsValue() const; 69 base::Value* GetEntriesAsValue() const;
68 70
69 private: 71 private:
70 std::list<Entry> entries_; 72 std::list<Entry> entries_;
71 size_t max_items_; 73 size_t max_items_;
72 74
73 DISALLOW_COPY_AND_ASSIGN(PrerenderHistory); 75 DISALLOW_COPY_AND_ASSIGN(PrerenderHistory);
74 }; 76 };
75 77
76 } 78 }
77 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTORY_H_ 79 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTORY_H_
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_contents.h ('k') | chrome/browser/prerender/prerender_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698