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

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

Issue 2864523002: Rename ScopedComPtr::QueryInterface to ScopedComPtr::CopyTo (Closed)
Patch Set: Created 3 years, 7 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/scoped_comptr_unittest.cc ('k') | chrome/browser/win/jumplist_updater.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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 // The class was created, so all subsequent errors are reported as: 522 // The class was created, so all subsequent errors are reported as:
523 *error_code = GOOGLE_UPDATE_ONDEMAND_CLASS_REPORTED_ERROR; 523 *error_code = GOOGLE_UPDATE_ONDEMAND_CLASS_REPORTED_ERROR;
524 524
525 // Create an app bundle. 525 // Create an app bundle.
526 if (!app_bundle_) { 526 if (!app_bundle_) {
527 base::win::ScopedComPtr<IAppBundleWeb> app_bundle; 527 base::win::ScopedComPtr<IAppBundleWeb> app_bundle;
528 base::win::ScopedComPtr<IDispatch> dispatch; 528 base::win::ScopedComPtr<IDispatch> dispatch;
529 hresult = google_update_->createAppBundleWeb(dispatch.Receive()); 529 hresult = google_update_->createAppBundleWeb(dispatch.Receive());
530 if (FAILED(hresult)) 530 if (FAILED(hresult))
531 return hresult; 531 return hresult;
532 hresult = dispatch.QueryInterface(app_bundle.Receive()); 532 hresult = dispatch.CopyTo(app_bundle.Receive());
533 if (FAILED(hresult)) 533 if (FAILED(hresult))
534 return hresult; 534 return hresult;
535 dispatch.Reset(); 535 dispatch.Reset();
536 536
537 ConfigureProxyBlanket(app_bundle.Get()); 537 ConfigureProxyBlanket(app_bundle.Get());
538 538
539 if (!locale_.empty()) { 539 if (!locale_.empty()) {
540 // Ignore the result of this since, while setting the display language is 540 // Ignore the result of this since, while setting the display language is
541 // nice to have, a failure to do so does not affect the likelihood that 541 // nice to have, a failure to do so does not affect the likelihood that
542 // the update check and/or install will succeed. 542 // the update check and/or install will succeed.
(...skipping 26 matching lines...) Expand all
569 if (FAILED(hresult)) 569 if (FAILED(hresult))
570 return hresult; 570 return hresult;
571 // Move the IAppBundleWeb reference into a local now so that failures from 571 // Move the IAppBundleWeb reference into a local now so that failures from
572 // this point onward result in it being released. 572 // this point onward result in it being released.
573 base::win::ScopedComPtr<IAppBundleWeb> app_bundle; 573 base::win::ScopedComPtr<IAppBundleWeb> app_bundle;
574 app_bundle.swap(app_bundle_); 574 app_bundle.swap(app_bundle_);
575 hresult = app_bundle->get_appWeb(0, dispatch.Receive()); 575 hresult = app_bundle->get_appWeb(0, dispatch.Receive());
576 if (FAILED(hresult)) 576 if (FAILED(hresult))
577 return hresult; 577 return hresult;
578 base::win::ScopedComPtr<IAppWeb> app; 578 base::win::ScopedComPtr<IAppWeb> app;
579 hresult = dispatch.QueryInterface(app.Receive()); 579 hresult = dispatch.CopyTo(app.Receive());
580 if (FAILED(hresult)) 580 if (FAILED(hresult))
581 return hresult; 581 return hresult;
582 ConfigureProxyBlanket(app.Get()); 582 ConfigureProxyBlanket(app.Get());
583 hresult = app_bundle->checkForUpdate(); 583 hresult = app_bundle->checkForUpdate();
584 if (FAILED(hresult)) 584 if (FAILED(hresult))
585 return hresult; 585 return hresult;
586 app_bundle_.swap(app_bundle); 586 app_bundle_.swap(app_bundle);
587 app_.swap(app); 587 app_.swap(app);
588 } 588 }
589 589
590 return hresult; 590 return hresult;
591 } 591 }
592 592
593 bool UpdateCheckDriver::GetCurrentState( 593 bool UpdateCheckDriver::GetCurrentState(
594 base::win::ScopedComPtr<ICurrentState>* current_state, 594 base::win::ScopedComPtr<ICurrentState>* current_state,
595 CurrentState* state_value, 595 CurrentState* state_value,
596 HRESULT* hresult) const { 596 HRESULT* hresult) const {
597 base::win::ScopedComPtr<IDispatch> dispatch; 597 base::win::ScopedComPtr<IDispatch> dispatch;
598 *hresult = app_->get_currentState(dispatch.Receive()); 598 *hresult = app_->get_currentState(dispatch.Receive());
599 if (FAILED(*hresult)) 599 if (FAILED(*hresult))
600 return false; 600 return false;
601 *hresult = dispatch.QueryInterface(current_state->Receive()); 601 *hresult = dispatch.CopyTo(current_state->Receive());
602 if (FAILED(*hresult)) 602 if (FAILED(*hresult))
603 return false; 603 return false;
604 ConfigureProxyBlanket(current_state->Get()); 604 ConfigureProxyBlanket(current_state->Get());
605 LONG value = 0; 605 LONG value = 0;
606 *hresult = (*current_state)->get_stateValue(&value); 606 *hresult = (*current_state)->get_stateValue(&value);
607 if (FAILED(*hresult)) 607 if (FAILED(*hresult))
608 return false; 608 return false;
609 *state_value = static_cast<CurrentState>(value); 609 *state_value = static_cast<CurrentState>(value);
610 return true; 610 return true;
611 } 611 }
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 const GoogleUpdate3ClassFactory& google_update_factory) { 884 const GoogleUpdate3ClassFactory& google_update_factory) {
885 if (g_google_update_factory) { 885 if (g_google_update_factory) {
886 delete g_google_update_factory; 886 delete g_google_update_factory;
887 g_google_update_factory = nullptr; 887 g_google_update_factory = nullptr;
888 } 888 }
889 if (!google_update_factory.is_null()) { 889 if (!google_update_factory.is_null()) {
890 g_google_update_factory = 890 g_google_update_factory =
891 new GoogleUpdate3ClassFactory(google_update_factory); 891 new GoogleUpdate3ClassFactory(google_update_factory);
892 } 892 }
893 } 893 }
OLDNEW
« no previous file with comments | « base/win/scoped_comptr_unittest.cc ('k') | chrome/browser/win/jumplist_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698