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

Unified Diff: chrome/common/scoped_co_mem.h

Issue 7265009: Revert 90464 - Move app/win/* files to base/win/, ui/base/win and chrome/common/ directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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
« no previous file with comments | « chrome/common/chrome_paths_win.cc ('k') | chrome/common/win_safe_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/scoped_co_mem.h
===================================================================
--- chrome/common/scoped_co_mem.h (revision 90470)
+++ chrome/common/scoped_co_mem.h (working copy)
@@ -1,49 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_COMMON_SCOPED_CO_MEM_H_
-#define CHROME_COMMON_SCOPED_CO_MEM_H_
-#pragma once
-
-#include <objbase.h>
-
-#include "base/basictypes.h"
-
-namespace chrome {
-namespace common {
-
-// Simple scoped memory releaser class for COM allocated memory.
-// Example:
-// base::win::ScopedCoMem<ITEMIDLIST> file_item;
-// SHGetSomeInfo(&file_item, ...);
-// ...
-// return; <-- memory released
-template<typename T>
-class ScopedCoMem {
- public:
- explicit ScopedCoMem() : mem_ptr_(NULL) {}
-
- ~ScopedCoMem() {
- if (mem_ptr_)
- CoTaskMemFree(mem_ptr_);
- }
-
- T** operator&() { // NOLINT
- return &mem_ptr_;
- }
-
- operator T*() {
- return mem_ptr_;
- }
-
- private:
- T* mem_ptr_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedCoMem);
-};
-
-} // namespace common
-} // namespace chrome
-
-#endif // CHROME_COMMON_SCOPED_CO_MEM_H_
« no previous file with comments | « chrome/common/chrome_paths_win.cc ('k') | chrome/common/win_safe_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698