OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011, Google Inc. All rights reserved. | 2 * Copyright (c) 2011, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 if (profileIdleTime != profileNameIdleTimeMap->end()) { | 89 if (profileIdleTime != profileNameIdleTimeMap->end()) { |
90 idleTime = profileIdleTime->value * 1000.0; | 90 idleTime = profileIdleTime->value * 1000.0; |
91 profileNameIdleTimeMap->remove(profileIdleTime); | 91 profileNameIdleTimeMap->remove(profileIdleTime); |
92 } | 92 } |
93 | 93 |
94 return ScriptProfile::create(profile, idleTime); | 94 return ScriptProfile::create(profile, idleTime); |
95 } | 95 } |
96 | 96 |
97 void ScriptProfiler::collectGarbage() | 97 void ScriptProfiler::collectGarbage() |
98 { | 98 { |
99 v8::V8::LowMemoryNotification(); | 99 v8::Isolate::GetCurrent()->LowMemoryNotification(); |
100 } | 100 } |
101 | 101 |
102 ScriptValue ScriptProfiler::objectByHeapObjectId(unsigned id) | 102 ScriptValue ScriptProfiler::objectByHeapObjectId(unsigned id) |
103 { | 103 { |
104 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 104 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
105 v8::HeapProfiler* profiler = isolate->GetHeapProfiler(); | 105 v8::HeapProfiler* profiler = isolate->GetHeapProfiler(); |
106 v8::HandleScope handleScope(isolate); | 106 v8::HandleScope handleScope(isolate); |
107 v8::Handle<v8::Value> value = profiler->FindObjectById(id); | 107 v8::Handle<v8::Value> value = profiler->FindObjectById(id); |
108 if (value.IsEmpty() || !value->IsObject()) | 108 if (value.IsEmpty() || !value->IsObject()) |
109 return ScriptValue(); | 109 return ScriptValue(); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 301 } |
302 | 302 |
303 void ScriptProfiler::setIdle(bool isIdle) | 303 void ScriptProfiler::setIdle(bool isIdle) |
304 { | 304 { |
305 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 305 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
306 if (v8::CpuProfiler* profiler = isolate->GetCpuProfiler()) | 306 if (v8::CpuProfiler* profiler = isolate->GetCpuProfiler()) |
307 profiler->SetIdle(isIdle); | 307 profiler->SetIdle(isIdle); |
308 } | 308 } |
309 | 309 |
310 } // namespace blink | 310 } // namespace blink |
OLD | NEW |