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

Unified Diff: storage/browser/quota/quota_manager.cc

Issue 1394563002: Add trace to the caller of QuotaManager::GetAvailableSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « storage/browser/fileapi/sandbox_file_stream_writer.cc ('k') | storage/browser/quota/quota_manager_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/quota/quota_manager.cc
diff --git a/storage/browser/quota/quota_manager.cc b/storage/browser/quota/quota_manager.cc
index 52f728086b7169b02f5b62831cf50f7108b6c619..cf94e82e65a648655a72749bcb99d0ce75d9e39d 100644
--- a/storage/browser/quota/quota_manager.cc
+++ b/storage/browser/quota/quota_manager.cc
@@ -19,6 +19,7 @@
#include "base/sys_info.h"
#include "base/task_runner_util.h"
#include "base/time/time.h"
+#include "base/trace_event/trace_event.h"
#include "net/base/net_util.h"
#include "storage/browser/quota/client_usage_tracker.h"
#include "storage/browser/quota/quota_manager_proxy.h"
@@ -188,6 +189,9 @@ bool UpdateModifiedTimeOnDBThread(const GURL& origin,
}
int64 CallSystemGetAmountOfFreeDiskSpace(const base::FilePath& profile_path) {
+ // crbug.com/349708
+ TRACE_EVENT0("io", "QuotaManager::GetUsageAndQuotaForEviction");
+
// Ensure the profile path exists.
if (!base::CreateDirectory(profile_path)) {
LOG(WARNING) << "Create directory failed for path" << profile_path.value();
@@ -410,6 +414,10 @@ class UsageAndQuotaCallbackDispatcher
}
void DidGetAvailableSpace(QuotaStatusCode status, int64 space) {
+ // crbug.com/349708
+ TRACE_EVENT0(
+ "io", "UsageAndQuotaCallbackDispatcher::DidGetAvailableSpace");
+
DCHECK_GE(space, 0);
if (status_ == kQuotaStatusUnknown || status_ == kQuotaStatusOk)
status_ = status;
@@ -960,6 +968,8 @@ void QuotaManager::DeleteHostData(const std::string& host,
void QuotaManager::GetAvailableSpace(const AvailableSpaceCallback& callback) {
if (!available_space_callbacks_.Add(callback))
return;
+ // crbug.com/349708
+ TRACE_EVENT0("io", "QuotaManager::GetAvailableSpace");
PostTaskAndReplyWithResult(db_thread_.get(),
FROM_HERE,
@@ -1462,6 +1472,9 @@ void QuotaManager::EvictOriginData(const GURL& origin,
void QuotaManager::GetUsageAndQuotaForEviction(
const UsageAndQuotaCallback& callback) {
+ // crbug.com/349708
+ TRACE_EVENT0("io", "QuotaManager::GetUsageAndQuotaForEviction");
michaeln 2015/10/09 19:00:05 fyi: i think many of the quota systems async apis
oshima 2015/10/09 21:07:00 We can tell it from the stack in the trace. I did
+
DCHECK(io_thread_->BelongsToCurrentThread());
LazyInitialize();
@@ -1602,6 +1615,9 @@ void QuotaManager::DidInitializeTemporaryOriginsInfo(bool success) {
}
void QuotaManager::DidGetAvailableSpace(int64 space) {
+ // crbug.com/349708
+ TRACE_EVENT0("io", "QuotaManager::DidGetAvailableSpace");
+
available_space_callbacks_.Run(kQuotaStatusOk, space);
}
« no previous file with comments | « storage/browser/fileapi/sandbox_file_stream_writer.cc ('k') | storage/browser/quota/quota_manager_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698