diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-05 13:07:11 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-05 13:07:11 +0000 |
commit | f4605dc056f8a70758f67157ff1811e5d4d3cfa1 (patch) | |
tree | aa87fb43cae5174e52d88b26117986a3191bfbbd | |
parent | 3c37f473f91d0d07a6b6bd4d0692a130394c1270 (diff) | |
download | chromium_src-f4605dc056f8a70758f67157ff1811e5d4d3cfa1.zip chromium_src-f4605dc056f8a70758f67157ff1811e5d4d3cfa1.tar.gz chromium_src-f4605dc056f8a70758f67157ff1811e5d4d3cfa1.tar.bz2 |
Fix Win Aura use of WeakPtr<T>'s operator T* conversion
BUG=245942
TBR=darin@chromium.org
Review URL: https://codereview.chromium.org/16094016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204244 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/nacl_host/nacl_broker_service_win.cc | 4 | ||||
-rw-r--r-- | chrome_frame/ready_mode/internal/ready_prompt_content.cc | 12 | ||||
-rw-r--r-- | chrome_frame/ready_mode/ready_mode.cc | 2 | ||||
-rw-r--r-- | chrome_frame/test/ready_mode_unittest.cc | 6 | ||||
-rw-r--r-- | win8/test/open_with_dialog_controller.cc | 4 | ||||
-rw-r--r-- | win8/test/ui_automation_client.cc | 2 |
6 files changed, 15 insertions, 15 deletions
diff --git a/chrome/browser/nacl_host/nacl_broker_service_win.cc b/chrome/browser/nacl_host/nacl_broker_service_win.cc index b7ef3c8..b270012 100644 --- a/chrome/browser/nacl_host/nacl_broker_service_win.cc +++ b/chrome/browser/nacl_host/nacl_broker_service_win.cc @@ -50,7 +50,7 @@ void NaClBrokerService::OnLoaderLaunched(const std::string& channel_id, if (pending_launches_.end() == it) NOTREACHED(); - NaClProcessHost* client = it->second; + NaClProcessHost* client = it->second.get(); if (client) client->OnProcessLaunchedByBroker(handle); pending_launches_.erase(it); @@ -84,7 +84,7 @@ void NaClBrokerService::OnDebugExceptionHandlerLaunched(int32 pid, if (pending_debuggers_.end() == it) NOTREACHED(); - NaClProcessHost* client = it->second; + NaClProcessHost* client = it->second.get(); if (client) client->OnDebugExceptionHandlerLaunchedByBroker(success); pending_debuggers_.erase(it); diff --git a/chrome_frame/ready_mode/internal/ready_prompt_content.cc b/chrome_frame/ready_mode/internal/ready_prompt_content.cc index 52ab70f..bacbd81 100644 --- a/chrome_frame/ready_mode/internal/ready_prompt_content.cc +++ b/chrome_frame/ready_mode/internal/ready_prompt_content.cc @@ -16,7 +16,7 @@ ReadyPromptContent::ReadyPromptContent(ReadyModeState* ready_mode_state, } ReadyPromptContent::~ReadyPromptContent() { - if (window_ != NULL && window_->IsWindow()) { + if (window_.get() != NULL && window_->IsWindow()) { // The window must discard its ContentFrame pointer at this time. window_->DestroyWindow(); window_.reset(); @@ -24,7 +24,7 @@ ReadyPromptContent::~ReadyPromptContent() { } bool ReadyPromptContent::InstallInFrame(Frame* frame) { - DCHECK(window_ == NULL); + DCHECK(window_.get() == NULL); DCHECK(ready_mode_state_ != NULL); DCHECK(url_launcher_ != NULL); @@ -32,11 +32,11 @@ bool ReadyPromptContent::InstallInFrame(Frame* frame) { window_ = ReadyPromptWindow::CreateInstance( frame, ready_mode_state_.release(), url_launcher_.release()); - return window_ != NULL; + return window_.get() != NULL; } void ReadyPromptContent::SetDimensions(const RECT& dimensions) { - if (window_ != NULL && window_->IsWindow()) { + if (window_.get() != NULL && window_->IsWindow()) { window_->SetWindowPos(HWND_TOP, &dimensions, ::IsRectEmpty(&dimensions) ? SWP_HIDEWINDOW : SWP_SHOWWINDOW); @@ -89,9 +89,9 @@ bool GetDialogTemplateDimensions(ReadyPromptWindow* window, RECT* dimensions) { } size_t ReadyPromptContent::GetDesiredSize(size_t width, size_t height) { - DCHECK(window_ != NULL && window_->IsWindow()); + DCHECK(window_.get() != NULL && window_->IsWindow()); - if (window_ == NULL || !window_->IsWindow()) { + if (window_.get() == NULL || !window_->IsWindow()) { return 0; } RECT dialog_dimensions = {0, 0, 0, 0}; diff --git a/chrome_frame/ready_mode/ready_mode.cc b/chrome_frame/ready_mode/ready_mode.cc index 1285329..2062811 100644 --- a/chrome_frame/ready_mode/ready_mode.cc +++ b/chrome_frame/ready_mode/ready_mode.cc @@ -127,7 +127,7 @@ StateObserver::~StateObserver() { } void StateObserver::OnStateChange(ReadyModeStatus status) { - if (ready_mode_ui_ == NULL) + if (ready_mode_ui_.get() == NULL) return; switch (status) { diff --git a/chrome_frame/test/ready_mode_unittest.cc b/chrome_frame/test/ready_mode_unittest.cc index 6a508a2..6cee2b9 100644 --- a/chrome_frame/test/ready_mode_unittest.cc +++ b/chrome_frame/test/ready_mode_unittest.cc @@ -138,7 +138,7 @@ class ReadyPromptWindowTest : public ReadyPromptTest { ready_prompt_window_ = ReadyPromptWindow::CreateInstance( &frame_, state_, url_launcher_); - ASSERT_TRUE(ready_prompt_window_ != NULL); + ASSERT_TRUE(ready_prompt_window_.get() != NULL); RECT position = {0, 0, 800, 39}; ASSERT_TRUE(ready_prompt_window_->SetWindowPos(HWND_TOP, &position, SWP_SHOWWINDOW)); @@ -153,9 +153,9 @@ class ReadyPromptWindowTest : public ReadyPromptTest { class ReadyPromptWindowButtonTest : public ReadyPromptWindowTest { public: void TearDown() { - ASSERT_TRUE(ready_prompt_window_ != NULL); + ASSERT_TRUE(ready_prompt_window_.get() != NULL); ASSERT_TRUE(ready_prompt_window_->DestroyWindow()); - ASSERT_TRUE(ready_prompt_window_ == NULL); + ASSERT_TRUE(ready_prompt_window_.get() == NULL); ASSERT_FALSE(message_loop_.WasTimedOut()); ReadyPromptWindowTest::TearDown(); diff --git a/win8/test/open_with_dialog_controller.cc b/win8/test/open_with_dialog_controller.cc index 1524a0d..27b8e2d 100644 --- a/win8/test/open_with_dialog_controller.cc +++ b/win8/test/open_with_dialog_controller.cc @@ -238,7 +238,7 @@ OpenWithDialogController::OpenWithDialogController() {} OpenWithDialogController::~OpenWithDialogController() { // Orphan the context if this instance is being destroyed before the context // finishes its work. - if (context_) + if (context_.get()) context_->Orphan(); } @@ -247,7 +247,7 @@ void OpenWithDialogController::Begin( const string16& url_protocol, const string16& program, const SetDefaultCallback& callback) { - DCHECK_EQ(context_, static_cast<Context*>(NULL)); + DCHECK_EQ(context_.get(), static_cast<Context*>(NULL)); if (base::win::GetVersion() < base::win::VERSION_WIN8) { NOTREACHED() << "Windows 8 is required."; // The callback may not properly handle being run from Begin, so post a task diff --git a/win8/test/ui_automation_client.cc b/win8/test/ui_automation_client.cc index ef742f2..4d9605f 100644 --- a/win8/test/ui_automation_client.cc +++ b/win8/test/ui_automation_client.cc @@ -606,7 +606,7 @@ void UIAutomationClient::Begin(const wchar_t* class_name, const InitializedCallback& init_callback, const ResultCallback& result_callback) { DCHECK(thread_checker_.CalledOnValidThread()); - DCHECK_EQ(context_, static_cast<Context*>(NULL)); + DCHECK_EQ(context_.get(), static_cast<Context*>(NULL)); // Start the automation thread and initialize our automation client on it. context_ = Context::Create(); |