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

Side by Side Diff: Source/wtf/TypedArrayBase.h

Issue 1180023002: Inline the only callers of TypedArrayBase::{setRange,zeroRange} (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * Copyright (c) 2010, Google Inc. All rights reserved. 3 * Copyright (c) 2010, Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 26 matching lines...) Expand all
37 public: 37 public:
38 typedef T ValueType; 38 typedef T ValueType;
39 39
40 T* data() const { return static_cast<T*>(baseAddress()); } 40 T* data() const { return static_cast<T*>(baseAddress()); }
41 41
42 bool set(TypedArrayBase<T>* array, unsigned offset) 42 bool set(TypedArrayBase<T>* array, unsigned offset)
43 { 43 {
44 return setImpl(array, offset * sizeof(T)); 44 return setImpl(array, offset * sizeof(T));
45 } 45 }
46 46
47 bool setRange(const T* data, size_t dataLength, unsigned offset)
48 {
49 return setRangeImpl(reinterpret_cast<const char*>(data), dataLength * si zeof(T), offset * sizeof(T));
50 }
51
52 bool zeroRange(unsigned offset, size_t length)
53 {
54 return zeroRangeImpl(offset * sizeof(T), length * sizeof(T));
55 }
56
57 // Overridden from ArrayBufferView. This must be public because of 47 // Overridden from ArrayBufferView. This must be public because of
58 // rules about inheritance of members in template classes, and 48 // rules about inheritance of members in template classes, and
59 // because it is accessed via pointers to subclasses. 49 // because it is accessed via pointers to subclasses.
60 unsigned length() const 50 unsigned length() const
61 { 51 {
62 return m_length; 52 return m_length;
63 } 53 }
64 54
65 virtual unsigned byteLength() const override final 55 virtual unsigned byteLength() const override final
66 { 56 {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // We do not want to have to access this via a virtual function in subclasse s, 117 // We do not want to have to access this via a virtual function in subclasse s,
128 // which is why it is protected rather than private. 118 // which is why it is protected rather than private.
129 unsigned m_length; 119 unsigned m_length;
130 }; 120 };
131 121
132 } // namespace WTF 122 } // namespace WTF
133 123
134 using WTF::TypedArrayBase; 124 using WTF::TypedArrayBase;
135 125
136 #endif // TypedArrayBase_h 126 #endif // TypedArrayBase_h
OLDNEW
« Source/modules/webaudio/AudioBuffer.cpp ('K') | « Source/wtf/ArrayBufferView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698