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

Side by Side Diff: content/common/indexed_db/proxy_webidbdatabase_impl.cc

Issue 11227033: Move a bunch of code in content\common (as well as a few left in renderer) to the content namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros Created 8 years, 2 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/common/indexed_db/proxy_webidbdatabase_impl.h" 5 #include "content/common/indexed_db/proxy_webidbdatabase_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "content/common/child_thread.h" 9 #include "content/common/child_thread.h"
10 #include "content/common/indexed_db/indexed_db_messages.h" 10 #include "content/common/indexed_db/indexed_db_messages.h"
(...skipping 11 matching lines...) Expand all
22 using WebKit::WebFrame; 22 using WebKit::WebFrame;
23 using WebKit::WebIDBCallbacks; 23 using WebKit::WebIDBCallbacks;
24 using WebKit::WebIDBDatabaseCallbacks; 24 using WebKit::WebIDBDatabaseCallbacks;
25 using WebKit::WebIDBMetadata; 25 using WebKit::WebIDBMetadata;
26 using WebKit::WebIDBKeyPath; 26 using WebKit::WebIDBKeyPath;
27 using WebKit::WebIDBTransaction; 27 using WebKit::WebIDBTransaction;
28 using WebKit::WebString; 28 using WebKit::WebString;
29 using WebKit::WebVector; 29 using WebKit::WebVector;
30 using webkit_glue::WorkerTaskRunner; 30 using webkit_glue::WorkerTaskRunner;
31 31
32 namespace content {
33
32 RendererWebIDBDatabaseImpl::RendererWebIDBDatabaseImpl(int32 idb_database_id) 34 RendererWebIDBDatabaseImpl::RendererWebIDBDatabaseImpl(int32 idb_database_id)
33 : idb_database_id_(idb_database_id) { 35 : idb_database_id_(idb_database_id) {
34 } 36 }
35 37
36 RendererWebIDBDatabaseImpl::~RendererWebIDBDatabaseImpl() { 38 RendererWebIDBDatabaseImpl::~RendererWebIDBDatabaseImpl() {
37 // It's not possible for there to be pending callbacks that address this 39 // It's not possible for there to be pending callbacks that address this
38 // object since inside WebKit, they hold a reference to the object which owns 40 // object since inside WebKit, they hold a reference to the object which owns
39 // this object. But, if that ever changed, then we'd need to invalidate 41 // this object. But, if that ever changed, then we'd need to invalidate
40 // any such pointers. 42 // any such pointers.
41 IndexedDBDispatcher::Send(new IndexedDBHostMsg_DatabaseDestroyed( 43 IndexedDBDispatcher::Send(new IndexedDBHostMsg_DatabaseDestroyed(
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 WebKit::WebIDBObjectStore* RendererWebIDBDatabaseImpl::createObjectStore( 92 WebKit::WebIDBObjectStore* RendererWebIDBDatabaseImpl::createObjectStore(
91 long long id, 93 long long id,
92 const WebKit::WebString& name, 94 const WebKit::WebString& name,
93 const WebKit::WebIDBKeyPath& key_path, 95 const WebKit::WebIDBKeyPath& key_path,
94 bool auto_increment, 96 bool auto_increment,
95 const WebKit::WebIDBTransaction& transaction, 97 const WebKit::WebIDBTransaction& transaction,
96 WebExceptionCode& ec) { 98 WebExceptionCode& ec) {
97 IndexedDBHostMsg_DatabaseCreateObjectStore_Params params; 99 IndexedDBHostMsg_DatabaseCreateObjectStore_Params params;
98 params.id = id; 100 params.id = id;
99 params.name = name; 101 params.name = name;
100 params.key_path = content::IndexedDBKeyPath(key_path); 102 params.key_path = IndexedDBKeyPath(key_path);
101 params.auto_increment = auto_increment; 103 params.auto_increment = auto_increment;
102 params.transaction_id = IndexedDBDispatcher::TransactionId(transaction); 104 params.transaction_id = IndexedDBDispatcher::TransactionId(transaction);
103 params.idb_database_id = idb_database_id_; 105 params.idb_database_id = idb_database_id_;
104 106
105 int object_store; 107 int object_store;
106 IndexedDBDispatcher::Send( 108 IndexedDBDispatcher::Send(
107 new IndexedDBHostMsg_DatabaseCreateObjectStore( 109 new IndexedDBHostMsg_DatabaseCreateObjectStore(
108 params, &object_store, &ec)); 110 params, &object_store, &ec));
109 if (!object_store) 111 if (!object_store)
110 return NULL; 112 return NULL;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 if (!transaction_id) 149 if (!transaction_id)
148 return NULL; 150 return NULL;
149 return new RendererWebIDBTransactionImpl(transaction_id); 151 return new RendererWebIDBTransactionImpl(transaction_id);
150 } 152 }
151 153
152 void RendererWebIDBDatabaseImpl::close() { 154 void RendererWebIDBDatabaseImpl::close() {
153 IndexedDBDispatcher* dispatcher = 155 IndexedDBDispatcher* dispatcher =
154 IndexedDBDispatcher::ThreadSpecificInstance(); 156 IndexedDBDispatcher::ThreadSpecificInstance();
155 dispatcher->RequestIDBDatabaseClose(idb_database_id_); 157 dispatcher->RequestIDBDatabaseClose(idb_database_id_);
156 } 158 }
159
160 } // namespace content
OLDNEW
« no previous file with comments | « content/common/indexed_db/proxy_webidbdatabase_impl.h ('k') | content/common/indexed_db/proxy_webidbfactory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698