OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ |
| 7 |
| 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" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 // Represents a session history item for a particular frame. |
| 16 // |
| 17 // This class is currently owned by a single NavigationEntry and only tracks the |
| 18 // main frame. |
| 19 // |
| 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 { |
| 24 public: |
| 25 FrameNavigationEntry(); |
| 26 FrameNavigationEntry(SiteInstanceImpl* site_instance, |
| 27 const GURL& url, |
| 28 const Referrer& referrer); |
| 29 virtual ~FrameNavigationEntry(); |
| 30 |
| 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; |
| 37 } |
| 38 SiteInstanceImpl* site_instance() const { return site_instance_.get(); } |
| 39 |
| 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_; } |
| 45 |
| 46 // The referring URL. Can be empty. |
| 47 void set_referrer(const Referrer& referrer) { referrer_ = referrer; } |
| 48 const Referrer& referrer() const { return referrer_; } |
| 49 |
| 50 private: |
| 51 // TODO(creis): These fields have implications for session restore. This is |
| 52 // currently managed by NavigationEntry, but the logic will move here. |
| 53 |
| 54 // See the accessors above for descriptions. |
| 55 scoped_refptr<SiteInstanceImpl> site_instance_; |
| 56 GURL url_; |
| 57 Referrer referrer_; |
| 58 |
| 59 // Copy and assignment is explicitly allowed for this class. |
| 60 }; |
| 61 |
| 62 } // namespace content |
| 63 |
| 64 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_H_ |
OLD | NEW |