| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "ios/web/web_state/ui/crw_ui_web_view_web_controller.h" | 5 #import "ios/web/web_state/ui/crw_ui_web_view_web_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
| 7 #import "base/ios/ios_util.h" | 10 #import "base/ios/ios_util.h" |
| 8 #import "base/ios/ns_error_util.h" | 11 #import "base/ios/ns_error_util.h" |
| 9 #import "base/ios/weak_nsobject.h" | 12 #import "base/ios/weak_nsobject.h" |
| 10 #include "base/json/json_reader.h" | 13 #include "base/json/json_reader.h" |
| 11 #include "base/json/string_escape.h" | 14 #include "base/json/string_escape.h" |
| 12 #include "base/mac/bind_objc_block.h" | 15 #include "base/mac/bind_objc_block.h" |
| 13 #import "base/mac/scoped_nsobject.h" | 16 #import "base/mac/scoped_nsobject.h" |
| 17 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/metrics/field_trial.h" | 19 #include "base/metrics/field_trial.h" |
| 16 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
| 17 #include "base/strings/sys_string_conversions.h" | 21 #include "base/strings/sys_string_conversions.h" |
| 18 #include "base/timer/timer.h" | 22 #include "base/timer/timer.h" |
| 19 #include "base/values.h" | 23 #include "base/values.h" |
| 20 #import "ios/net/nsurlrequest_util.h" | 24 #import "ios/net/nsurlrequest_util.h" |
| 21 #import "ios/web/navigation/crw_session_controller.h" | 25 #import "ios/web/navigation/crw_session_controller.h" |
| 22 #import "ios/web/navigation/crw_session_entry.h" | 26 #import "ios/web/navigation/crw_session_entry.h" |
| 23 #import "ios/web/navigation/navigation_item_impl.h" | 27 #import "ios/web/navigation/navigation_item_impl.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 39 #import "net/base/mac/url_conversions.h" | 43 #import "net/base/mac/url_conversions.h" |
| 40 #include "net/base/net_errors.h" | 44 #include "net/base/net_errors.h" |
| 41 #include "url/url_constants.h" | 45 #include "url/url_constants.h" |
| 42 | 46 |
| 43 namespace web { | 47 namespace web { |
| 44 | 48 |
| 45 // The following continuous check timer frequency constants are externally | 49 // The following continuous check timer frequency constants are externally |
| 46 // available for the purpose of performance tests. | 50 // available for the purpose of performance tests. |
| 47 // Frequency for the continuous checks when a reset in the page object is | 51 // Frequency for the continuous checks when a reset in the page object is |
| 48 // anticipated shortly. In milliseconds. | 52 // anticipated shortly. In milliseconds. |
| 49 const int64 kContinuousCheckIntervalMSHigh = 100; | 53 const int64_t kContinuousCheckIntervalMSHigh = 100; |
| 50 | 54 |
| 51 // The maximum duration that the CRWWebController can run in high-frequency | 55 // The maximum duration that the CRWWebController can run in high-frequency |
| 52 // check mode before being changed back to the low frequency. | 56 // check mode before being changed back to the low frequency. |
| 53 const int64 kContinuousCheckHighFrequencyMSMaxDuration = 5000; | 57 const int64_t kContinuousCheckHighFrequencyMSMaxDuration = 5000; |
| 54 | 58 |
| 55 // Frequency for the continuous checks when a reset in the page object is not | 59 // Frequency for the continuous checks when a reset in the page object is not |
| 56 // anticipated; checks are only made as a precaution. | 60 // anticipated; checks are only made as a precaution. |
| 57 // The URL could be out of date for this many milliseconds, so this should not | 61 // The URL could be out of date for this many milliseconds, so this should not |
| 58 // be increased without careful consideration. | 62 // be increased without careful consideration. |
| 59 const int64 kContinuousCheckIntervalMSLow = 3000; | 63 const int64_t kContinuousCheckIntervalMSLow = 3000; |
| 60 | 64 |
| 61 } // namespace web | 65 } // namespace web |
| 62 | 66 |
| 63 @interface CRWUIWebViewWebController () <CRWRedirectClientDelegate, | 67 @interface CRWUIWebViewWebController () <CRWRedirectClientDelegate, |
| 64 UIWebViewDelegate> { | 68 UIWebViewDelegate> { |
| 65 // The UIWebView managed by this instance. | 69 // The UIWebView managed by this instance. |
| 66 base::scoped_nsobject<UIWebView> _uiWebView; | 70 base::scoped_nsobject<UIWebView> _uiWebView; |
| 67 | 71 |
| 68 // Whether caching of the current URL is enabled or not. | 72 // Whether caching of the current URL is enabled or not. |
| 69 BOOL _urlCachingEnabled; | 73 BOOL _urlCachingEnabled; |
| (...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1574 } | 1578 } |
| 1575 | 1579 |
| 1576 #pragma mark - | 1580 #pragma mark - |
| 1577 #pragma mark Testing methods | 1581 #pragma mark Testing methods |
| 1578 | 1582 |
| 1579 -(id<CRWRecurringTaskDelegate>)recurringTaskDelegate { | 1583 -(id<CRWRecurringTaskDelegate>)recurringTaskDelegate { |
| 1580 return _recurringTaskDelegate; | 1584 return _recurringTaskDelegate; |
| 1581 } | 1585 } |
| 1582 | 1586 |
| 1583 @end | 1587 @end |
| OLD | NEW |