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

Side by Side Diff: Source/bindings/core/v8/ScriptProfiler.cpp

Issue 422293004: Update memory related v8 notifications API calls (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/core/v8/V8GCForContextDispose.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/V8GCForContextDispose.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698