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

Unified Diff: ios/web/navigation/crw_session_entry.h

Issue 1028603004: Upstream ios/web/navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ios-testing
Patch Set: Rebase and resync Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/navigation/crw_session_controller_unittest.mm ('k') | ios/web/navigation/crw_session_entry.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/crw_session_entry.h
diff --git a/ios/web/navigation/crw_session_entry.h b/ios/web/navigation/crw_session_entry.h
new file mode 100644
index 0000000000000000000000000000000000000000..00d8ec830176aa0d47505913253df418007f42d6
--- /dev/null
+++ b/ios/web/navigation/crw_session_entry.h
@@ -0,0 +1,65 @@
+// Copyright 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 IOS_WEB_NAVIGATION_CRW_SESSION_ENTRY_H_
+#define IOS_WEB_NAVIGATION_CRW_SESSION_ENTRY_H_
+
+#import <Foundation/Foundation.h>
+
+#include "base/memory/scoped_ptr.h"
+#include "base/strings/string16.h"
+#include "base/time/time.h"
+#include "ui/base/page_transition_types.h"
+#include "url/gurl.h"
+
+namespace web {
+class NavigationItem;
+struct Referrer;
+}
+
+// A CRWSessionEntry is similar to a NavigationEntry object in desktop Chrome.
+// It maintains the information needed to save/restore a single entry in session
+// history (i.e., one site) for a tab. A tab may have multiple of these objects
+// comprising its entire session history.
+// TODO(rohitrao): Fold CRWSessionEntry's logic into NavigationItem.
+@interface CRWSessionEntry : NSObject<NSCoding, NSCopying>
+
+@property(nonatomic, assign) NSInteger index;
+@property(nonatomic, readonly) const GURL& originalUrl;
+@property(nonatomic, assign) BOOL useDesktopUserAgent;
+@property(nonatomic, assign) BOOL usedDataReductionProxy;
+@property(nonatomic, retain) NSString* serializedStateObject;
+@property(nonatomic, assign) BOOL createdFromPushState;
+@property(nonatomic, retain) NSData* POSTData;
+@property(nonatomic, readonly) NSDictionary* httpHeaders;
+@property(nonatomic, assign) BOOL skipResubmitDataConfirmation;
+
+// Initialize the session entry with the given url.
+- (id)initWithUrl:(const GURL&)url
+ referrer:(const web::Referrer&)referrer
+ transition:(ui::PageTransition)transition
+ useDesktopUserAgent:(BOOL)useDesktopUserAgent
+ rendererInitiated:(BOOL)rendererInitiated;
+
+// Initialize the session entry with the given NavigationItem.
+- (id)initWithNavigationItem:(scoped_ptr<web::NavigationItem>)item
+ index:(int)index;
+
+// Returns a pointer to the NavigationItem associated with this CRWSessionEntry.
+// Eventually, this will replace CRWSessionEntry entirely.
+- (web::NavigationItem*)navigationItem;
+
+// Adds headers from |moreHTTPHeaders| to |httpHeaders|; existing headers with
+// the same key will be overridden.
+- (void)addHTTPHeaders:(NSDictionary*)moreHTTPHeaders;
+
+// Removes the header for the given key from |httpHeaders|.
+- (void)removeHTTPHeaderForKey:(NSString*)key;
+
+// Resets |httpHeaders| to nil.
+- (void)resetHTTPHeaders;
+
+@end
+
+#endif // IOS_WEB_NAVIGATION_CRW_SESSION_ENTRY_H_
« no previous file with comments | « ios/web/navigation/crw_session_controller_unittest.mm ('k') | ios/web/navigation/crw_session_entry.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698