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

Side by Side Diff: Source/core/dom/TouchList.h

Issue 23522051: Get rid of custom code for Document::createTouchList() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing references Created 7 years, 3 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
« Source/core/dom/Document.h ('K') | « Source/core/dom/Document.idl ('k') | no next file » | 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 2008, The Android Open Source Project 2 * Copyright 2008, The Android Open Source Project
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 * * Redistributions of source code must retain the above copyright 7 * * 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 * * Redistributions in binary form must reproduce the above copyright 9 * * 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 22 matching lines...) Expand all
33 33
34 namespace WebCore { 34 namespace WebCore {
35 35
36 class TouchList : public RefCounted<TouchList>, public ScriptWrappable { 36 class TouchList : public RefCounted<TouchList>, public ScriptWrappable {
37 public: 37 public:
38 static PassRefPtr<TouchList> create() 38 static PassRefPtr<TouchList> create()
39 { 39 {
40 return adoptRef(new TouchList); 40 return adoptRef(new TouchList);
41 } 41 }
42 42
43 static PassRefPtr<TouchList> create(Vector<RefPtr<Touch> >& touches)
44 {
45 return adoptRef(new TouchList(touches));
46 }
47
43 unsigned length() const { return m_values.size(); } 48 unsigned length() const { return m_values.size(); }
44 49
45 Touch* item(unsigned); 50 Touch* item(unsigned);
46 const Touch* item(unsigned) const; 51 const Touch* item(unsigned) const;
47 52
48 void append(const PassRefPtr<Touch> touch) { m_values.append(touch); } 53 void append(const PassRefPtr<Touch> touch) { m_values.append(touch); }
49 54
50 private: 55 private:
51 TouchList() 56 TouchList()
52 { 57 {
53 ScriptWrappable::init(this); 58 ScriptWrappable::init(this);
54 } 59 }
55 60
61 TouchList(Vector<RefPtr<Touch> >& touches)
62 {
63 m_values.swap(touches);
64 ScriptWrappable::init(this);
65 }
66
56 Vector<RefPtr<Touch> > m_values; 67 Vector<RefPtr<Touch> > m_values;
57 }; 68 };
58 69
59 } // namespace WebCore 70 } // namespace WebCore
60 71
61 #endif /* TouchList_h */ 72 #endif /* TouchList_h */
OLDNEW
« Source/core/dom/Document.h ('K') | « Source/core/dom/Document.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698