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

Side by Side Diff: content/browser/in_process_webkit/indexed_db_callbacks.h

Issue 8400061: IndexedDB: Recycle cursor objects when calling continue(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More style nits fixed Created 9 years, 1 month 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 | « no previous file | content/browser/in_process_webkit/indexed_db_callbacks.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_
6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 dispatcher_host()->Send( 69 dispatcher_host()->Send(
70 new typename WebIDBToMsgHelper<WebObjectType>::MsgType(response_id(), 70 new typename WebIDBToMsgHelper<WebObjectType>::MsgType(response_id(),
71 object_id)); 71 object_id));
72 } 72 }
73 73
74 private: 74 private:
75 GURL origin_url_; 75 GURL origin_url_;
76 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); 76 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
77 }; 77 };
78 78
79 // WebIDBCursor uses onSuccess(WebIDBCursor*) to indicate it has data, and 79 // WebIDBCursor uses onSuccess(WebIDBCursor*) when a cursor has been opened,
80 // onSuccessWithContinuation() when a continue() call has succeeded, or
80 // onSuccess() without params to indicate it does not contain any data, i.e., 81 // onSuccess() without params to indicate it does not contain any data, i.e.,
81 // there is no key within the key range, or it has reached the end. 82 // there is no key within the key range, or it has reached the end.
82 template <> 83 template <>
83 class IndexedDBCallbacks<WebKit::WebIDBCursor> 84 class IndexedDBCallbacks<WebKit::WebIDBCursor>
84 : public IndexedDBCallbacksBase { 85 : public IndexedDBCallbacksBase {
85 public: 86 public:
86 IndexedDBCallbacks( 87 IndexedDBCallbacks(
87 IndexedDBDispatcherHost* dispatcher_host, int32 response_id) 88 IndexedDBDispatcherHost* dispatcher_host, int32 response_id,
88 : IndexedDBCallbacksBase(dispatcher_host, response_id) { } 89 int32 cursor_id)
90 : IndexedDBCallbacksBase(dispatcher_host, response_id),
91 cursor_id_(cursor_id) { }
89 92
90 virtual void onSuccess(WebKit::WebIDBCursor* idb_object); 93 virtual void onSuccess(WebKit::WebIDBCursor* idb_object);
91 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); 94 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value);
95 virtual void onSuccessWithContinuation();
92 96
93 private: 97 private:
98 // The id of the cursor this callback concerns, or -1 if the cursor
99 // does not exist yet.
100 int32 cursor_id_;
101
94 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); 102 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
95 }; 103 };
96 104
97 // WebIDBKey is implemented in WebKit as opposed to being an interface Chromium 105 // WebIDBKey is implemented in WebKit as opposed to being an interface Chromium
98 // implements. Thus we pass a const ___& version and thus we need this 106 // implements. Thus we pass a const ___& version and thus we need this
99 // specialization. 107 // specialization.
100 template <> 108 template <>
101 class IndexedDBCallbacks<WebKit::WebIDBKey> 109 class IndexedDBCallbacks<WebKit::WebIDBKey>
102 : public IndexedDBCallbacksBase { 110 : public IndexedDBCallbacksBase {
103 public: 111 public:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 IndexedDBDispatcherHost* dispatcher_host, int32 response_id) 147 IndexedDBDispatcherHost* dispatcher_host, int32 response_id)
140 : IndexedDBCallbacksBase(dispatcher_host, response_id) { } 148 : IndexedDBCallbacksBase(dispatcher_host, response_id) { }
141 149
142 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value); 150 virtual void onSuccess(const WebKit::WebSerializedScriptValue& value);
143 151
144 private: 152 private:
145 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks); 153 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
146 }; 154 };
147 155
148 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_ 156 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CALLBACKS_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/in_process_webkit/indexed_db_callbacks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698