Make castv2 performance test work.
[chromium-blink-merge.git] / components / keyed_service / ios / browser_state_helper.h
blob2c4e0b5c433607404910b8acd335e43875d29392
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 COMPONENTS_KEYED_SERVICE_IOS_BROWSER_STATE_HELPER_H_
6 #define COMPONENTS_KEYED_SERVICE_IOS_BROWSER_STATE_HELPER_H_
8 namespace base {
9 class SupportsUserData;
12 namespace web {
13 class BrowserState;
16 // TODO(sdefresne): remove this file and all usage of the methods once iOS code
17 // only use BrowserStateKeyedServiceFactory, http://crbug.com/419366
19 // |BrowserStateFromContextFn| converts from a base::SupportsUserData as passed
20 // to a (Refcounted)?BrowserStateKeyedServiceFactory to a web::BrowserState.
21 using BrowserStateFromContextFn =
22 web::BrowserState* (*)(base::SupportsUserData*);
24 // Registers an helper function to convert a |context| to a web::BrowserState
25 // to allow the embedder to overrides how the BSKSF does the conversion.
26 void SetBrowserStateFromContextHelper(BrowserStateFromContextFn helper);
28 // Converts a |context| to a web::BrowserState using the helper registered by
29 // the embedder if any. Usage is restricted to //components/keyed_service/ios.
30 web::BrowserState* BrowserStateFromContext(base::SupportsUserData* context);
32 #endif // COMPONENTS_KEYED_SERVICE_IOS_BROWSER_STATE_HELPER_H_