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

Side by Side Diff: src/api.cc

Issue 2083005: CPU profiler: add secure profiles by filtering out functions using security tokens. (Closed)
Patch Set: Reworded comment Created 10 years, 7 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
« no previous file with comments | « include/v8-profiler.h ('k') | src/cpu-profiler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4232 matching lines...) Expand 10 before | Expand all | Expand 10 after
4243 return reinterpret_cast<const CpuProfileNode*>(profile->top_down()->root()); 4243 return reinterpret_cast<const CpuProfileNode*>(profile->top_down()->root());
4244 } 4244 }
4245 4245
4246 4246
4247 int CpuProfiler::GetProfilesCount() { 4247 int CpuProfiler::GetProfilesCount() {
4248 IsDeadCheck("v8::CpuProfiler::GetProfilesCount"); 4248 IsDeadCheck("v8::CpuProfiler::GetProfilesCount");
4249 return i::CpuProfiler::GetProfilesCount(); 4249 return i::CpuProfiler::GetProfilesCount();
4250 } 4250 }
4251 4251
4252 4252
4253 const CpuProfile* CpuProfiler::GetProfile(int index) { 4253 const CpuProfile* CpuProfiler::GetProfile(int index,
4254 Handle<Value> security_token) {
4254 IsDeadCheck("v8::CpuProfiler::GetProfile"); 4255 IsDeadCheck("v8::CpuProfiler::GetProfile");
4255 return reinterpret_cast<const CpuProfile*>(i::CpuProfiler::GetProfile(index)); 4256 return reinterpret_cast<const CpuProfile*>(
4257 i::CpuProfiler::GetProfile(
4258 security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
4259 index));
4256 } 4260 }
4257 4261
4258 4262
4259 const CpuProfile* CpuProfiler::FindProfile(unsigned uid) { 4263 const CpuProfile* CpuProfiler::FindProfile(unsigned uid,
4264 Handle<Value> security_token) {
4260 IsDeadCheck("v8::CpuProfiler::FindProfile"); 4265 IsDeadCheck("v8::CpuProfiler::FindProfile");
4261 return reinterpret_cast<const CpuProfile*>(i::CpuProfiler::FindProfile(uid)); 4266 return reinterpret_cast<const CpuProfile*>(
4267 i::CpuProfiler::FindProfile(
4268 security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
4269 uid));
4262 } 4270 }
4263 4271
4264 4272
4265 void CpuProfiler::StartProfiling(Handle<String> title) { 4273 void CpuProfiler::StartProfiling(Handle<String> title) {
4266 IsDeadCheck("v8::CpuProfiler::StartProfiling"); 4274 IsDeadCheck("v8::CpuProfiler::StartProfiling");
4267 i::CpuProfiler::StartProfiling(*Utils::OpenHandle(*title)); 4275 i::CpuProfiler::StartProfiling(*Utils::OpenHandle(*title));
4268 } 4276 }
4269 4277
4270 4278
4271 const CpuProfile* CpuProfiler::StopProfiling(Handle<String> title) { 4279 const CpuProfile* CpuProfiler::StopProfiling(Handle<String> title,
4280 Handle<Value> security_token) {
4272 IsDeadCheck("v8::CpuProfiler::StopProfiling"); 4281 IsDeadCheck("v8::CpuProfiler::StopProfiling");
4273 return reinterpret_cast<const CpuProfile*>( 4282 return reinterpret_cast<const CpuProfile*>(
4274 i::CpuProfiler::StopProfiling(*Utils::OpenHandle(*title))); 4283 i::CpuProfiler::StopProfiling(
4284 security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
4285 *Utils::OpenHandle(*title)));
4275 } 4286 }
4276 4287
4277 #endif // ENABLE_LOGGING_AND_PROFILING 4288 #endif // ENABLE_LOGGING_AND_PROFILING
4278 4289
4279 4290
4280 namespace internal { 4291 namespace internal {
4281 4292
4282 4293
4283 HandleScopeImplementer* HandleScopeImplementer::instance() { 4294 HandleScopeImplementer* HandleScopeImplementer::instance() {
4284 return &thread_local; 4295 return &thread_local;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
4353 4364
4354 4365
4355 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 4366 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
4356 HandleScopeImplementer* thread_local = 4367 HandleScopeImplementer* thread_local =
4357 reinterpret_cast<HandleScopeImplementer*>(storage); 4368 reinterpret_cast<HandleScopeImplementer*>(storage);
4358 thread_local->IterateThis(v); 4369 thread_local->IterateThis(v);
4359 return storage + ArchiveSpacePerThread(); 4370 return storage + ArchiveSpacePerThread();
4360 } 4371 }
4361 4372
4362 } } // namespace v8::internal 4373 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-profiler.h ('k') | src/cpu-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698