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

Side by Side Diff: content/browser/dom_storage/dom_storage_context_impl.cc

Issue 506083002: Remove implicit conversions from scoped_refptr to T* in content/browser/dom_storage/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | content/browser/dom_storage/dom_storage_namespace.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) 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/dom_storage/dom_storage_context_impl.h" 5 #include "content/browser/dom_storage/dom_storage_context_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 DCHECK(it->second->num_aliases() == 0); 271 DCHECK(it->second->num_aliases() == 0);
272 DCHECK(alias_master->alias_master_namespace() == NULL); 272 DCHECK(alias_master->alias_master_namespace() == NULL);
273 if (should_persist_data) 273 if (should_persist_data)
274 alias_master->set_must_persist_at_shutdown(true); 274 alias_master->set_must_persist_at_shutdown(true);
275 if (it->second->DecrementMasterAliasCount()) 275 if (it->second->DecrementMasterAliasCount())
276 MaybeShutdownSessionNamespace(alias_master); 276 MaybeShutdownSessionNamespace(alias_master);
277 namespaces_.erase(namespace_id); 277 namespaces_.erase(namespace_id);
278 } else { 278 } else {
279 if (should_persist_data) 279 if (should_persist_data)
280 it->second->set_must_persist_at_shutdown(true); 280 it->second->set_must_persist_at_shutdown(true);
281 MaybeShutdownSessionNamespace(it->second); 281 MaybeShutdownSessionNamespace(it->second.get());
282 } 282 }
283 } 283 }
284 284
285 void DOMStorageContextImpl::MaybeShutdownSessionNamespace( 285 void DOMStorageContextImpl::MaybeShutdownSessionNamespace(
286 DOMStorageNamespace* ns) { 286 DOMStorageNamespace* ns) {
287 if (ns->num_aliases() > 0 || !ns->ready_for_deletion_pending_aliases()) 287 if (ns->num_aliases() > 0 || !ns->ready_for_deletion_pending_aliases())
288 return; 288 return;
289 DCHECK_EQ(ns->num_aliases(), 0); 289 DCHECK_EQ(ns->num_aliases(), 0);
290 DCHECK(ns->alias_master_namespace() == NULL); 290 DCHECK(ns->alias_master_namespace() == NULL);
291 std::string persistent_namespace_id = ns->persistent_namespace_id(); 291 std::string persistent_namespace_id = ns->persistent_namespace_id();
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 478
479 SessionStorageNamespace::MergeResult 479 SessionStorageNamespace::MergeResult
480 DOMStorageContextImpl::MergeSessionStorage( 480 DOMStorageContextImpl::MergeSessionStorage(
481 int64 namespace1_id, bool actually_merge, int process_id, 481 int64 namespace1_id, bool actually_merge, int process_id,
482 int64 namespace2_id) { 482 int64 namespace2_id) {
483 DCHECK_NE(kLocalStorageNamespaceId, namespace1_id); 483 DCHECK_NE(kLocalStorageNamespaceId, namespace1_id);
484 DCHECK_NE(kLocalStorageNamespaceId, namespace2_id); 484 DCHECK_NE(kLocalStorageNamespaceId, namespace2_id);
485 StorageNamespaceMap::const_iterator it = namespaces_.find(namespace1_id); 485 StorageNamespaceMap::const_iterator it = namespaces_.find(namespace1_id);
486 if (it == namespaces_.end()) 486 if (it == namespaces_.end())
487 return SessionStorageNamespace::MERGE_RESULT_NAMESPACE_NOT_FOUND; 487 return SessionStorageNamespace::MERGE_RESULT_NAMESPACE_NOT_FOUND;
488 DOMStorageNamespace* ns1 = it->second; 488 DOMStorageNamespace* ns1 = it->second.get();
489 it = namespaces_.find(namespace2_id); 489 it = namespaces_.find(namespace2_id);
490 if (it == namespaces_.end()) 490 if (it == namespaces_.end())
491 return SessionStorageNamespace::MERGE_RESULT_NAMESPACE_NOT_FOUND; 491 return SessionStorageNamespace::MERGE_RESULT_NAMESPACE_NOT_FOUND;
492 DOMStorageNamespace* ns2 = it->second; 492 DOMStorageNamespace* ns2 = it->second.get();
493 return ns1->Merge(actually_merge, process_id, ns2, this); 493 return ns1->Merge(actually_merge, process_id, ns2, this);
494 } 494 }
495 495
496 } // namespace content 496 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/dom_storage/dom_storage_namespace.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698