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

Side by Side Diff: chrome/browser/metrics/thread_watcher.cc

Issue 7301009: Removed unnecessary call to initialize the COM library (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 | « chrome/browser/metrics/thread_watcher.h ('k') | 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 #include <math.h> // ceil 5 #include <math.h> // ceil
6 6
7 #include "base/string_tokenizer.h" 7 #include "base/string_tokenizer.h"
8 #include "base/threading/thread_restrictions.h" 8 #include "base/threading/thread_restrictions.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/metrics/metrics_service.h" 10 #include "chrome/browser/metrics/metrics_service.h"
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 } 642 }
643 delete task; 643 delete task;
644 644
645 return false; 645 return false;
646 } 646 }
647 647
648 void WatchDogThread::Init() { 648 void WatchDogThread::Init() {
649 // This thread shouldn't be allowed to perform any blocking disk I/O. 649 // This thread shouldn't be allowed to perform any blocking disk I/O.
650 base::ThreadRestrictions::SetIOAllowed(false); 650 base::ThreadRestrictions::SetIOAllowed(false);
651 651
652 #if defined(OS_WIN)
653 // Initializes the COM library on the current thread.
654 HRESULT result = CoInitialize(NULL);
655 CHECK(result == S_OK);
656 #endif
657
658 base::AutoLock lock(lock_); 652 base::AutoLock lock(lock_);
659 CHECK(!watchdog_thread_); 653 CHECK(!watchdog_thread_);
660 watchdog_thread_ = this; 654 watchdog_thread_ = this;
661 } 655 }
662 656
663 void WatchDogThread::CleanUp() { 657 void WatchDogThread::CleanUp() {
664 base::AutoLock lock(lock_); 658 base::AutoLock lock(lock_);
665 watchdog_thread_ = NULL; 659 watchdog_thread_ = NULL;
666 } 660 }
667
668 void WatchDogThread::CleanUpAfterMessageLoopDestruction() {
669 #if defined(OS_WIN)
670 // Closes the COM library on the current thread. CoInitialize must be balanced
671 // by a corresponding call to CoUninitialize.
672 CoUninitialize();
673 #endif
674 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/thread_watcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698