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

Side by Side Diff: content/browser/in_process_webkit/indexed_db_context.h

Issue 8070001: Use base::Callback in Quota related code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_
6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/file_path.h" 14 #include "base/file_path.h"
15 #include "base/gtest_prod_util.h" 15 #include "base/gtest_prod_util.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "content/browser/browser_thread.h" 18 #include "content/browser/browser_thread.h"
19 #include "content/common/content_export.h" 19 #include "content/common/content_export.h"
20 #include "googleurl/src/gurl.h" 20 #include "googleurl/src/gurl.h"
21 #include "webkit/quota/quota_types.h"
21 22
22 class GURL; 23 class GURL;
23 class FilePath; 24 class FilePath;
24 class WebKitContext; 25 class WebKitContext;
25 26
26 namespace WebKit { 27 namespace WebKit {
27 class WebIDBFactory; 28 class WebIDBFactory;
28 } 29 }
29 30
30 namespace base { 31 namespace base {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 FRIEND_TEST(IndexedDBBrowserTest, ClearSessionOnlyDatabases); 88 FRIEND_TEST(IndexedDBBrowserTest, ClearSessionOnlyDatabases);
88 friend class IndexedDBQuotaClientTest; 89 friend class IndexedDBQuotaClientTest;
89 90
90 typedef std::map<GURL, int64> OriginToSizeMap; 91 typedef std::map<GURL, int64> OriginToSizeMap;
91 class IndexedDBGetUsageAndQuotaCallback; 92 class IndexedDBGetUsageAndQuotaCallback;
92 93
93 FilePath GetIndexedDBFilePath(const string16& origin_id) const; 94 FilePath GetIndexedDBFilePath(const string16& origin_id) const;
94 int64 ReadUsageFromDisk(const GURL& origin_url) const; 95 int64 ReadUsageFromDisk(const GURL& origin_url) const;
95 void EnsureDiskUsageCacheInitialized(const GURL& origin_url); 96 void EnsureDiskUsageCacheInitialized(const GURL& origin_url);
96 void QueryDiskAndUpdateQuotaUsage(const GURL& origin_url); 97 void QueryDiskAndUpdateQuotaUsage(const GURL& origin_url);
98 void GotUsageAndQuota(const GURL& origin_url, quota::QuotaStatusCode,
99 int64 usage, int64 quota);
97 void GotUpdatedQuota(const GURL& origin_url, int64 usage, int64 quota); 100 void GotUpdatedQuota(const GURL& origin_url, int64 usage, int64 quota);
98 void QueryAvailableQuota(const GURL& origin_url); 101 void QueryAvailableQuota(const GURL& origin_url);
99 102
100 std::set<GURL>* GetOriginSet(); 103 std::set<GURL>* GetOriginSet();
101 bool AddToOriginSet(const GURL& origin_url) { 104 bool AddToOriginSet(const GURL& origin_url) {
102 return GetOriginSet()->insert(origin_url).second; 105 return GetOriginSet()->insert(origin_url).second;
103 } 106 }
104 void RemoveFromOriginSet(const GURL& origin_url) { 107 void RemoveFromOriginSet(const GURL& origin_url) {
105 GetOriginSet()->erase(origin_url); 108 GetOriginSet()->erase(origin_url);
106 } 109 }
(...skipping 12 matching lines...) Expand all
119 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; 122 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_;
120 scoped_ptr<std::set<GURL> > origin_set_; 123 scoped_ptr<std::set<GURL> > origin_set_;
121 OriginToSizeMap origin_size_map_; 124 OriginToSizeMap origin_size_map_;
122 OriginToSizeMap space_available_map_; 125 OriginToSizeMap space_available_map_;
123 std::map<GURL, unsigned int> connection_count_; 126 std::map<GURL, unsigned int> connection_count_;
124 127
125 DISALLOW_COPY_AND_ASSIGN(IndexedDBContext); 128 DISALLOW_COPY_AND_ASSIGN(IndexedDBContext);
126 }; 129 };
127 130
128 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ 131 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/browser/in_process_webkit/indexed_db_browsertest.cc ('k') | content/browser/in_process_webkit/indexed_db_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698