1 // Copyright 2015 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.
5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "content/browser/site_instance_impl.h"
11 #include "content/public/common/referrer.h"
15 // Represents a session history item for a particular frame.
17 // This class is currently owned by a single NavigationEntry and only tracks the
20 // TODO(creis): Keep a tree of FrameNavigationEntries in each NavigationEntry,
21 // one per frame. FrameNavigationEntries may be shared across NavigationEntries
22 // if the frame hasn't changed.
23 class CONTENT_EXPORT FrameNavigationEntry
{
25 FrameNavigationEntry();
26 FrameNavigationEntry(SiteInstanceImpl
* site_instance
,
28 const Referrer
& referrer
);
29 virtual ~FrameNavigationEntry();
31 // The SiteInstance responsible for rendering this frame. All frames sharing
32 // a SiteInstance must live in the same process. This is a refcounted pointer
33 // that keeps the SiteInstance (not necessarily the process) alive as long as
34 // this object remains in the session history.
35 void set_site_instance(SiteInstanceImpl
* site_instance
) {
36 site_instance_
= site_instance
;
38 SiteInstanceImpl
* site_instance() const { return site_instance_
.get(); }
40 // The actual URL loaded in the frame. This is in contrast to the virtual
41 // URL, which is shown to the user.
42 // TODO(creis): Move virtual URL and related members to FrameNavigationEntry.
43 void set_url(const GURL
& url
) { url_
= url
; }
44 const GURL
& url() const { return url_
; }
46 // The referring URL. Can be empty.
47 void set_referrer(const Referrer
& referrer
) { referrer_
= referrer
; }
48 const Referrer
& referrer() const { return referrer_
; }
51 // TODO(creis): These fields have implications for session restore. This is
52 // currently managed by NavigationEntry, but the logic will move here.
54 // See the accessors above for descriptions.
55 scoped_refptr
<SiteInstanceImpl
> site_instance_
;
59 // Copy and assignment is explicitly allowed for this class.
62 } // namespace content
64 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_