| OLD | NEW |
| 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 "webkit/browser/quota/quota_manager.h" | 5 #include "webkit/browser/quota/quota_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <functional> | 9 #include <functional> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 int64 new_quota, const QuotaCallback& callback) { | 980 int64 new_quota, const QuotaCallback& callback) { |
| 981 LazyInitialize(); | 981 LazyInitialize(); |
| 982 | 982 |
| 983 if (new_quota < 0) { | 983 if (new_quota < 0) { |
| 984 if (!callback.is_null()) | 984 if (!callback.is_null()) |
| 985 callback.Run(kQuotaErrorInvalidModification, -1); | 985 callback.Run(kQuotaErrorInvalidModification, -1); |
| 986 return; | 986 return; |
| 987 } | 987 } |
| 988 | 988 |
| 989 if (db_disabled_) { | 989 if (db_disabled_) { |
| 990 if (callback.is_null()) | 990 if (!callback.is_null()) |
| 991 callback.Run(kQuotaErrorInvalidAccess, -1); | 991 callback.Run(kQuotaErrorInvalidAccess, -1); |
| 992 return; | 992 return; |
| 993 } | 993 } |
| 994 | 994 |
| 995 int64* new_quota_ptr = new int64(new_quota); | 995 int64* new_quota_ptr = new int64(new_quota); |
| 996 PostTaskAndReplyWithResultForDBThread( | 996 PostTaskAndReplyWithResultForDBThread( |
| 997 FROM_HERE, | 997 FROM_HERE, |
| 998 base::Bind(&SetTemporaryGlobalOverrideQuotaOnDBThread, | 998 base::Bind(&SetTemporaryGlobalOverrideQuotaOnDBThread, |
| 999 base::Unretained(new_quota_ptr)), | 999 base::Unretained(new_quota_ptr)), |
| 1000 base::Bind(&QuotaManager::DidSetTemporaryGlobalOverrideQuota, | 1000 base::Bind(&QuotaManager::DidSetTemporaryGlobalOverrideQuota, |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1579 // |database_|, therefore we can be sure that database_ is alive when this | 1579 // |database_|, therefore we can be sure that database_ is alive when this |
| 1580 // task runs. | 1580 // task runs. |
| 1581 base::PostTaskAndReplyWithResult( | 1581 base::PostTaskAndReplyWithResult( |
| 1582 db_thread_.get(), | 1582 db_thread_.get(), |
| 1583 from_here, | 1583 from_here, |
| 1584 base::Bind(task, base::Unretained(database_.get())), | 1584 base::Bind(task, base::Unretained(database_.get())), |
| 1585 reply); | 1585 reply); |
| 1586 } | 1586 } |
| 1587 | 1587 |
| 1588 } // namespace quota | 1588 } // namespace quota |
| OLD | NEW |