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

Side by Side Diff: webkit/plugins/ppapi/quota_file_io.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 | « webkit/plugins/ppapi/plugin_module.cc ('k') | webkit/plugins/ppapi/quota_file_io_unittest.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 "webkit/plugins/ppapi/quota_file_io.h" 5 #include "webkit/plugins/ppapi/quota_file_io.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 #include "base/task.h" 9 #include "base/task.h"
10 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" 10 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 } 98 }
99 99
100 virtual void DidFail(PlatformFileError error) OVERRIDE { 100 virtual void DidFail(PlatformFileError error) OVERRIDE {
101 DidFinish(error, 0); 101 DidFinish(error, 0);
102 } 102 }
103 103
104 bool finished() const { return finished_; } 104 bool finished() const { return finished_; }
105 105
106 virtual void WillRunCallback() { 106 virtual void WillRunCallback() {
107 base::MessageLoopProxy::CreateForCurrentThread()->PostTask( 107 base::MessageLoopProxy::current()->PostTask(
108 FROM_HERE, runnable_factory_.NewRunnableMethod( 108 FROM_HERE, runnable_factory_.NewRunnableMethod(
109 &WriteOperation::RunCallback)); 109 &WriteOperation::RunCallback));
110 } 110 }
111 111
112 private: 112 private:
113 void DidFinish(PlatformFileError status, int bytes_written) { 113 void DidFinish(PlatformFileError status, int bytes_written) {
114 finished_ = true; 114 finished_ = true;
115 status_ = status; 115 status_ = status;
116 bytes_written_ = bytes_written; 116 bytes_written_ = bytes_written;
117 int64_t max_offset = 117 int64_t max_offset =
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 pending_callbacks_.pop_front(); 353 pending_callbacks_.pop_front();
354 DCHECK(pending_callbacks_.empty()); 354 DCHECK(pending_callbacks_.empty());
355 int64_t delta = (error != base::PLATFORM_FILE_OK) ? 0 : 355 int64_t delta = (error != base::PLATFORM_FILE_OK) ? 0 :
356 new_file_size - cached_file_size_; 356 new_file_size - cached_file_size_;
357 instance_->delegate()->DidUpdateFile(file_url_, delta); 357 instance_->delegate()->DidUpdateFile(file_url_, delta);
358 inflight_operations_ = 0; 358 inflight_operations_ = 0;
359 } 359 }
360 360
361 } // namespace ppapi 361 } // namespace ppapi
362 } // namespace webkit 362 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/plugin_module.cc ('k') | webkit/plugins/ppapi/quota_file_io_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698