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

Side by Side Diff: chrome/installer/util/callback_work_item.cc

Issue 10916018: Force COM machinery to notice that the path to the DelegateExecute verb handler has changed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/installer/util/callback_work_item.h"
6
7 #include "base/callback.h"
8 #include "base/logging.h"
9 #include "chrome/installer/util/work_item.h"
10
11 CallbackWorkItem::CallbackWorkItem(
12 base::Callback<bool(const CallbackWorkItem&)> callback)
13 : callback_(callback),
14 roll_state_(RS_UNDEFINED) {
15 }
16
17 CallbackWorkItem::~CallbackWorkItem() {
18 }
19
20 bool CallbackWorkItem::Do() {
21 DCHECK_EQ(roll_state_, RS_UNDEFINED);
22
23 roll_state_ = RS_FORWARD;
24 bool result = callback_.Run(*this);
25 roll_state_ = RS_UNDEFINED;
robertshield 2012/08/30 17:52:43 Should we leave roll_state_ set to RS_FORWARD, whi
grt (UTC plus 2) 2012/08/30 18:21:50 Discussed in person: doing so would make the DCHEC
26
27 return result;
28 }
29
30 void CallbackWorkItem::Rollback() {
31 DCHECK_EQ(roll_state_, RS_UNDEFINED);
32
33 roll_state_ = RS_BACKWARD;
34 ignore_result(callback_.Run(*this));
35 roll_state_ = RS_UNDEFINED;
36 }
37
38 bool CallbackWorkItem::IsRollback() const {
39 DCHECK_NE(roll_state_, RS_UNDEFINED);
40 return roll_state_ == RS_BACKWARD;
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698