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

Side by Side Diff: base/file_util_proxy.cc

Issue 7583053: Add MessageLoopProxy::current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need for MessageLoopProxy destruction observer. Created 9 years, 4 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 | « no previous file | base/files/file_path_watcher_browsertest.cc » ('j') | 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) 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 #include "base/file_util_proxy.h" 5 #include "base/file_util_proxy.h"
6 6
7 #include "base/message_loop_proxy.h" 7 #include "base/message_loop_proxy.h"
8 8
9 // TODO(jianli): Move the code from anonymous namespace to base namespace so 9 // TODO(jianli): Move the code from anonymous namespace to base namespace so
10 // that all of the base:: prefixes would be unnecessary. 10 // that all of the base:: prefixes would be unnecessary.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return base::PLATFORM_FILE_OK; 66 return base::PLATFORM_FILE_OK;
67 } 67 }
68 68
69 } // anonymous namespace 69 } // anonymous namespace
70 70
71 class MessageLoopRelay 71 class MessageLoopRelay
72 : public base::RefCountedThreadSafe<MessageLoopRelay> { 72 : public base::RefCountedThreadSafe<MessageLoopRelay> {
73 public: 73 public:
74 MessageLoopRelay() 74 MessageLoopRelay()
75 : origin_message_loop_proxy_( 75 : origin_message_loop_proxy_(
76 base::MessageLoopProxy::CreateForCurrentThread()), 76 base::MessageLoopProxy::current()),
77 error_code_(base::PLATFORM_FILE_OK) { 77 error_code_(base::PLATFORM_FILE_OK) {
78 } 78 }
79 79
80 bool Start(scoped_refptr<base::MessageLoopProxy> message_loop_proxy, 80 bool Start(scoped_refptr<base::MessageLoopProxy> message_loop_proxy,
81 const tracked_objects::Location& from_here) { 81 const tracked_objects::Location& from_here) {
82 return message_loop_proxy->PostTask( 82 return message_loop_proxy->PostTask(
83 from_here, 83 from_here,
84 NewRunnableMethod(this, &MessageLoopRelay::ProcessOnTargetThread)); 84 NewRunnableMethod(this, &MessageLoopRelay::ProcessOnTargetThread));
85 } 85 }
86 86
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 916
917 // static 917 // static
918 bool FileUtilProxy::Flush( 918 bool FileUtilProxy::Flush(
919 scoped_refptr<MessageLoopProxy> message_loop_proxy, 919 scoped_refptr<MessageLoopProxy> message_loop_proxy,
920 PlatformFile file, 920 PlatformFile file,
921 StatusCallback* callback) { 921 StatusCallback* callback) {
922 return Start(FROM_HERE, message_loop_proxy, new RelayFlush(file, callback)); 922 return Start(FROM_HERE, message_loop_proxy, new RelayFlush(file, callback));
923 } 923 }
924 924
925 } // namespace base 925 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/files/file_path_watcher_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698