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

Side by Side Diff: chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc

Issue 3031026: Use vector::push_back() to add object store names to the vector of names and avoid a crash (Closed)
Patch Set: Created 10 years, 5 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
« no previous file with comments | « no previous file | 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 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h" 5 #include "chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/chrome_thread.h" 8 #include "chrome/browser/chrome_thread.h"
9 #include "chrome/browser/in_process_webkit/indexed_db_callbacks.h" 9 #include "chrome/browser/in_process_webkit/indexed_db_callbacks.h"
10 #include "chrome/browser/renderer_host/browser_render_process_host.h" 10 #include "chrome/browser/renderer_host/browser_render_process_host.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( 299 WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess(
300 &map_, idb_database_id, reply_msg, 300 &map_, idb_database_id, reply_msg,
301 ViewHostMsg_IDBDatabaseObjectStores::ID); 301 ViewHostMsg_IDBDatabaseObjectStores::ID);
302 if (!idb_database) 302 if (!idb_database)
303 return; 303 return;
304 304
305 WebDOMStringList web_object_stores = idb_database->objectStores(); 305 WebDOMStringList web_object_stores = idb_database->objectStores();
306 std::vector<string16> object_stores; 306 std::vector<string16> object_stores;
307 object_stores.reserve(web_object_stores.length()); 307 object_stores.reserve(web_object_stores.length());
308 for (unsigned i = 0; i < web_object_stores.length(); ++i) 308 for (unsigned i = 0; i < web_object_stores.length(); ++i)
309 object_stores[i] = web_object_stores.item(i); 309 object_stores.push_back(web_object_stores.item(i));
310 ViewHostMsg_IDBDatabaseObjectStores::WriteReplyParams(reply_msg, 310 ViewHostMsg_IDBDatabaseObjectStores::WriteReplyParams(reply_msg,
311 object_stores); 311 object_stores);
312 parent_->Send(reply_msg); 312 parent_->Send(reply_msg);
313 } 313 }
314 314
315 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCreateObjectStore( 315 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCreateObjectStore(
316 const ViewHostMsg_IDBDatabaseCreateObjectStore_Params& params) { 316 const ViewHostMsg_IDBDatabaseCreateObjectStore_Params& params) {
317 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); 317 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
318 WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( 318 WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess(
319 &map_, params.idb_database_id_, NULL, 319 &map_, params.idb_database_id_, NULL,
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 return; 564 return;
565 idb_object_store->removeIndex( 565 idb_object_store->removeIndex(
566 name, new IndexedDBCallbacks<void>(parent_, response_id)); 566 name, new IndexedDBCallbacks<void>(parent_, response_id));
567 } 567 }
568 568
569 void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDestroyed( 569 void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDestroyed(
570 int32 object_id) { 570 int32 object_id) {
571 parent_->DestroyObject( 571 parent_->DestroyObject(
572 &map_, object_id, ViewHostMsg_IDBObjectStoreDestroyed::ID); 572 &map_, object_id, ViewHostMsg_IDBObjectStoreDestroyed::ID);
573 } 573 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698