OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_HANDLE_H_ | |
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_HANDLE_H_ | |
7 | |
8 #include "base/threading/non_thread_safe.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/memory/weak_ptr.h" | |
11 | |
12 class GURL; | |
13 | |
14 namespace content { | |
15 class SessionStorageNamespace; | |
16 } | |
17 | |
18 namespace prerender { | |
19 | |
20 class PrerenderContents; | |
21 class PrerenderManager; | |
22 | |
23 class PrerenderHandle : public base::SupportsWeakPtr<PrerenderHandle>, | |
24 public base::NonThreadSafe { | |
dominich
2012/06/22 15:36:16
consider making this refcounted directly and see i
| |
25 public: | |
26 ~PrerenderHandle(); | |
27 | |
28 bool Matches( | |
29 const GURL& url, | |
30 const content::SessionStorageNamespace* session_storage_namespace) const; | |
31 | |
32 bool IsPending() const; | |
33 bool IsPrerendering() const { return !IsPending(); } | |
34 | |
35 bool DidFinishLoading() const; | |
36 | |
37 void DecrementClientCount(); | |
38 | |
39 private: | |
40 friend class PrerenderManager; | |
41 | |
42 PrerenderHandle(); | |
43 | |
44 void AddDuplicate(scoped_ptr<PrerenderHandle> new_duplicate_handle); | |
45 | |
46 PrerenderContents* contents() const { return contents_; } | |
dominich
2012/06/22 15:36:16
not sure i understand the point of an accessor at
mmenke
2012/06/22 16:12:45
I generally do it when something is called by a fr
| |
47 void SetContents(PrerenderContents* contents); | |
48 | |
49 PrerenderContents* contents_; | |
50 | |
51 // Another prerender handle, owned by this one, which refers to the same | |
52 // PrerenderContents. | |
dominich
2012/06/22 15:36:16
what for?
| |
53 scoped_ptr<PrerenderHandle> duplicate_handle_; | |
54 }; | |
55 | |
56 } // namespace prerender | |
57 | |
58 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HANDLE_H_ | |
OLD | NEW |