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

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

Issue 1549113002: Switch to standard integer types in content/browser/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 12 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_namespace.h" 5 #include "content/browser/dom_storage/dom_storage_namespace.h"
6 6
7 #include "base/basictypes.h"
8 #include "base/bind.h" 7 #include "base/bind.h"
9 #include "base/location.h" 8 #include "base/location.h"
10 #include "base/logging.h" 9 #include "base/logging.h"
11 #include "content/browser/dom_storage/dom_storage_area.h" 10 #include "content/browser/dom_storage/dom_storage_area.h"
12 #include "content/browser/dom_storage/dom_storage_task_runner.h" 11 #include "content/browser/dom_storage/dom_storage_task_runner.h"
13 #include "content/browser/dom_storage/session_storage_database.h" 12 #include "content/browser/dom_storage/session_storage_database.h"
14 #include "content/common/dom_storage/dom_storage_types.h" 13 #include "content/common/dom_storage/dom_storage_types.h"
15 14
16 namespace content { 15 namespace content {
17 16
18 DOMStorageNamespace::DOMStorageNamespace( 17 DOMStorageNamespace::DOMStorageNamespace(
19 const base::FilePath& directory, 18 const base::FilePath& directory,
20 DOMStorageTaskRunner* task_runner) 19 DOMStorageTaskRunner* task_runner)
21 : namespace_id_(kLocalStorageNamespaceId), 20 : namespace_id_(kLocalStorageNamespaceId),
22 directory_(directory), 21 directory_(directory),
23 task_runner_(task_runner) { 22 task_runner_(task_runner) {
24 } 23 }
25 24
26 DOMStorageNamespace::DOMStorageNamespace( 25 DOMStorageNamespace::DOMStorageNamespace(
27 int64 namespace_id, 26 int64_t namespace_id,
28 const std::string& persistent_namespace_id, 27 const std::string& persistent_namespace_id,
29 SessionStorageDatabase* session_storage_database, 28 SessionStorageDatabase* session_storage_database,
30 DOMStorageTaskRunner* task_runner) 29 DOMStorageTaskRunner* task_runner)
31 : namespace_id_(namespace_id), 30 : namespace_id_(namespace_id),
32 persistent_namespace_id_(persistent_namespace_id), 31 persistent_namespace_id_(persistent_namespace_id),
33 task_runner_(task_runner), 32 task_runner_(task_runner),
34 session_storage_database_(session_storage_database) { 33 session_storage_database_(session_storage_database) {
35 DCHECK_NE(kLocalStorageNamespaceId, namespace_id); 34 DCHECK_NE(kLocalStorageNamespaceId, namespace_id);
36 } 35 }
37 36
(...skipping 27 matching lines...) Expand all
65 } 64 }
66 65
67 DOMStorageArea* DOMStorageNamespace::GetOpenStorageArea(const GURL& origin) { 66 DOMStorageArea* DOMStorageNamespace::GetOpenStorageArea(const GURL& origin) {
68 AreaHolder* holder = GetAreaHolder(origin); 67 AreaHolder* holder = GetAreaHolder(origin);
69 if (holder && holder->open_count_) 68 if (holder && holder->open_count_)
70 return holder->area_.get(); 69 return holder->area_.get();
71 return NULL; 70 return NULL;
72 } 71 }
73 72
74 DOMStorageNamespace* DOMStorageNamespace::Clone( 73 DOMStorageNamespace* DOMStorageNamespace::Clone(
75 int64 clone_namespace_id, 74 int64_t clone_namespace_id,
76 const std::string& clone_persistent_namespace_id) { 75 const std::string& clone_persistent_namespace_id) {
77 DCHECK_NE(kLocalStorageNamespaceId, namespace_id_); 76 DCHECK_NE(kLocalStorageNamespaceId, namespace_id_);
78 DCHECK_NE(kLocalStorageNamespaceId, clone_namespace_id); 77 DCHECK_NE(kLocalStorageNamespaceId, clone_namespace_id);
79 DOMStorageNamespace* clone = new DOMStorageNamespace( 78 DOMStorageNamespace* clone = new DOMStorageNamespace(
80 clone_namespace_id, clone_persistent_namespace_id, 79 clone_namespace_id, clone_persistent_namespace_id,
81 session_storage_database_.get(), task_runner_.get()); 80 session_storage_database_.get(), task_runner_.get());
82 AreaMap::const_iterator it = areas_.begin(); 81 AreaMap::const_iterator it = areas_.begin();
83 // Clone the in-memory structures. 82 // Clone the in-memory structures.
84 for (; it != areas_.end(); ++it) { 83 for (; it != areas_.end(); ++it) {
85 DOMStorageArea* area = it->second.area_->ShallowCopy( 84 DOMStorageArea* area = it->second.area_->ShallowCopy(
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 192
194 DOMStorageNamespace::AreaHolder::AreaHolder( 193 DOMStorageNamespace::AreaHolder::AreaHolder(
195 DOMStorageArea* area, int count) 194 DOMStorageArea* area, int count)
196 : area_(area), open_count_(count) { 195 : area_(area), open_count_(count) {
197 } 196 }
198 197
199 DOMStorageNamespace::AreaHolder::~AreaHolder() { 198 DOMStorageNamespace::AreaHolder::~AreaHolder() {
200 } 199 }
201 200
202 } // namespace content 201 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/dom_storage/dom_storage_namespace.h ('k') | content/browser/dom_storage/dom_storage_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698