Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1598)

Side by Side Diff: tools/telemetry/telemetry/internal/platform/profiler/profiler_finder.py

Issue 1263063003: Revert of Create classes_util API, change discover to return a list instead of a dict. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 import os 5 import os
6 6
7 from telemetry.core import discover
7 from telemetry.internal.platform import profiler 8 from telemetry.internal.platform import profiler
8 from telemetry.core import util 9 from telemetry.core import util
9 from telemetry.util import classes_util
10 10
11 11
12 def _DiscoverProfilers(): 12 def _DiscoverProfilers():
13 profiler_dir = os.path.dirname(__file__) 13 profiler_dir = os.path.dirname(__file__)
14 return classes_util.DiscoverClasses( 14 return discover.DiscoverClasses(profiler_dir, util.GetTelemetryDir(),
15 profiler_dir, util.GetTelemetryDir(), profiler.Profiler) 15 profiler.Profiler,
16 index_by_class_name=True).values()
16 17
17 18
18 def FindProfiler(name): 19 def FindProfiler(name):
19 for p in _DiscoverProfilers(): 20 for p in _DiscoverProfilers():
20 if p.name() == name: 21 if p.name() == name:
21 return p 22 return p
22 return None 23 return None
23 24
24 25
25 def GetAllAvailableProfilers(): 26 def GetAllAvailableProfilers():
26 return sorted([p.name() for p in _DiscoverProfilers() 27 return sorted([p.name() for p in _DiscoverProfilers()
27 if p.is_supported(browser_type='any')]) 28 if p.is_supported(browser_type='any')])
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/core/platform.py ('k') | tools/telemetry/telemetry/internal/platform/tracing_controller_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698