Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(837)

Side by Side Diff: content/browser/frame_host/frame_navigation_entry.h

Issue 931333004: Add FrameNavigationEntry class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/frame_navigation_entry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_IMPL_H_
Avi (use Gerrit) 2015/02/18 21:56:24 Bad guard constant.
Charlie Reis 2015/02/18 22:04:38 Done.
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 {
39 return site_instance_.get();
40 }
41
42 // The actual URL loaded in the frame. This is in contrast to the virtual
43 // URL, which is shown to the user.
44 // TODO(creis): Move virtual URL and related members to FrameNavigationEntry.
45 void set_url(const GURL& url) {
46 url_ = url;
47 }
48 const GURL& url() const {
49 return url_;
50 }
51
52 // The referring URL. Can be empty.
53 void set_referrer(const Referrer& referrer) {
54 referrer_ = referrer;
55 }
56 const Referrer& referrer() const {
57 return referrer_;
58 }
59
60
Avi (use Gerrit) 2015/02/18 21:56:24 too many blank lines
Charlie Reis 2015/02/18 22:04:38 Done.
61 private:
62 // TODO(creis): These fields have implications for session restore. This is
63 // currently managed by NavigationEntry, but the logic will move here.
64
65 // See the accessors above for descriptions.
66 scoped_refptr<SiteInstanceImpl> site_instance_;
67 GURL url_;
68 Referrer referrer_;
69
70 // Copy and assignment is explicitly allowed for this class.
71 };
72
73 } // namespace content
74
75 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_NAVIGATION_ENTRY_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/frame_navigation_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698