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

Side by Side Diff: base/win/scoped_com_initializer.h

Issue 10151010: win: Fix another small language violation found by clang. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef BASE_WIN_SCOPED_COM_INITIALIZER_H_ 5 #ifndef BASE_WIN_SCOPED_COM_INITIALIZER_H_
6 #define BASE_WIN_SCOPED_COM_INITIALIZER_H_ 6 #define BASE_WIN_SCOPED_COM_INITIALIZER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 16 matching lines...) Expand all
27 // Constructor for STA initialization. 27 // Constructor for STA initialization.
28 ScopedCOMInitializer() { 28 ScopedCOMInitializer() {
29 Initialize(COINIT_APARTMENTTHREADED); 29 Initialize(COINIT_APARTMENTTHREADED);
30 } 30 }
31 31
32 // Constructor for MTA initialization. 32 // Constructor for MTA initialization.
33 explicit ScopedCOMInitializer(SelectMTA mta) { 33 explicit ScopedCOMInitializer(SelectMTA mta) {
34 Initialize(COINIT_MULTITHREADED); 34 Initialize(COINIT_MULTITHREADED);
35 } 35 }
36 36
37 ScopedCOMInitializer::~ScopedCOMInitializer() { 37 ~ScopedCOMInitializer() {
38 #ifndef NDEBUG 38 #ifndef NDEBUG
39 // Using the windows API directly to avoid dependency on platform_thread. 39 // Using the windows API directly to avoid dependency on platform_thread.
40 DCHECK_EQ(GetCurrentThreadId(), thread_id_); 40 DCHECK_EQ(GetCurrentThreadId(), thread_id_);
41 #endif 41 #endif
42 if (SUCCEEDED(hr_)) 42 if (SUCCEEDED(hr_))
43 CoUninitialize(); 43 CoUninitialize();
44 } 44 }
45 45
46 bool succeeded() const { return SUCCEEDED(hr_); } 46 bool succeeded() const { return SUCCEEDED(hr_); }
47 47
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 private: 86 private:
87 DISALLOW_COPY_AND_ASSIGN(ScopedCOMInitializer); 87 DISALLOW_COPY_AND_ASSIGN(ScopedCOMInitializer);
88 }; 88 };
89 89
90 } // namespace win 90 } // namespace win
91 } // namespace base 91 } // namespace base
92 92
93 #endif 93 #endif
94 94
95 #endif // BASE_WIN_SCOPED_COM_INITIALIZER_H_ 95 #endif // BASE_WIN_SCOPED_COM_INITIALIZER_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698