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

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

Issue 113213002: Rename toWebCoreString*() utility methods to toCoreString*() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Keep "to" prefix Created 7 years 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
« no previous file with comments | « Source/bindings/v8/ScriptPreprocessor.cpp ('k') | Source/bindings/v8/ScriptValue.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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 { 77 {
78 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 78 v8::Isolate* isolate = v8::Isolate::GetCurrent();
79 v8::CpuProfiler* profiler = isolate->GetCpuProfiler(); 79 v8::CpuProfiler* profiler = isolate->GetCpuProfiler();
80 if (!profiler) 80 if (!profiler)
81 return 0; 81 return 0;
82 v8::HandleScope handleScope(isolate); 82 v8::HandleScope handleScope(isolate);
83 const v8::CpuProfile* profile = profiler->StopCpuProfiling(v8String(isolate, title)); 83 const v8::CpuProfile* profile = profiler->StopCpuProfiling(v8String(isolate, title));
84 if (!profile) 84 if (!profile)
85 return 0; 85 return 0;
86 86
87 String profileTitle = toWebCoreString(profile->GetTitle()); 87 String profileTitle = toCoreString(profile->GetTitle());
88 double idleTime = 0.0; 88 double idleTime = 0.0;
89 ProfileNameIdleTimeMap* profileNameIdleTimeMap = ScriptProfiler::currentProf ileNameIdleTimeMap(); 89 ProfileNameIdleTimeMap* profileNameIdleTimeMap = ScriptProfiler::currentProf ileNameIdleTimeMap();
90 ProfileNameIdleTimeMap::iterator profileIdleTime = profileNameIdleTimeMap->f ind(profileTitle); 90 ProfileNameIdleTimeMap::iterator profileIdleTime = profileNameIdleTimeMap->f ind(profileTitle);
91 if (profileIdleTime != profileNameIdleTimeMap->end()) { 91 if (profileIdleTime != profileNameIdleTimeMap->end()) {
92 idleTime = profileIdleTime->value * 1000.0; 92 idleTime = profileIdleTime->value * 1000.0;
93 profileNameIdleTimeMap->remove(profileIdleTime); 93 profileNameIdleTimeMap->remove(profileIdleTime);
94 } 94 }
95 95
96 return ScriptProfile::create(profile, idleTime); 96 return ScriptProfile::create(profile, idleTime);
97 } 97 }
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 312 }
313 313
314 void ScriptProfiler::setIdle(bool isIdle) 314 void ScriptProfiler::setIdle(bool isIdle)
315 { 315 {
316 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 316 v8::Isolate* isolate = v8::Isolate::GetCurrent();
317 if (v8::CpuProfiler* profiler = isolate->GetCpuProfiler()) 317 if (v8::CpuProfiler* profiler = isolate->GetCpuProfiler())
318 profiler->SetIdle(isIdle); 318 profiler->SetIdle(isIdle);
319 } 319 }
320 320
321 } // namespace WebCore 321 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptPreprocessor.cpp ('k') | Source/bindings/v8/ScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698