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

Side by Side Diff: chrome/common/important_file_writer.cc

Issue 7825026: Revert "Currently, base/timer.cc calls PostTask with FROM_HERE as the Location, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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
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 "chrome/common/important_file_writer.h" 5 #include "chrome/common/important_file_writer.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 DCHECK(serializer); 139 DCHECK(serializer);
140 serializer_ = serializer; 140 serializer_ = serializer;
141 141
142 if (!MessageLoop::current()) { 142 if (!MessageLoop::current()) {
143 // Happens in unit tests. 143 // Happens in unit tests.
144 DoScheduledWrite(); 144 DoScheduledWrite();
145 return; 145 return;
146 } 146 }
147 147
148 if (!timer_.IsRunning()) { 148 if (!timer_.IsRunning()) {
149 timer_.Start(FROM_HERE, commit_interval_, this, 149 timer_.Start(commit_interval_, this,
150 &ImportantFileWriter::DoScheduledWrite); 150 &ImportantFileWriter::DoScheduledWrite);
151 } 151 }
152 } 152 }
153 153
154 void ImportantFileWriter::DoScheduledWrite() { 154 void ImportantFileWriter::DoScheduledWrite() {
155 DCHECK(serializer_); 155 DCHECK(serializer_);
156 std::string data; 156 std::string data;
157 if (serializer_->SerializeData(&data)) { 157 if (serializer_->SerializeData(&data)) {
158 WriteNow(data); 158 WriteNow(data);
159 } else { 159 } else {
160 LOG(WARNING) << "failed to serialize data to be saved in " 160 LOG(WARNING) << "failed to serialize data to be saved in "
161 << path_.value(); 161 << path_.value();
162 } 162 }
163 serializer_ = NULL; 163 serializer_ = NULL;
164 } 164 }
OLDNEW
« no previous file with comments | « chrome/browser/visitedlink/visitedlink_event_listener.cc ('k') | chrome/renderer/extensions/extension_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698