| OLD | NEW |
| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 for (std::vector<GURL>::const_iterator iter = origins.begin(); | 174 for (std::vector<GURL>::const_iterator iter = origins.begin(); |
| 175 iter != origins.end(); | 175 iter != origins.end(); |
| 176 ++iter) { | 176 ++iter) { |
| 177 const GURL& origin_url = *iter; | 177 const GURL& origin_url = *iter; |
| 178 | 178 |
| 179 scoped_ptr<base::DictionaryValue> info(new base::DictionaryValue()); | 179 scoped_ptr<base::DictionaryValue> info(new base::DictionaryValue()); |
| 180 info->SetString("url", origin_url.spec()); | 180 info->SetString("url", origin_url.spec()); |
| 181 info->SetString("size", ui::FormatBytes(GetOriginDiskUsage(origin_url))); | 181 info->SetString("size", ui::FormatBytes(GetOriginDiskUsage(origin_url))); |
| 182 info->SetDouble("last_modified", | 182 info->SetDouble("last_modified", |
| 183 GetOriginLastModified(origin_url).ToJsTime()); | 183 GetOriginLastModified(origin_url).ToJsTime()); |
| 184 info->SetString("path", GetFilePath(origin_url).value()); | 184 if (!is_incognito()) |
| 185 info->SetString("path", GetFilePath(origin_url).value()); |
| 185 info->SetDouble("connection_count", GetConnectionCount(origin_url)); | 186 info->SetDouble("connection_count", GetConnectionCount(origin_url)); |
| 186 | 187 |
| 187 // This ends up being O(n^2) since we iterate over all open databases | 188 // This ends up being O(n^2) since we iterate over all open databases |
| 188 // to extract just those in the origin, and we're iterating over all | 189 // to extract just those in the origin, and we're iterating over all |
| 189 // origins in the outer loop. | 190 // origins in the outer loop. |
| 190 | 191 |
| 191 if (factory_) { | 192 if (factory_) { |
| 192 std::pair<IndexedDBFactory::OriginDBMapIterator, | 193 std::pair<IndexedDBFactory::OriginDBMapIterator, |
| 193 IndexedDBFactory::OriginDBMapIterator> range = | 194 IndexedDBFactory::OriginDBMapIterator> range = |
| 194 factory_->GetOpenDatabasesForOrigin(origin_url); | 195 factory_->GetOpenDatabasesForOrigin(origin_url); |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 origin_set_.reset(); | 570 origin_set_.reset(); |
| 570 origin_size_map_.clear(); | 571 origin_size_map_.clear(); |
| 571 space_available_map_.clear(); | 572 space_available_map_.clear(); |
| 572 } | 573 } |
| 573 | 574 |
| 574 base::TaskRunner* IndexedDBContextImpl::TaskRunner() const { | 575 base::TaskRunner* IndexedDBContextImpl::TaskRunner() const { |
| 575 return task_runner_; | 576 return task_runner_; |
| 576 } | 577 } |
| 577 | 578 |
| 578 } // namespace content | 579 } // namespace content |
| OLD | NEW |