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

Unified Diff: webkit/browser/appcache/appcache_disk_cache.h

Issue 344493002: Move all remaining appcache-related code to content namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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
Index: webkit/browser/appcache/appcache_disk_cache.h
diff --git a/webkit/browser/appcache/appcache_disk_cache.h b/webkit/browser/appcache/appcache_disk_cache.h
deleted file mode 100644
index d9f27d0fb09fce178f9f49cb95a062cdeb0b7590..0000000000000000000000000000000000000000
--- a/webkit/browser/appcache/appcache_disk_cache.h
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_
-#define WEBKIT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_
-
-#include <set>
-#include <vector>
-
-#include "base/memory/scoped_ptr.h"
-#include "net/disk_cache/disk_cache.h"
-#include "webkit/browser/appcache/appcache_response.h"
-#include "webkit/browser/webkit_storage_browser_export.h"
-
-namespace appcache {
-
-// An implementation of AppCacheDiskCacheInterface that
-// uses net::DiskCache as the backing store.
-class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheDiskCache
- : public AppCacheDiskCacheInterface {
- public:
- AppCacheDiskCache();
- virtual ~AppCacheDiskCache();
-
- // Initializes the object to use disk backed storage.
- int InitWithDiskBackend(const base::FilePath& disk_cache_directory,
- int disk_cache_size, bool force,
- base::MessageLoopProxy* cache_thread,
- const net::CompletionCallback& callback);
-
- // Initializes the object to use memory only storage.
- // This is used for Chrome's incognito browsing.
- int InitWithMemBackend(int disk_cache_size,
- const net::CompletionCallback& callback);
-
- void Disable();
- bool is_disabled() const { return is_disabled_; }
-
- virtual int CreateEntry(int64 key, Entry** entry,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual int OpenEntry(int64 key, Entry** entry,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual int DoomEntry(int64 key,
- const net::CompletionCallback& callback) OVERRIDE;
-
- private:
- class CreateBackendCallbackShim;
- class EntryImpl;
-
- // PendingCalls allow CreateEntry, OpenEntry, and DoomEntry to be called
- // immediately after construction, without waiting for the
- // underlying disk_cache::Backend to be fully constructed. Early
- // calls are queued up and serviced once the disk_cache::Backend is
- // really ready to go.
- enum PendingCallType {
- CREATE,
- OPEN,
- DOOM
- };
- struct PendingCall {
- PendingCallType call_type;
- int64 key;
- Entry** entry;
- net::CompletionCallback callback;
-
- PendingCall();
-
- PendingCall(PendingCallType call_type, int64 key,
- Entry** entry, const net::CompletionCallback& callback);
-
- ~PendingCall();
- };
- typedef std::vector<PendingCall> PendingCalls;
-
- class ActiveCall;
- typedef std::set<ActiveCall*> ActiveCalls;
- typedef std::set<EntryImpl*> OpenEntries;
-
- bool is_initializing() const {
- return create_backend_callback_.get() != NULL;
- }
- disk_cache::Backend* disk_cache() { return disk_cache_.get(); }
- int Init(net::CacheType cache_type, const base::FilePath& directory,
- int cache_size, bool force, base::MessageLoopProxy* cache_thread,
- const net::CompletionCallback& callback);
- void OnCreateBackendComplete(int rv);
- void AddActiveCall(ActiveCall* call) { active_calls_.insert(call); }
- void RemoveActiveCall(ActiveCall* call) { active_calls_.erase(call); }
- void AddOpenEntry(EntryImpl* entry) { open_entries_.insert(entry); }
- void RemoveOpenEntry(EntryImpl* entry) { open_entries_.erase(entry); }
-
- bool is_disabled_;
- net::CompletionCallback init_callback_;
- scoped_refptr<CreateBackendCallbackShim> create_backend_callback_;
- PendingCalls pending_calls_;
- ActiveCalls active_calls_;
- OpenEntries open_entries_;
- scoped_ptr<disk_cache::Backend> disk_cache_;
-};
-
-} // namespace appcache
-
-#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_

Powered by Google App Engine
This is Rietveld 408576698