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

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

Issue 2892703003: [IndexedDB] Fixed possible refcount race (Closed)
Patch Set: Created 3 years, 7 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_context_impl.h" 5 #include "content/browser/indexed_db/indexed_db_context_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 QueryDiskAndUpdateQuotaUsage(origin); 460 QueryDiskAndUpdateQuotaUsage(origin);
461 } 461 }
462 462
463 void IndexedDBContextImpl::DatabaseDeleted(const Origin& origin) { 463 void IndexedDBContextImpl::DatabaseDeleted(const Origin& origin) {
464 AddToOriginSet(origin); 464 AddToOriginSet(origin);
465 QueryDiskAndUpdateQuotaUsage(origin); 465 QueryDiskAndUpdateQuotaUsage(origin);
466 } 466 }
467 467
468 IndexedDBContextImpl::~IndexedDBContextImpl() { 468 IndexedDBContextImpl::~IndexedDBContextImpl() {
469 if (factory_.get()) { 469 if (factory_.get()) {
470 TaskRunner()->PostTask( 470 TaskRunner()->PostTask(FROM_HERE,
471 FROM_HERE, base::Bind(&IndexedDBFactory::ContextDestroyed, factory_)); 471 base::Bind(&IndexedDBFactory::ContextDestroyed,
472 factory_ = NULL; 472 base::Passed(&factory_)));
pwnall 2017/05/19 00:16:32 why not nullptr?
473 } 473 }
474 474
475 if (data_path_.empty()) 475 if (data_path_.empty())
476 return; 476 return;
477 477
478 if (force_keep_session_state_) 478 if (force_keep_session_state_)
479 return; 479 return;
480 480
481 bool has_session_only_databases = 481 bool has_session_only_databases =
482 special_storage_policy_.get() && 482 special_storage_policy_.get() &&
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 void IndexedDBContextImpl::ResetCaches() { 563 void IndexedDBContextImpl::ResetCaches() {
564 origin_set_.reset(); 564 origin_set_.reset();
565 origin_size_map_.clear(); 565 origin_size_map_.clear();
566 } 566 }
567 567
568 base::SequencedTaskRunner* IndexedDBContextImpl::TaskRunner() const { 568 base::SequencedTaskRunner* IndexedDBContextImpl::TaskRunner() const {
569 return task_runner_.get(); 569 return task_runner_.get();
570 } 570 }
571 571
572 } // namespace content 572 } // 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