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

Side by Side Diff: chrome/browser/policy/logging_work_scheduler.cc

Issue 7298012: Consolidate data storage and notifications in the cloud policy subsystem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 5 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/browser/policy/logging_work_scheduler.h" 5 #include "chrome/browser/policy/logging_work_scheduler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "content/browser/browser_thread.h" 10 #include "content/browser/browser_thread.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 void LoggingWorkScheduler::PostDelayedWork( 137 void LoggingWorkScheduler::PostDelayedWork(
138 const base::Closure& callback, int64 delay) { 138 const base::Closure& callback, int64 delay) {
139 DCHECK(!callback_.get() || callback_->is_null()); 139 DCHECK(!callback_.get() || callback_->is_null());
140 callback_.reset(new base::Closure(callback)); 140 callback_.reset(new base::Closure(callback));
141 logger_->PostDelayedWork(callback_, delay); 141 logger_->PostDelayedWork(callback_, delay);
142 } 142 }
143 143
144 void LoggingWorkScheduler::CancelDelayedWork() { 144 void LoggingWorkScheduler::CancelDelayedWork() {
145 DCHECK(callback_.get()); 145 if (!callback_.get()) return;
146 callback_->Reset(); 146 callback_->Reset(); // Erase the callback to the delayed work.
147 callback_.reset(NULL); // Erase the pointer to the callback.
147 } 148 }
148 149
149 } // namespace policy 150 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/device_token_fetcher_unittest.cc ('k') | chrome/browser/policy/testing_cloud_policy_subsystem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698