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

Unified Diff: net/disk_cache/in_flight_backend_io.h

Issue 9702059: Disk cache: Remove all non essential synchronization from the cache destructor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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: net/disk_cache/in_flight_backend_io.h
===================================================================
--- net/disk_cache/in_flight_backend_io.h (revision 126788)
+++ net/disk_cache/in_flight_backend_io.h (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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.
@@ -34,6 +34,10 @@
// Callback implementation.
void OnIOComplete(int result);
+ // Called when we are finishing this operation. If |cancel| is true, the user
+ // callback will not be invoked.
+ void OnDone(bool cancel);
+
// Returns true if this operation is directed to an entry (vs. the backend).
bool IsEntryOperation();
@@ -42,9 +46,6 @@
// Grabs an extra reference of entry_.
void ReferenceEntry();
- // Returns the time that has passed since the operation was created.
- base::TimeDelta ElapsedTime() const;
-
// The operations we proxy:
void Init();
void OpenEntry(const std::string& key, Entry** entry);
@@ -109,6 +110,12 @@
virtual ~BackendIO();
+ // Returns true if this operation returns an entry.
+ bool ReturnsEntry();
+
+ // Returns the time that has passed since the operation was created.
+ base::TimeDelta ElapsedTime() const;
+
void ExecuteBackendOperation();
void ExecuteEntryOperation();
@@ -196,6 +203,8 @@
return background_thread_->BelongsToCurrentThread();
}
+ base::WeakPtr<InFlightBackendIO> GetWeakPtr();
+
protected:
virtual void OnOperationComplete(BackgroundIO* operation,
bool cancel) OVERRIDE;
@@ -205,6 +214,7 @@
BackendImpl* backend_;
scoped_refptr<base::MessageLoopProxy> background_thread_;
+ base::WeakPtrFactory<InFlightBackendIO> ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(InFlightBackendIO);
};

Powered by Google App Engine
This is Rietveld 408576698