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

Side by Side Diff: webkit/browser/quota/quota_manager.cc

Issue 147143005: QuotaManager: Don't fire callback if it's null (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698