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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } | 158 } |
159 private: | 159 private: |
160 ScriptProfiler::HeapSnapshotProgress* m_progress; | 160 ScriptProfiler::HeapSnapshotProgress* m_progress; |
161 bool m_firstReport; | 161 bool m_firstReport; |
162 }; | 162 }; |
163 | 163 |
164 class GlobalObjectNameResolver FINAL : public v8::HeapProfiler::ObjectNameResolv
er { | 164 class GlobalObjectNameResolver FINAL : public v8::HeapProfiler::ObjectNameResolv
er { |
165 public: | 165 public: |
166 virtual const char* GetName(v8::Handle<v8::Object> object) OVERRIDE | 166 virtual const char* GetName(v8::Handle<v8::Object> object) OVERRIDE |
167 { | 167 { |
168 DOMWindow* window = toDOMWindow(object, v8::Isolate::GetCurrent()); | 168 LocalDOMWindow* window = toDOMWindow(object, v8::Isolate::GetCurrent()); |
169 if (!window) | 169 if (!window) |
170 return 0; | 170 return 0; |
171 CString url = window->document()->url().string().utf8(); | 171 CString url = window->document()->url().string().utf8(); |
172 m_strings.append(url); | 172 m_strings.append(url); |
173 return url.data(); | 173 return url.data(); |
174 } | 174 } |
175 | 175 |
176 private: | 176 private: |
177 Vector<CString> m_strings; | 177 Vector<CString> m_strings; |
178 }; | 178 }; |
(...skipping 122 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 WebCore | 310 } // namespace WebCore |
OLD | NEW |