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

Unified Diff: base/base_drag_source.cc

Issue 5009: Fix some issues found looking at the code.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 side-by-side diff with in-line comments
Download patch
Index: base/base_drag_source.cc
===================================================================
--- base/base_drag_source.cc (revision 2670)
+++ base/base_drag_source.cc (working copy)
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <atlbase.h>
-
#include "base/base_drag_source.h"
///////////////////////////////////////////////////////////////////////////////
@@ -50,15 +48,13 @@
}
ULONG BaseDragSource::AddRef() {
- return InterlockedIncrement(&ref_count_);
+ return ++ref_count_;
}
ULONG BaseDragSource::Release() {
- if (InterlockedDecrement(&ref_count_) == 0) {
- ULONG copied_refcnt = ref_count_;
+ if (--ref_count_ == 0) {
delete this;
- return copied_refcnt;
+ return 0U;
}
return ref_count_;
}
-
« no previous file with comments | « base/base_drag_source.h ('k') | base/base_drop_target.h » ('j') | base/base_drop_target.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698