Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2012 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 IOS_WEB_NAVIGATION_CRW_SESSION_ENTRY_H_ | |
| 6 #define IOS_WEB_NAVIGATION_CRW_SESSION_ENTRY_H_ | |
| 7 | |
| 8 #import <Foundation/Foundation.h> | |
| 9 | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/strings/string16.h" | |
| 12 #include "base/time/time.h" | |
| 13 #include "ui/base/page_transition_types.h" | |
| 14 #include "url/gurl.h" | |
| 15 | |
| 16 namespace web { | |
| 17 class NavigationItem; | |
| 18 struct Referrer; | |
| 19 } | |
| 20 | |
| 21 // A CRWSessionEntry is similar to a NavigationEntry object in desktop Chrome. | |
| 22 // It maintains the information needed to save/restore a single entry in session | |
| 23 // history (i.e., one site) for a tab. A tab may have multiple of these objects | |
| 24 // comprising its entire session history. | |
| 25 // TODO(rohitrao): Fold CRWSessionEntry's logic into NavigationItem. | |
| 26 @interface CRWSessionEntry : NSObject<NSCoding, NSCopying> | |
| 27 | |
|
Eugene But (OOO till 7-30)
2015/03/23 22:51:58
Comments?
| |
| 28 @property(nonatomic, assign) NSInteger index; | |
| 29 @property(nonatomic, readonly) const GURL& originalUrl; | |
| 30 @property(nonatomic, assign) BOOL useDesktopUserAgent; | |
| 31 @property(nonatomic, assign) BOOL usedDataReductionProxy; | |
| 32 @property(nonatomic, retain) NSDictionary* state; | |
| 33 @property(nonatomic, retain) NSString* serializedStateObject; | |
| 34 @property(nonatomic, assign) BOOL createdFromPushState; | |
| 35 @property(nonatomic, retain) NSData* POSTData; | |
| 36 @property(nonatomic, readonly) NSDictionary* httpHeaders; | |
| 37 @property(nonatomic, assign) BOOL skipResubmitDataConfirmation; | |
| 38 | |
| 39 // Initialize the session entry with the given url. | |
| 40 - (id)initWithUrl:(const GURL&)url | |
| 41 referrer:(const web::Referrer&)referrer | |
| 42 transition:(ui::PageTransition)transition | |
| 43 useDesktopUserAgent:(BOOL)useDesktopUserAgent | |
| 44 rendererInitiated:(BOOL)rendererInitiated; | |
| 45 | |
| 46 // Initialize the session entry with the given NavigationItem. | |
| 47 - (id)initWithNavigationItem:(scoped_ptr<web::NavigationItem>)item | |
| 48 index:(int)index; | |
| 49 | |
| 50 // Returns a pointer to the NavigationItem associated with this CRWSessionEntry. | |
| 51 // Eventually, this will replace CRWSessionEntry entirely. | |
| 52 - (web::NavigationItem*)navigationItem; | |
| 53 | |
| 54 // Adds headers from |moreHTTPHeaders| to |httpHeaders|; existing headers with | |
| 55 // the same key will be overridden. | |
| 56 - (void)addHTTPHeaders:(NSDictionary*)moreHTTPHeaders; | |
| 57 | |
| 58 // Removes the header for the given key from |httpHeaders|. | |
| 59 - (void)removeHTTPHeaderForKey:(NSString*)key; | |
| 60 | |
| 61 // Resets |httpHeaders| to nil. | |
| 62 - (void)resetHTTPHeaders; | |
| 63 | |
| 64 @end | |
| 65 | |
| 66 #endif // IOS_WEB_NAVIGATION_CRW_SESSION_ENTRY_H_ | |
| OLD | NEW |