11e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)/* 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Copyright (C) 2013 Google Inc. All rights reserved. 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Redistribution and use in source and binary forms, with or without 51e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) * modification, are permitted provided that the following conditions are 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * met: 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 8cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) * * Redistributions of source code must retain the above copyright 97d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) * notice, this list of conditions and the following disclaimer. 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * * Redistributions in binary form must reproduce the above 11cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) * copyright notice, this list of conditions and the following disclaimer 12868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) * in the documentation and/or other materials provided with the 13868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) * distribution. 14868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) * * Neither the name of Google Inc. nor the names of its 15eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch * contributors may be used to endorse or promote products derived from 16cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) * this software without specific prior written permission. 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * 18bb1529ce867d8845a77ec7cdf3e3003ef1771a40Ben Murdoch * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 201e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 211e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 221e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef InternalProfilers_h 325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define InternalProfilers_h 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "bindings/core/v8/ScriptWrappable.h" 352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "platform/heap/Handle.h" 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "wtf/Forward.h" 375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "wtf/PassRefPtr.h" 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "wtf/RefCounted.h" 395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace blink { 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class InternalProfilers FINAL : public GarbageCollected<InternalProfilers>, public ScriptWrappable { 432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) DEFINE_WRAPPERTYPEINFO(); 44cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)public: 455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) InternalProfilers(); 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) static InternalProfilers* create() 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) { 49116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch return new InternalProfilers(); 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void startHeapProfiling(const String& prefix); 535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void stopHeapProfiling(); 545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void dumpHeapProfiling(const String& reason); 555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) String getHeapProfile(); 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void trace(Visitor*) { } 585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}; 595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace blink 615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif // InternalProfilers_h 635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)