diff options
author | gavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-14 15:20:42 +0000 |
---|---|---|
committer | gavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-14 15:20:42 +0000 |
commit | 1c7fa0a26fed6f48fbb2a7fe5724c5f9143610ff (patch) | |
tree | b88ecd45df859d7486de533bb5d6fa198dc1a4be /chrome/browser/prerender/prerender_handle.h | |
parent | 5463c700e47a3beac464d95b251335bd90145a4d (diff) | |
download | chromium_src-1c7fa0a26fed6f48fbb2a7fe5724c5f9143610ff.zip chromium_src-1c7fa0a26fed6f48fbb2a7fe5724c5f9143610ff.tar.gz chromium_src-1c7fa0a26fed6f48fbb2a7fe5724c5f9143610ff.tar.bz2 |
Revert 146735 - Handle interface to prerenders.
It broke the windows aura build, which isn't on standard tries.
The prerender_manager now returns a PrerenderHandle* when creating a prerender; this is a useful object for canceling the prerender, as well as signaling navigation, etc...
BUG=None
Review URL: https://chromiumcodereview.appspot.com/10553029
TBR=gavinp@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10783013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146736 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prerender/prerender_handle.h')
-rw-r--r-- | chrome/browser/prerender/prerender_handle.h | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/chrome/browser/prerender/prerender_handle.h b/chrome/browser/prerender/prerender_handle.h deleted file mode 100644 index 90a9dcc..0000000 --- a/chrome/browser/prerender/prerender_handle.h +++ /dev/null @@ -1,79 +0,0 @@ -// 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/basictypes.h" -#include "base/memory/weak_ptr.h" -#include "base/threading/non_thread_safe.h" -#include "chrome/browser/prerender/prerender_manager.h" - -class GURL; - -namespace content { -class SessionStorageNamespace; -} - -namespace prerender { - -class PrerenderContents; - -// A class representing a running prerender to a client of the PrerenderManager. -// Methods on PrerenderManager which start prerenders return a caller-owned -// PrerenderHandle* to the client (or NULL if they are unable to start a -// prerender). Because the PrerenderManager can stop running prerenders at any -// time, callers may wish to check PrerenderHandle::IsValid() before operating -// on their prerenders. -class PrerenderHandle : public base::NonThreadSafe { - public: - // Before calling the destructor, the caller must invalidate the handle by - // calling either OnNavigateAway or OnCancel. - ~PrerenderHandle(); - - // The launcher is navigating away from the context that launched this - // prerender. The prerender will likely stay alive briefly though, in case we - // are going through a redirect chain that will target it. This call - // invalidates the handle. If the prerender handle is already invalid, this - // call does nothing. - void OnNavigateAway(); - - // The launcher has taken explicit action to remove this prerender (for - // instance, removing a link element from a document). This call invalidates - // the handle. If the prerender handle is already invalid, this call does - // nothing. - void OnCancel(); - - // True if the prerender handle is still connected to a (pending or running) - // prerender. Handles can become invalid through explicit requests by the - // client, such as calling OnCancel() or OnNavigateAway(), and handles - // also become invalid when the PrerenderManager cancels prerenders. - bool IsValid() const; - - // True if this prerender was launched by a page that was itself being - // prerendered, and so has not yet been started. - bool IsPending() const; - - // True if this prerender is currently active. - bool IsPrerendering() const; - - // True if we started a prerender, and it has finished loading. - bool IsFinishedLoading() const; - - private: - friend class PrerenderManager; - - explicit PrerenderHandle(PrerenderManager::PrerenderData* prerender_data); - - void SwapPrerenderDataWith(PrerenderHandle* other_prerender_handle); - - base::WeakPtr<PrerenderManager::PrerenderData> prerender_data_; - base::WeakPtrFactory<PrerenderHandle> weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(PrerenderHandle); -}; - -} // namespace prerender - -#endif // CHROME_BROWSER_PRERENDER_PRERENDER_HANDLE_H_ |