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

Side by Side Diff: webkit/fileapi/local_file_system_operation.cc

Issue 15453002: Add thread checker to FileSystemOperationContext to allow setters called only on initialization thr… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | « webkit/fileapi/file_system_operation_context.cc ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/fileapi/local_file_system_operation.h" 5 #include "webkit/fileapi/local_file_system_operation.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 peer_handle_(base::kNullProcessHandle), 46 peer_handle_(base::kNullProcessHandle),
47 pending_operation_(kOperationNone), 47 pending_operation_(kOperationNone),
48 weak_factory_(this) { 48 weak_factory_(this) {
49 DCHECK(operation_context_.get()); 49 DCHECK(operation_context_.get());
50 operation_context_->DetachUserDataThread(); 50 operation_context_->DetachUserDataThread();
51 } 51 }
52 52
53 LocalFileSystemOperation::~LocalFileSystemOperation() { 53 LocalFileSystemOperation::~LocalFileSystemOperation() {
54 if (!operation_context()) 54 if (!operation_context())
55 return; 55 return;
56 operation_context()->DetachUserDataThread();
57 if (write_target_url_.is_valid()) { 56 if (write_target_url_.is_valid()) {
58 operation_context()->update_observers()->Notify( 57 operation_context()->update_observers()->Notify(
59 &FileUpdateObserver::OnEndUpdate, MakeTuple(write_target_url_)); 58 &FileUpdateObserver::OnEndUpdate, MakeTuple(write_target_url_));
60 } 59 }
61 } 60 }
62 61
63 void LocalFileSystemOperation::CreateFile(const FileSystemURL& url, 62 void LocalFileSystemOperation::CreateFile(const FileSystemURL& url,
64 bool exclusive, 63 bool exclusive,
65 const StatusCallback& callback) { 64 const StatusCallback& callback) {
66 DCHECK(SetPendingOperationType(kOperationCreateFile)); 65 DCHECK(SetPendingOperationType(kOperationCreateFile));
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 } 871 }
873 872
874 bool LocalFileSystemOperation::SetPendingOperationType(OperationType type) { 873 bool LocalFileSystemOperation::SetPendingOperationType(OperationType type) {
875 if (pending_operation_ != kOperationNone) 874 if (pending_operation_ != kOperationNone)
876 return false; 875 return false;
877 pending_operation_ = type; 876 pending_operation_ = type;
878 return true; 877 return true;
879 } 878 }
880 879
881 } // namespace fileapi 880 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_operation_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698