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

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

Issue 19230002: Use V8 implementation of TypedArrays and DataView in Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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
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 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
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"
35 #include "V8Node.h" 34 #include "V8Node.h"
36 #include "V8Window.h" 35 #include "V8Window.h"
37 #include "bindings/v8/RetainedDOMInfo.h" 36 #include "bindings/v8/RetainedDOMInfo.h"
38 #include "bindings/v8/ScriptObject.h" 37 #include "bindings/v8/ScriptObject.h"
39 #include "bindings/v8/V8Binding.h" 38 #include "bindings/v8/V8Binding.h"
40 #include "bindings/v8/V8DOMWrapper.h" 39 #include "bindings/v8/V8DOMWrapper.h"
41 #include "bindings/v8/WrapperTypeInfo.h" 40 #include "bindings/v8/WrapperTypeInfo.h"
41 #include "bindings/v8/custom/V8ArrayBufferViewCustom.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>
47 #include <v8.h> 47 #include <v8.h>
48 48
49 #include "wtf/ThreadSpecific.h" 49 #include "wtf/ThreadSpecific.h"
50 50
51 namespace WebCore { 51 namespace WebCore {
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } 314 }
315 315
316 virtual void VisitPersistentHandle(v8::Persistent<v8::Value>* value, uin t16_t classId) OVERRIDE 316 virtual void VisitPersistentHandle(v8::Persistent<v8::Value>* value, uin t16_t classId) OVERRIDE
317 { 317 {
318 if (classId != v8DOMObjectClassId) 318 if (classId != v8DOMObjectClassId)
319 return; 319 return;
320 // Casting to Handle is safe here, since the Persistent cannot get 320 // Casting to Handle is safe here, since the Persistent cannot get
321 // GCd during visiting. 321 // GCd during visiting.
322 ASSERT((*reinterpret_cast<v8::Handle<v8::Value>*>(value))->IsObject( )); 322 ASSERT((*reinterpret_cast<v8::Handle<v8::Value>*>(value))->IsObject( ));
323 v8::Handle<v8::Object>* wrapper = reinterpret_cast<v8::Handle<v8::Ob ject>*>(value); 323 v8::Handle<v8::Object>* wrapper = reinterpret_cast<v8::Handle<v8::Ob ject>*>(value);
324 if (!toWrapperTypeInfo(*wrapper)->isSubclass(&V8ArrayBufferView::inf o)) 324 if (!(*wrapper)->IsArrayBufferView())
325 return; 325 return;
326 m_visitor->visitJSExternalArray(V8ArrayBufferView::toNative(*wrapper )); 326 m_visitor->visitJSExternalArray(V8ArrayBufferView::toNative(*wrapper ));
327 } 327 }
328 328
329 private: 329 private:
330 ExternalArrayVisitor* m_visitor; 330 ExternalArrayVisitor* m_visitor;
331 } wrapperVisitor(visitor); 331 } wrapperVisitor(visitor);
332 332
333 v8::V8::VisitHandlesWithClassIds(&wrapperVisitor); 333 v8::V8::VisitHandlesWithClassIds(&wrapperVisitor);
334 } 334 }
(...skipping 13 matching lines...) Expand all
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698