Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ios / chrome / browser / net / metrics_network_client_manager.h
blobbc7d2a1184df8590f90b965e996d3207068ff711
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
3 // found in the LICENSE file.
5 #ifndef IOS_CHROME_BROWSER_NET_METRICS_NETWORK_CLIENT_MANAGER_H_
6 #define IOS_CHROME_BROWSER_NET_METRICS_NETWORK_CLIENT_MANAGER_H_
8 #import <Foundation/Foundation.h>
10 #import "base/time/time.h"
11 #import "ios/net/clients/crn_forwarding_network_client_factory.h"
12 #include "url/gurl.h"
14 @interface PageLoadTimeRecord : NSObject
15 @property(nonatomic, assign) BOOL dataProxyUsed;
16 @end
18 // Factory that creates MetricsNetworkClient instances.
19 // Each Tab that cares to report page load metrics should create an instance
20 // of this class add add it to its request tracker.
21 @interface MetricsNetworkClientManager : CRNForwardingNetworkClientFactory
23 // Called by the tab when a new page load is about to start, to signal the
24 // current page URL.
25 - (void)pageLoadStarted:(GURL)url;
27 // Called by the tab when the page load is complete.
28 - (void)pageLoadCompleted;
30 // Return a page load time record that will be used to record a load of |url|
31 // that started at |time|. Returns nil if |url| doesn't match the current page
32 // url. The page load record is owned by the target, and the caller should not
33 // take ownership of it.
34 // This method should only be called on the IO thread.
35 - (PageLoadTimeRecord*)recordForPageLoad:(const GURL&)url
36 time:(base::TimeTicks)time;
37 @end
39 #endif // IOS_CHROME_BROWSER_NET_METRICS_NETWORK_CLIENT_MANAGER_H_