Commit 037fdb50 authored by dcheng's avatar dcheng Committed by Commit bot

Remove implicit conversions from scoped_refptr to T* in chrome/

This patch was generated by running the rewrite_scoped_refptr clang tool
on a Mac build.

BUG=110610

Review URL: https://codereview.chromium.org/591493002

Cr-Commit-Position: refs/heads/master@{#295854}
parent 4d093328
......@@ -393,8 +393,8 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
// Check for active apps. If quitting is prevented, only close browsers and
// sessions.
if (!browser_shutdown::IsTryingToQuit() &&
quitWithAppsController_ && !quitWithAppsController_->ShouldQuit()) {
if (!browser_shutdown::IsTryingToQuit() && quitWithAppsController_.get() &&
!quitWithAppsController_->ShouldQuit()) {
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST,
content::NotificationService::AllSources(),
......
......@@ -26,7 +26,7 @@ void BrowserProcessPlatformPart::AttemptExit() {
void BrowserProcessPlatformPart::PreMainMessageLoopRun() {
// AppShimHostManager can not simply be reset, otherwise destroying the old
// domain socket will cause the just-created socket to be unlinked.
DCHECK(!app_shim_host_manager_);
DCHECK(!app_shim_host_manager_.get());
app_shim_host_manager_ = new AppShimHostManager;
}
......
......@@ -44,7 +44,7 @@ class ServiceDiscoveryClientMacTest : public CocoaTest {
public:
ServiceDiscoveryClientMacTest() : num_updates_(0), num_resolves_(0) {
client_mac_ = new ServiceDiscoveryClientMac();
client_ = client_mac_;
client_ = client_mac_.get();
}
void OnServiceUpdated(
......
......@@ -142,7 +142,7 @@ void PicasaDataProvider::OnTempDirChanged(const base::FilePath& temp_dir_path,
void PicasaDataProvider::DoRefreshIfNecessary() {
DCHECK(state_ != INVALID_DATA_STATE);
DCHECK(state_ != ALBUMS_IMAGES_FRESH_STATE);
DCHECK(!(album_table_reader_ && albums_indexer_));
DCHECK(!(album_table_reader_.get() && albums_indexer_.get()));
if (album_list_ready_callbacks_.empty() &&
albums_index_ready_callbacks_.empty()) {
......@@ -150,7 +150,7 @@ void PicasaDataProvider::DoRefreshIfNecessary() {
}
if (state_ == STALE_DATA_STATE) {
if (album_table_reader_)
if (album_table_reader_.get())
return;
album_table_reader_ =
new SafePicasaAlbumTableReader(AlbumTableFiles(database_path_));
......@@ -160,7 +160,7 @@ void PicasaDataProvider::DoRefreshIfNecessary() {
album_table_reader_));
} else {
DCHECK(state_ == LIST_OF_ALBUMS_AND_FOLDERS_FRESH_STATE);
if (albums_indexer_)
if (albums_indexer_.get())
return;
albums_indexer_ = new SafePicasaAlbumsIndexer(album_map_, folder_map_);
albums_indexer_->Start(base::Bind(&PicasaDataProvider::OnAlbumsIndexerDone,
......@@ -176,7 +176,7 @@ void PicasaDataProvider::OnAlbumTableReaderDone(
const std::vector<AlbumInfo>& folders) {
DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread());
// If the reader has already been deemed stale, ignore the result.
if (reader != album_table_reader_)
if (reader.get() != album_table_reader_.get())
return;
album_table_reader_ = NULL;
......@@ -209,7 +209,7 @@ void PicasaDataProvider::OnAlbumsIndexerDone(
const picasa::AlbumImagesMap& albums_images) {
DCHECK(MediaFileSystemBackend::CurrentlyOnMediaTaskRunnerThread());
// If the indexer has already been deemed stale, ignore the result.
if (indexer != albums_indexer_)
if (indexer.get() != albums_indexer_.get())
return;
albums_indexer_ = NULL;
......
......@@ -79,14 +79,14 @@ OriginChipDecoration::OriginChipDecoration(
// May not be set for unit tests.
scoped_refptr<SafeBrowsingService> sb_service =
g_browser_process->safe_browsing_service();
if (sb_service.get() && sb_service->ui_manager())
if (sb_service.get() && sb_service->ui_manager().get())
sb_service->ui_manager()->AddObserver(this);
}
OriginChipDecoration::~OriginChipDecoration() {
scoped_refptr<SafeBrowsingService> sb_service =
g_browser_process->safe_browsing_service();
if (sb_service.get() && sb_service->ui_manager())
if (sb_service.get() && sb_service->ui_manager().get())
sb_service->ui_manager()->RemoveObserver(this);
}
......
......@@ -51,7 +51,7 @@ IN_PROC_BROWSER_TEST_F(SSLClientCertificateSelectorCocoaTest, DISABLED_Basic) {
SSLClientCertificateSelectorCocoa* selector =
[[SSLClientCertificateSelectorCocoa alloc]
initWithNetworkSession:auth_requestor_->http_network_session_
certRequestInfo:auth_requestor_->cert_request_info_
certRequestInfo:auth_requestor_->cert_request_info_.get()
callback:base::Bind(&OnCertificateSelected,
&cert,
&count)];
......@@ -75,7 +75,7 @@ IN_PROC_BROWSER_TEST_F(SSLClientCertificateSelectorCocoaTest, HideShow) {
SSLClientCertificateSelectorCocoa* selector =
[[SSLClientCertificateSelectorCocoa alloc]
initWithNetworkSession:auth_requestor_->http_network_session_
certRequestInfo:auth_requestor_->cert_request_info_
certRequestInfo:auth_requestor_->cert_request_info_.get()
callback:chrome::SelectCertificateCallback()];
content::WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents();
......
......@@ -1376,7 +1376,7 @@ void PrintPreviewHandler::StartPrivetLister(const scoped_refptr<
Profile* profile = Profile::FromWebUI(web_ui());
DCHECK(!service_discovery_client_.get() ||
service_discovery_client_ == client);
service_discovery_client_.get() == client.get());
service_discovery_client_ = client;
printer_lister_.reset(new local_discovery::PrivetLocalPrinterLister(
service_discovery_client_.get(), profile->GetRequestContext(), this));
......
......@@ -31,7 +31,7 @@ void DiskUnmounterMac::Unmount(const std::string& device_path,
const base::Closure& success_continuation,
const base::Closure& failure_continuation) {
// Should only be used once.
DCHECK(!original_thread_);
DCHECK(!original_thread_.get());
original_thread_ = base::MessageLoopProxy::current();
success_continuation_ = success_continuation;
failure_continuation_ = failure_continuation;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment