Edit

kc3-lang/angle/util/Timer.h

Branch :

  • Show log

    Commit

  • Author : Nico Weber
    Date : 2015-04-06 09:02:37
    Hash : 51a1db16
    Message : Give Timer a virtual destructor as it's deleted polymorphically. Found by clang: ..\..\third_party\angle\src\common/angleutils.h(66,5) : error: delete called on 'Timer' that is abstract but has non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor] delete resource; ^ ..\..\third_party\angle\src\tests\perf_tests\ANGLEPerfTest.cpp(26,5) : note: in instantiation of function template specialization 'SafeDelete<Timer>' requested here SafeDelete(mTimer); ^ BUG=chromium:82385 Change-Id: I69033b1802b5dffbdf2d80889aca7019d710d481 Reviewed-on: https://chromium-review.googlesource.com/264061 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>

  • util/Timer.h
  • //
    // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    
    #ifndef SAMPLE_UTIL_TIMER_H
    #define SAMPLE_UTIL_TIMER_H
    
    class Timer
    {
      public:
        virtual ~Timer() {}
        virtual void start() = 0;
        virtual void stop() = 0;
        virtual double getElapsedTime() const = 0;
    };
    
    Timer *CreateTimer();
    
    #endif // SAMPLE_UTIL_TIMER_H