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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 private: | 160 private: |
161 ScriptProfiler::HeapSnapshotProgress* m_progress; | 161 ScriptProfiler::HeapSnapshotProgress* m_progress; |
162 bool m_firstReport; | 162 bool m_firstReport; |
163 }; | 163 }; |
164 | 164 |
165 class GlobalObjectNameResolver final : public v8::HeapProfiler::ObjectNameResolv
er { | 165 class GlobalObjectNameResolver final : public v8::HeapProfiler::ObjectNameResolv
er { |
166 public: | 166 public: |
167 virtual const char* GetName(v8::Handle<v8::Object> object) override | 167 virtual const char* GetName(v8::Handle<v8::Object> object) override |
168 { | 168 { |
169 DOMWindow* window = toDOMWindow(object, v8::Isolate::GetCurrent()); | 169 DOMWindow* window = toDOMWindow(v8::Isolate::GetCurrent(), object); |
170 if (!window) | 170 if (!window) |
171 return 0; | 171 return 0; |
172 CString url = toLocalDOMWindow(window)->document()->url().string().utf8(
); | 172 CString url = toLocalDOMWindow(window)->document()->url().string().utf8(
); |
173 m_strings.append(url); | 173 m_strings.append(url); |
174 return url.data(); | 174 return url.data(); |
175 } | 175 } |
176 | 176 |
177 private: | 177 private: |
178 Vector<CString> m_strings; | 178 Vector<CString> m_strings; |
179 }; | 179 }; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 } | 310 } |
311 | 311 |
312 void ScriptProfiler::setIdle(bool isIdle) | 312 void ScriptProfiler::setIdle(bool isIdle) |
313 { | 313 { |
314 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 314 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
315 if (v8::CpuProfiler* profiler = isolate->GetCpuProfiler()) | 315 if (v8::CpuProfiler* profiler = isolate->GetCpuProfiler()) |
316 profiler->SetIdle(isIdle); | 316 profiler->SetIdle(isIdle); |
317 } | 317 } |
318 | 318 |
319 } // namespace blink | 319 } // namespace blink |
OLD | NEW |