| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ | 5 #ifndef IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ |
| 6 #define IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ | 6 #define IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 201 |
| 202 // Create a new tracker using |delegate| as its delegate. | 202 // Create a new tracker using |delegate| as its delegate. |
| 203 void InitializeRequestTracker(id<CRWRequestTrackerDelegate> delegate); | 203 void InitializeRequestTracker(id<CRWRequestTrackerDelegate> delegate); |
| 204 | 204 |
| 205 // Close the request tracker and delete it. | 205 // Close the request tracker and delete it. |
| 206 void CloseRequestTracker(); | 206 void CloseRequestTracker(); |
| 207 | 207 |
| 208 // Returns the tracker for this WebStateImpl. | 208 // Returns the tracker for this WebStateImpl. |
| 209 RequestTrackerImpl* GetRequestTracker(); | 209 RequestTrackerImpl* GetRequestTracker(); |
| 210 | 210 |
| 211 // Gets and sets the mode controlling the HTTP cache behavior. | |
| 212 // TODO(rohitrao): As with the other RequestTracker-related methods, this | |
| 213 // should become an internal detail of this class. | |
| 214 net::RequestTracker::CacheMode GetCacheMode(); | |
| 215 void SetCacheMode(net::RequestTracker::CacheMode mode); | |
| 216 | |
| 217 // Lazily creates (if necessary) and returns |request_group_id_|. | 211 // Lazily creates (if necessary) and returns |request_group_id_|. |
| 218 // IMPORTANT: This should not be used for anything other than associating this | 212 // IMPORTANT: This should not be used for anything other than associating this |
| 219 // instance to network requests. | 213 // instance to network requests. |
| 220 // This function is only intended to be used in web/. | 214 // This function is only intended to be used in web/. |
| 221 // TODO(stuartmorgan): Move this method in an implementation file in web/. | 215 // TODO(stuartmorgan): Move this method in an implementation file in web/. |
| 222 NSString* GetRequestGroupID(); | 216 NSString* GetRequestGroupID(); |
| 223 | 217 |
| 224 // WebState: | 218 // WebState: |
| 225 UIView* GetView() override; | 219 UIView* GetView() override; |
| 226 web::WebViewType GetWebViewType() const override; | 220 web::WebViewType GetWebViewType() const override; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 317 |
| 324 // Weak pointer to the interstitial page being displayed, if any. | 318 // Weak pointer to the interstitial page being displayed, if any. |
| 325 WebInterstitialImpl* interstitial_; | 319 WebInterstitialImpl* interstitial_; |
| 326 | 320 |
| 327 // Returned by reference. | 321 // Returned by reference. |
| 328 base::string16 empty_string16_; | 322 base::string16 empty_string16_; |
| 329 | 323 |
| 330 // Request tracker associted with this object. | 324 // Request tracker associted with this object. |
| 331 scoped_refptr<RequestTrackerImpl> request_tracker_; | 325 scoped_refptr<RequestTrackerImpl> request_tracker_; |
| 332 | 326 |
| 333 // Mode controlling the HTTP cache behavior. | |
| 334 net::RequestTracker::CacheMode cache_mode_; | |
| 335 | |
| 336 // A number identifying this object. This number is injected into the user | 327 // A number identifying this object. This number is injected into the user |
| 337 // agent to allow the network layer to know which web view requests originated | 328 // agent to allow the network layer to know which web view requests originated |
| 338 // from. | 329 // from. |
| 339 base::scoped_nsobject<NSString> request_group_id_; | 330 base::scoped_nsobject<NSString> request_group_id_; |
| 340 | 331 |
| 341 // Callbacks associated to command prefixes. | 332 // Callbacks associated to command prefixes. |
| 342 std::map<std::string, ScriptCommandCallback> script_command_callbacks_; | 333 std::map<std::string, ScriptCommandCallback> script_command_callbacks_; |
| 343 | 334 |
| 344 // Member variables should appear before the WeakPtrFactory<> to ensure that | 335 // Member variables should appear before the WeakPtrFactory<> to ensure that |
| 345 // any WeakPtrs to WebStateImpl are invalidated before its member variable's | 336 // any WeakPtrs to WebStateImpl are invalidated before its member variable's |
| 346 // destructors are executed, rendering them invalid. | 337 // destructors are executed, rendering them invalid. |
| 347 base::WeakPtrFactory<WebState> weak_factory_; | 338 base::WeakPtrFactory<WebState> weak_factory_; |
| 348 | 339 |
| 349 DISALLOW_COPY_AND_ASSIGN(WebStateImpl); | 340 DISALLOW_COPY_AND_ASSIGN(WebStateImpl); |
| 350 }; | 341 }; |
| 351 | 342 |
| 352 } // namespace web | 343 } // namespace web |
| 353 | 344 |
| 354 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ | 345 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ |
| OLD | NEW |