summaryrefslogtreecommitdiffstats
path: root/webkit/blob
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-28 07:34:38 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-28 07:34:38 +0000
commit9becf77c1818999c7cd07c2ced5bbecf37b86638 (patch)
tree172220ede4b96fc4f53b76e313377da7ea958ee4 /webkit/blob
parent2916724dd318a75f8a4bcbb92e595130cb6e0196 (diff)
downloadchromium_src-9becf77c1818999c7cd07c2ced5bbecf37b86638.zip
chromium_src-9becf77c1818999c7cd07c2ced5bbecf37b86638.tar.gz
chromium_src-9becf77c1818999c7cd07c2ced5bbecf37b86638.tar.bz2
Change ShareableFileReference to take TaskRunner instead of MessageLoopProxy
BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/10825069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/blob')
-rw-r--r--webkit/blob/shareable_file_reference.cc18
-rw-r--r--webkit/blob/shareable_file_reference.h10
2 files changed, 15 insertions, 13 deletions
diff --git a/webkit/blob/shareable_file_reference.cc b/webkit/blob/shareable_file_reference.cc
index b871624..7f76956 100644
--- a/webkit/blob/shareable_file_reference.cc
+++ b/webkit/blob/shareable_file_reference.cc
@@ -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.
@@ -8,7 +8,7 @@
#include "base/file_util.h"
#include "base/file_util_proxy.h"
#include "base/lazy_instance.h"
-#include "base/message_loop_proxy.h"
+#include "base/task_runner.h"
namespace webkit_blob {
@@ -31,8 +31,8 @@ scoped_refptr<ShareableFileReference> ShareableFileReference::Get(
// static
scoped_refptr<ShareableFileReference> ShareableFileReference::GetOrCreate(
const FilePath& path, FinalReleasePolicy policy,
- base::MessageLoopProxy* file_thread) {
- DCHECK(file_thread);
+ base::TaskRunner* file_task_runner) {
+ DCHECK(file_task_runner);
typedef std::pair<ShareableFileMap::iterator, bool> InsertResult;
// Required for VS2010: http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair
@@ -44,7 +44,7 @@ scoped_refptr<ShareableFileReference> ShareableFileReference::GetOrCreate(
// Wasn't in the map, create a new reference and store the pointer.
scoped_refptr<ShareableFileReference> reference(
- new ShareableFileReference(path, policy, file_thread));
+ new ShareableFileReference(path, policy, file_task_runner));
result.first->second = reference.get();
return reference;
}
@@ -56,8 +56,10 @@ void ShareableFileReference::AddFinalReleaseCallback(
ShareableFileReference::ShareableFileReference(
const FilePath& path, FinalReleasePolicy policy,
- base::MessageLoopProxy* file_thread)
- : path_(path), final_release_policy_(policy), file_thread_(file_thread) {
+ base::TaskRunner* file_task_runner)
+ : path_(path),
+ final_release_policy_(policy),
+ file_task_runner_(file_task_runner) {
DCHECK(g_file_map.Get().find(path_)->second == NULL);
}
@@ -69,7 +71,7 @@ ShareableFileReference::~ShareableFileReference() {
final_release_callbacks_[i].Run(path_);
if (final_release_policy_ == DELETE_ON_FINAL_RELEASE) {
- base::FileUtilProxy::Delete(file_thread_, path_, false /* recursive */,
+ base::FileUtilProxy::Delete(file_task_runner_, path_, false /* recursive */,
base::FileUtilProxy::StatusCallback());
}
}
diff --git a/webkit/blob/shareable_file_reference.h b/webkit/blob/shareable_file_reference.h
index c015ba3..5f1ff32 100644
--- a/webkit/blob/shareable_file_reference.h
+++ b/webkit/blob/shareable_file_reference.h
@@ -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.
@@ -13,7 +13,7 @@
#include "webkit/blob/blob_export.h"
namespace base {
-class MessageLoopProxy;
+class TaskRunner;
}
namespace webkit_blob {
@@ -42,7 +42,7 @@ class BLOB_EXPORT ShareableFileReference
static scoped_refptr<ShareableFileReference> GetOrCreate(
const FilePath& path,
FinalReleasePolicy policy,
- base::MessageLoopProxy* file_thread);
+ base::TaskRunner* file_task_runner);
// The full file path.
const FilePath& path() const { return path_; }
@@ -60,12 +60,12 @@ class BLOB_EXPORT ShareableFileReference
ShareableFileReference(
const FilePath& path,
FinalReleasePolicy policy,
- base::MessageLoopProxy* file_thread);
+ base::TaskRunner* file_task_runner);
~ShareableFileReference();
const FilePath path_;
const FinalReleasePolicy final_release_policy_;
- const scoped_refptr<base::MessageLoopProxy> file_thread_;
+ const scoped_refptr<base::TaskRunner> file_task_runner_;
std::vector<FinalReleaseCallback> final_release_callbacks_;
DISALLOW_COPY_AND_ASSIGN(ShareableFileReference);