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

Side by Side Diff: chrome/browser/google/google_update_win.cc

Issue 2792383003: Rename ScopedComPtr::Release() to ScopedComPtr::Reset() (Closed)
Patch Set: Fix New Callers Created 3 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
« no previous file with comments | « base/win/shortcut.cc ('k') | chrome/browser/importer/ie_importer_browsertest_win.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/google/google_update_win.h" 5 #include "chrome/browser/google/google_update_win.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlcom.h> 8 #include <atlcom.h>
9 #include <objbase.h> 9 #include <objbase.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 // Create an app bundle. 524 // Create an app bundle.
525 if (!app_bundle_) { 525 if (!app_bundle_) {
526 base::win::ScopedComPtr<IAppBundleWeb> app_bundle; 526 base::win::ScopedComPtr<IAppBundleWeb> app_bundle;
527 base::win::ScopedComPtr<IDispatch> dispatch; 527 base::win::ScopedComPtr<IDispatch> dispatch;
528 hresult = google_update_->createAppBundleWeb(dispatch.Receive()); 528 hresult = google_update_->createAppBundleWeb(dispatch.Receive());
529 if (FAILED(hresult)) 529 if (FAILED(hresult))
530 return hresult; 530 return hresult;
531 hresult = dispatch.QueryInterface(app_bundle.Receive()); 531 hresult = dispatch.QueryInterface(app_bundle.Receive());
532 if (FAILED(hresult)) 532 if (FAILED(hresult))
533 return hresult; 533 return hresult;
534 dispatch.Release(); 534 dispatch.Reset();
535 535
536 ConfigureProxyBlanket(app_bundle.get()); 536 ConfigureProxyBlanket(app_bundle.get());
537 537
538 if (!locale_.empty()) { 538 if (!locale_.empty()) {
539 // Ignore the result of this since, while setting the display language is 539 // Ignore the result of this since, while setting the display language is
540 // nice to have, a failure to do so does not affect the likelihood that 540 // nice to have, a failure to do so does not affect the likelihood that
541 // the update check and/or install will succeed. 541 // the update check and/or install will succeed.
542 app_bundle->put_displayLanguage( 542 app_bundle->put_displayLanguage(
543 base::win::ScopedBstr(base::UTF8ToUTF16(locale_).c_str())); 543 base::win::ScopedBstr(base::UTF8ToUTF16(locale_).c_str()));
544 } 544 }
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 task_runner_->PostDelayedTask( 811 task_runner_->PostDelayedTask(
812 FROM_HERE, base::Bind(&UpdateCheckDriver::PollGoogleUpdate, 812 FROM_HERE, base::Bind(&UpdateCheckDriver::PollGoogleUpdate,
813 base::Unretained(this)), 813 base::Unretained(this)),
814 base::TimeDelta::FromMilliseconds(kGoogleUpdatePollIntervalMs)); 814 base::TimeDelta::FromMilliseconds(kGoogleUpdatePollIntervalMs));
815 // Early return for this non-terminal state. 815 // Early return for this non-terminal state.
816 return; 816 return;
817 } 817 }
818 818
819 // Release the reference on the COM objects before bouncing back to the 819 // Release the reference on the COM objects before bouncing back to the
820 // caller's thread. 820 // caller's thread.
821 state.Release(); 821 state.Reset();
822 app_.Release(); 822 app_.Reset();
823 app_bundle_.Release(); 823 app_bundle_.Reset();
824 google_update_.Release(); 824 google_update_.Reset();
825 825
826 result_runner_->DeleteSoon(FROM_HERE, this); 826 result_runner_->DeleteSoon(FROM_HERE, this);
827 } 827 }
828 828
829 void UpdateCheckDriver::OnUpgradeError(GoogleUpdateErrorCode error_code, 829 void UpdateCheckDriver::OnUpgradeError(GoogleUpdateErrorCode error_code,
830 HRESULT hresult, 830 HRESULT hresult,
831 int installer_exit_code, 831 int installer_exit_code,
832 const base::string16& error_string) { 832 const base::string16& error_string) {
833 status_ = UPGRADE_ERROR; 833 status_ = UPGRADE_ERROR;
834 error_code_ = error_code; 834 error_code_ = error_code;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 const GoogleUpdate3ClassFactory& google_update_factory) { 883 const GoogleUpdate3ClassFactory& google_update_factory) {
884 if (g_google_update_factory) { 884 if (g_google_update_factory) {
885 delete g_google_update_factory; 885 delete g_google_update_factory;
886 g_google_update_factory = nullptr; 886 g_google_update_factory = nullptr;
887 } 887 }
888 if (!google_update_factory.is_null()) { 888 if (!google_update_factory.is_null()) {
889 g_google_update_factory = 889 g_google_update_factory =
890 new GoogleUpdate3ClassFactory(google_update_factory); 890 new GoogleUpdate3ClassFactory(google_update_factory);
891 } 891 }
892 } 892 }
OLDNEW
« no previous file with comments | « base/win/shortcut.cc ('k') | chrome/browser/importer/ie_importer_browsertest_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698