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

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

Issue 125043004: Remove world type from hasInstance() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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
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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 { 278 {
279 } 279 }
280 280
281 virtual void VisitPersistentHandle(v8::Persistent<v8::Value>* value, uin t16_t classId) OVERRIDE 281 virtual void VisitPersistentHandle(v8::Persistent<v8::Value>* value, uin t16_t classId) OVERRIDE
282 { 282 {
283 if (classId != v8DOMNodeClassId) 283 if (classId != v8DOMNodeClassId)
284 return; 284 return;
285 // Casting to Handle is safe here, since the Persistent cannot get 285 // Casting to Handle is safe here, since the Persistent cannot get
286 // GCd during visiting. 286 // GCd during visiting.
287 v8::Handle<v8::Object>* wrapper = reinterpret_cast<v8::Handle<v8::Ob ject>*>(value); 287 v8::Handle<v8::Object>* wrapper = reinterpret_cast<v8::Handle<v8::Ob ject>*>(value);
288 ASSERT_UNUSED(m_isolate, V8Node::hasInstanceInAnyWorld(*wrapper, m_i solate)); 288 ASSERT_UNUSED(m_isolate, V8Node::hasInstance(*wrapper, m_isolate));
289 ASSERT((*wrapper)->IsObject()); 289 ASSERT((*wrapper)->IsObject());
290 m_visitor->visitNode(V8Node::toNative(*wrapper)); 290 m_visitor->visitNode(V8Node::toNative(*wrapper));
291 } 291 }
292 292
293 private: 293 private:
294 WrappedNodeVisitor* m_visitor; 294 WrappedNodeVisitor* m_visitor;
295 v8::Isolate* m_isolate; 295 v8::Isolate* m_isolate;
296 } wrapperVisitor(visitor, isolate); 296 } wrapperVisitor(visitor, isolate);
297 297
298 v8::V8::VisitHandlesWithClassIds(&wrapperVisitor); 298 v8::V8::VisitHandlesWithClassIds(&wrapperVisitor);
299 } 299 }
300 300
301 ProfileNameIdleTimeMap* ScriptProfiler::currentProfileNameIdleTimeMap() 301 ProfileNameIdleTimeMap* ScriptProfiler::currentProfileNameIdleTimeMap()
302 { 302 {
303 AtomicallyInitializedStatic(WTF::ThreadSpecific<ProfileNameIdleTimeMap>*, ma p = new WTF::ThreadSpecific<ProfileNameIdleTimeMap>); 303 AtomicallyInitializedStatic(WTF::ThreadSpecific<ProfileNameIdleTimeMap>*, ma p = new WTF::ThreadSpecific<ProfileNameIdleTimeMap>);
304 return *map; 304 return *map;
305 } 305 }
306 306
307 void ScriptProfiler::setIdle(bool isIdle) 307 void ScriptProfiler::setIdle(bool isIdle)
308 { 308 {
309 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 309 v8::Isolate* isolate = v8::Isolate::GetCurrent();
310 if (v8::CpuProfiler* profiler = isolate->GetCpuProfiler()) 310 if (v8::CpuProfiler* profiler = isolate->GetCpuProfiler())
311 profiler->SetIdle(isIdle); 311 profiler->SetIdle(isIdle);
312 } 312 }
313 313
314 } // namespace WebCore 314 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/IDBBindingUtilities.cpp ('k') | Source/bindings/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698