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

Side by Side Diff: content/browser/indexed_db/indexed_db_dispatcher_host.cc

Issue 874983003: IndexedDB: Reject bad OnDestroyed messages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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) 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/browser/indexed_db/indexed_db_dispatcher_host.h" 5 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/guid.h" 10 #include "base/guid.h"
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 parent_->GetOrTerminateProcess(&map_, ipc_database_id); 607 parent_->GetOrTerminateProcess(&map_, ipc_database_id);
608 if (!connection || !connection->IsConnected()) 608 if (!connection || !connection->IsConnected())
609 return; 609 return;
610 connection->VersionChangeIgnored(); 610 connection->VersionChangeIgnored();
611 } 611 }
612 612
613 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDestroyed( 613 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDestroyed(
614 int32 ipc_object_id) { 614 int32 ipc_object_id) {
615 DCHECK( 615 DCHECK(
616 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); 616 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
617 IndexedDBConnection* connection = map_.Lookup(ipc_object_id); 617 IndexedDBConnection* connection =
618 parent_->GetOrTerminateProcess(&map_, ipc_object_id);
cmumford 2015/01/26 19:52:15 This still dies on non-official builds right? Will
jsbell 2015/01/26 19:57:22 Given that we do this for the other IPCs, but *thi
619 if (!connection)
620 return;
618 if (connection->IsConnected()) 621 if (connection->IsConnected())
619 connection->Close(); 622 connection->Close();
620 parent_->Context() 623 parent_->Context()
621 ->ConnectionClosed(database_url_map_[ipc_object_id], connection); 624 ->ConnectionClosed(database_url_map_[ipc_object_id], connection);
622 database_url_map_.erase(ipc_object_id); 625 database_url_map_.erase(ipc_object_id);
623 parent_->DestroyObject(&map_, ipc_object_id); 626 parent_->DestroyObject(&map_, ipc_object_id);
624 } 627 }
625 628
626 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnGet( 629 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnGet(
627 const IndexedDBHostMsg_DatabaseGet_Params& params) { 630 const IndexedDBHostMsg_DatabaseGet_Params& params) {
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 } 1025 }
1023 1026
1024 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( 1027 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed(
1025 int32 ipc_object_id) { 1028 int32 ipc_object_id) {
1026 DCHECK( 1029 DCHECK(
1027 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); 1030 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
1028 parent_->DestroyObject(&map_, ipc_object_id); 1031 parent_->DestroyObject(&map_, ipc_object_id);
1029 } 1032 }
1030 1033
1031 } // namespace content 1034 } // namespace content
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