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

Side by Side Diff: base/win/iunknown_impl.cc

Issue 1446363003: Deleted OS_WIN and all Windows specific files from base. (Closed) Base URL: https://github.com/domokit/mojo.git@base_tests
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « base/win/iunknown_impl.h ('k') | base/win/iunknown_impl_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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/win/iunknown_impl.h"
6
7 namespace base {
8 namespace win {
9
10 IUnknownImpl::IUnknownImpl()
11 : ref_count_(0) {
12 }
13
14 IUnknownImpl::~IUnknownImpl() {
15 }
16
17 ULONG STDMETHODCALLTYPE IUnknownImpl::AddRef() {
18 base::AtomicRefCountInc(&ref_count_);
19 return 1;
20 }
21
22 ULONG STDMETHODCALLTYPE IUnknownImpl::Release() {
23 if (!base::AtomicRefCountDec(&ref_count_)) {
24 delete this;
25 return 0;
26 }
27 return 1;
28 }
29
30 STDMETHODIMP IUnknownImpl::QueryInterface(REFIID riid, void** ppv) {
31 if (riid == IID_IUnknown) {
32 *ppv = static_cast<IUnknown*>(this);
33 AddRef();
34 return S_OK;
35 }
36
37 *ppv = NULL;
38 return E_NOINTERFACE;
39 }
40
41 } // namespace win
42 } // namespace base
OLDNEW
« no previous file with comments | « base/win/iunknown_impl.h ('k') | base/win/iunknown_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698