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

Side by Side Diff: JavaScriptCore/runtime/JSByteArray.h

Issue 28077: WebKit side of merge from r41149 to r41181. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/WebKit/
Patch Set: Created 11 years, 10 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
« no previous file with comments | « JavaScriptCore/runtime/JSArray.h ('k') | JavaScriptCore/runtime/JSCell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2009 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 15 matching lines...) Expand all
26 #ifndef JSByteArray_h 26 #ifndef JSByteArray_h
27 #define JSByteArray_h 27 #define JSByteArray_h
28 28
29 #include "JSObject.h" 29 #include "JSObject.h"
30 30
31 #include <wtf/ByteArray.h> 31 #include <wtf/ByteArray.h>
32 32
33 namespace JSC { 33 namespace JSC {
34 34
35 class JSByteArray : public JSObject { 35 class JSByteArray : public JSObject {
36 friend class Interpreter; 36 friend class VPtrSet;
37 public: 37 public:
38 bool canAccessIndex(unsigned i) { return i < m_storage->length(); } 38 bool canAccessIndex(unsigned i) { return i < m_storage->length(); }
39 JSValuePtr getIndex(ExecState* exec, unsigned i) 39 JSValuePtr getIndex(ExecState* exec, unsigned i)
40 { 40 {
41 ASSERT(canAccessIndex(i)); 41 ASSERT(canAccessIndex(i));
42 return jsNumber(exec, m_storage->data()[i]); 42 return jsNumber(exec, m_storage->data()[i]);
43 } 43 }
44 44
45 void setIndex(unsigned i, int value) 45 void setIndex(unsigned i, int value)
46 { 46 {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 RefPtr<WTF::ByteArray> m_storage; 101 RefPtr<WTF::ByteArray> m_storage;
102 const ClassInfo* m_classInfo; 102 const ClassInfo* m_classInfo;
103 }; 103 };
104 104
105 JSByteArray* asByteArray(JSValuePtr value); 105 JSByteArray* asByteArray(JSValuePtr value);
106 inline JSByteArray* asByteArray(JSValuePtr value) 106 inline JSByteArray* asByteArray(JSValuePtr value)
107 { 107 {
108 return static_cast<JSByteArray*>(asCell(value)); 108 return static_cast<JSByteArray*>(asCell(value));
109 } 109 }
110 }
111 110
112 #endif 111 inline bool isJSByteArray(JSGlobalData* globalData, JSValuePtr v) { return v .isCell() && v.asCell()->vptr() == globalData->jsByteArrayVPtr; }
112
113 } // namespace JSC
114
115 #endif // JSByteArray_h
OLDNEW
« no previous file with comments | « JavaScriptCore/runtime/JSArray.h ('k') | JavaScriptCore/runtime/JSCell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698