| 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "bindings/v8/ScriptProfiler.h" | 32 #include "bindings/v8/ScriptProfiler.h" |
| 33 | 33 |
| 34 #include "V8ArrayBufferView.h" | 34 #include "V8ArrayBufferView.h" |
| 35 #include "V8DOMWindow.h" |
| 35 #include "V8Node.h" | 36 #include "V8Node.h" |
| 36 #include "V8Window.h" | |
| 37 #include "bindings/v8/RetainedDOMInfo.h" | 37 #include "bindings/v8/RetainedDOMInfo.h" |
| 38 #include "bindings/v8/ScriptObject.h" | 38 #include "bindings/v8/ScriptObject.h" |
| 39 #include "bindings/v8/V8Binding.h" | 39 #include "bindings/v8/V8Binding.h" |
| 40 #include "bindings/v8/V8DOMWrapper.h" | 40 #include "bindings/v8/V8DOMWrapper.h" |
| 41 #include "bindings/v8/WrapperTypeInfo.h" | 41 #include "bindings/v8/WrapperTypeInfo.h" |
| 42 #include "core/dom/Document.h" | 42 #include "core/dom/Document.h" |
| 43 #include "core/dom/WebCoreMemoryInstrumentation.h" | 43 #include "core/dom/WebCoreMemoryInstrumentation.h" |
| 44 #include "core/inspector/BindingVisitors.h" | 44 #include "core/inspector/BindingVisitors.h" |
| 45 | 45 |
| 46 #include <v8-profiler.h> | 46 #include <v8-profiler.h> |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 160 } |
| 161 private: | 161 private: |
| 162 ScriptProfiler::HeapSnapshotProgress* m_progress; | 162 ScriptProfiler::HeapSnapshotProgress* m_progress; |
| 163 bool m_firstReport; | 163 bool m_firstReport; |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 class GlobalObjectNameResolver : public v8::HeapProfiler::ObjectNameResolver { | 166 class GlobalObjectNameResolver : public v8::HeapProfiler::ObjectNameResolver { |
| 167 public: | 167 public: |
| 168 virtual const char* GetName(v8::Handle<v8::Object> object) | 168 virtual const char* GetName(v8::Handle<v8::Object> object) |
| 169 { | 169 { |
| 170 if (V8DOMWrapper::isWrapperOfType(object, &V8Window::info)) { | 170 if (V8DOMWrapper::isWrapperOfType(object, &V8DOMWindow::info)) { |
| 171 DOMWindow* window = V8Window::toNative(object); | 171 DOMWindow* window = V8DOMWindow::toNative(object); |
| 172 if (window) { | 172 if (window) { |
| 173 CString url = window->document()->url().string().utf8(); | 173 CString url = window->document()->url().string().utf8(); |
| 174 m_strings.append(url); | 174 m_strings.append(url); |
| 175 return url.data(); | 175 return url.data(); |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 return 0; | 178 return 0; |
| 179 } | 179 } |
| 180 | 180 |
| 181 private: | 181 private: |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 return profiler->GetProfilerMemorySize(); | 348 return profiler->GetProfilerMemorySize(); |
| 349 } | 349 } |
| 350 | 350 |
| 351 ProfileNameIdleTimeMap* ScriptProfiler::currentProfileNameIdleTimeMap() | 351 ProfileNameIdleTimeMap* ScriptProfiler::currentProfileNameIdleTimeMap() |
| 352 { | 352 { |
| 353 AtomicallyInitializedStatic(WTF::ThreadSpecific<ProfileNameIdleTimeMap>*, ma
p = new WTF::ThreadSpecific<ProfileNameIdleTimeMap>); | 353 AtomicallyInitializedStatic(WTF::ThreadSpecific<ProfileNameIdleTimeMap>*, ma
p = new WTF::ThreadSpecific<ProfileNameIdleTimeMap>); |
| 354 return *map; | 354 return *map; |
| 355 } | 355 } |
| 356 | 356 |
| 357 } // namespace WebCore | 357 } // namespace WebCore |
| OLD | NEW |