Chromium Code Reviews| Index: chrome/browser/prerender/prerender_handle.h |
| diff --git a/chrome/browser/prerender/prerender_handle.h b/chrome/browser/prerender/prerender_handle.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a1b99db565d34e20de2d8af5ac2a41a5caeb1dbf |
| --- /dev/null |
| +++ b/chrome/browser/prerender/prerender_handle.h |
| @@ -0,0 +1,58 @@ |
| +// Copyright (c) 2012 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_PRERENDER_PRERENDER_HANDLE_H_ |
| +#define CHROME_BROWSER_PRERENDER_PRERENDER_HANDLE_H_ |
| + |
| +#include "base/threading/non_thread_safe.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/memory/weak_ptr.h" |
| + |
| +class GURL; |
| + |
| +namespace content { |
| +class SessionStorageNamespace; |
| +} |
| + |
| +namespace prerender { |
| + |
| +class PrerenderContents; |
| +class PrerenderManager; |
| + |
| +class PrerenderHandle : public base::SupportsWeakPtr<PrerenderHandle>, |
| + public base::NonThreadSafe { |
|
dominich
2012/06/22 15:36:16
consider making this refcounted directly and see i
|
| + public: |
| + ~PrerenderHandle(); |
| + |
| + bool Matches( |
| + const GURL& url, |
| + const content::SessionStorageNamespace* session_storage_namespace) const; |
| + |
| + bool IsPending() const; |
| + bool IsPrerendering() const { return !IsPending(); } |
| + |
| + bool DidFinishLoading() const; |
| + |
| + void DecrementClientCount(); |
| + |
| + private: |
| + friend class PrerenderManager; |
| + |
| + PrerenderHandle(); |
| + |
| + void AddDuplicate(scoped_ptr<PrerenderHandle> new_duplicate_handle); |
| + |
| + 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
|
| + void SetContents(PrerenderContents* contents); |
| + |
| + PrerenderContents* contents_; |
| + |
| + // Another prerender handle, owned by this one, which refers to the same |
| + // PrerenderContents. |
|
dominich
2012/06/22 15:36:16
what for?
|
| + scoped_ptr<PrerenderHandle> duplicate_handle_; |
| +}; |
| + |
| +} // namespace prerender |
| + |
| +#endif // CHROME_BROWSER_PRERENDER_PRERENDER_HANDLE_H_ |