| 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 "chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h" | 5 #include "chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/trace_event/trace_event.h" |
| 11 #include "chrome/browser/ui/webui/quota_internals/quota_internals_handler.h" | 12 #include "chrome/browser/ui/webui/quota_internals/quota_internals_handler.h" |
| 12 #include "chrome/browser/ui/webui/quota_internals/quota_internals_types.h" | 13 #include "chrome/browser/ui/webui/quota_internals/quota_internals_types.h" |
| 13 #include "net/base/net_util.h" | 14 #include "net/base/net_util.h" |
| 14 | 15 |
| 15 using content::BrowserThread; | 16 using content::BrowserThread; |
| 16 | 17 |
| 17 namespace quota_internals { | 18 namespace quota_internals { |
| 18 | 19 |
| 19 QuotaInternalsProxy::QuotaInternalsProxy(QuotaInternalsHandler* handler) | 20 QuotaInternalsProxy::QuotaInternalsProxy(QuotaInternalsHandler* handler) |
| 20 : handler_(handler), | 21 : handler_(handler), |
| 21 weak_factory_(this) { | 22 weak_factory_(this) { |
| 22 } | 23 } |
| 23 | 24 |
| 24 void QuotaInternalsProxy::RequestInfo( | 25 void QuotaInternalsProxy::RequestInfo( |
| 25 scoped_refptr<storage::QuotaManager> quota_manager) { | 26 scoped_refptr<storage::QuotaManager> quota_manager) { |
| 27 // crbug.com/349708 |
| 28 TRACE_EVENT0("io", "QuotaInternalsProxy::RequestInfo"); |
| 29 |
| 26 DCHECK(quota_manager.get()); | 30 DCHECK(quota_manager.get()); |
| 27 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 31 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
| 28 BrowserThread::PostTask( | 32 BrowserThread::PostTask( |
| 29 BrowserThread::IO, FROM_HERE, | 33 BrowserThread::IO, FROM_HERE, |
| 30 base::Bind(&QuotaInternalsProxy::RequestInfo, this, quota_manager)); | 34 base::Bind(&QuotaInternalsProxy::RequestInfo, this, quota_manager)); |
| 31 return; | 35 return; |
| 32 } | 36 } |
| 33 | 37 |
| 34 quota_manager_ = quota_manager; | 38 quota_manager_ = quota_manager; |
| 35 quota_manager_->GetAvailableSpace( | 39 quota_manager_->GetAvailableSpace( |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 DCHECK(quota_manager_.get()); | 225 DCHECK(quota_manager_.get()); |
| 222 quota_manager_->GetHostUsage(host, | 226 quota_manager_->GetHostUsage(host, |
| 223 type, | 227 type, |
| 224 base::Bind(&QuotaInternalsProxy::DidGetHostUsage, | 228 base::Bind(&QuotaInternalsProxy::DidGetHostUsage, |
| 225 weak_factory_.GetWeakPtr(), | 229 weak_factory_.GetWeakPtr(), |
| 226 host, | 230 host, |
| 227 type)); | 231 type)); |
| 228 } | 232 } |
| 229 | 233 |
| 230 } // namespace quota_internals | 234 } // namespace quota_internals |
| OLD | NEW |