Home | History | Annotate | Download | only in trace_event_impl
      1 # Copyright 2016 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.
      4 
      5 import types
      6 
      7 from py_trace_event.trace_event_impl import decorators
      8 
      9 
     10 class TracedMetaClass(type):
     11   def __new__(cls, name, bases, attrs):
     12     for attr_name, attr_value in attrs.iteritems():
     13       if isinstance(attr_value, types.FunctionType):
     14         attrs[attr_name] = decorators.traced(attr_value)
     15 
     16     return super(TracedMetaClass, cls).__new__(cls, name, bases, attrs)
     17