| 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 #ifndef IOS_WEB_NET_REQUEST_TRACKER_IMPL_H_ | 5 #ifndef IOS_WEB_NET_REQUEST_TRACKER_IMPL_H_ |
| 6 #define IOS_WEB_NET_REQUEST_TRACKER_IMPL_H_ | 6 #define IOS_WEB_NET_REQUEST_TRACKER_IMPL_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 void PostBlock(id caller, void (^block)(id), web::WebThread::ID thread); | 322 void PostBlock(id caller, void (^block)(id), web::WebThread::ID thread); |
| 323 | 323 |
| 324 #pragma mark Other internal methods. | 324 #pragma mark Other internal methods. |
| 325 // Returns the current state of the page. | 325 // Returns the current state of the page. |
| 326 PageCounts pageCounts(); | 326 PageCounts pageCounts(); |
| 327 | 327 |
| 328 // Like description, but cannot be called from any thread. It must be called | 328 // Like description, but cannot be called from any thread. It must be called |
| 329 // only from the IO thread. | 329 // only from the IO thread. |
| 330 NSString* UnsafeDescription(); | 330 NSString* UnsafeDescription(); |
| 331 | 331 |
| 332 // Generates a string unique to this RequestTrackerImpl to use with the | |
| 333 // CRWNetworkActivityIndicatorManager. | |
| 334 NSString* GetNetworkActivityKey(); | |
| 335 | |
| 336 #pragma mark Non thread-safe fields, only accessed from the main thread. | 332 #pragma mark Non thread-safe fields, only accessed from the main thread. |
| 337 // The RequestTrackerImpl delegate. All changes and access to this object | 333 // The RequestTrackerImpl delegate. All changes and access to this object |
| 338 // should be done on the main thread. | 334 // should be done on the main thread. |
| 339 id<CRWRequestTrackerDelegate> delegate_; // Weak. | 335 id<CRWRequestTrackerDelegate> delegate_; // Weak. |
| 340 | 336 |
| 341 #pragma mark Non thread-safe fields, only accessed from the IO thread. | 337 #pragma mark Non thread-safe fields, only accessed from the IO thread. |
| 342 // All the tracked requests for the page, indexed by net::URLRequest (Cast as | 338 // All the tracked requests for the page, indexed by net::URLRequest (Cast as |
| 343 // a void* to avoid the temptation of accessing it from the wrong thread). | 339 // a void* to avoid the temptation of accessing it from the wrong thread). |
| 344 // This map is not exhaustive: it is only meant to estimate the loading | 340 // This map is not exhaustive: it is only meant to estimate the loading |
| 345 // progress, and thus requests corresponding to old navigation events are not | 341 // progress, and thus requests corresponding to old navigation events are not |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 // Flag to synchronize deletion and callback creation. Lives on the IO thread. | 382 // Flag to synchronize deletion and callback creation. Lives on the IO thread. |
| 387 // True when this tracker has beed Close()d. If this is the case, no further | 383 // True when this tracker has beed Close()d. If this is the case, no further |
| 388 // references to it should be generated (for example by binding it into a | 384 // references to it should be generated (for example by binding it into a |
| 389 // callback), and the expectation is that it will soon be deleted. | 385 // callback), and the expectation is that it will soon be deleted. |
| 390 bool is_closing_; | 386 bool is_closing_; |
| 391 }; | 387 }; |
| 392 | 388 |
| 393 } // namespace web | 389 } // namespace web |
| 394 | 390 |
| 395 #endif // IOS_WEB_NET_REQUEST_TRACKER_IMPL_H_ | 391 #endif // IOS_WEB_NET_REQUEST_TRACKER_IMPL_H_ |
| OLD | NEW |