diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-02 21:15:09 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-02 21:15:09 +0000 |
commit | dc24976fc87171d50b49f37bbaaa23ae53e51f4b (patch) | |
tree | 8d7c684afa0d65e22efc3384197ef5b50d867160 /chrome/browser/automation | |
parent | fc72bb18b111ff63e57135d97de6d59291f3b7b8 (diff) | |
download | chromium_src-dc24976fc87171d50b49f37bbaaa23ae53e51f4b.zip chromium_src-dc24976fc87171d50b49f37bbaaa23ae53e51f4b.tar.gz chromium_src-dc24976fc87171d50b49f37bbaaa23ae53e51f4b.tar.bz2 |
Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*"
Linux fixes, Part 2 of N
BUG=110610
TBR=darin
Review URL: https://chromiumcodereview.appspot.com/16295003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203625 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
5 files changed, 38 insertions, 34 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index de4e029..6f35f7f 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -211,7 +211,7 @@ bool AutomationProvider::InitializeChannel(const std::string& channel_id) { GetChannelMode(use_named_interface), this, BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); - channel_->AddFilter(automation_resource_message_filter_); + channel_->AddFilter(automation_resource_message_filter_.get()); #if defined(OS_CHROMEOS) if (use_initial_load_observers_) { diff --git a/chrome/browser/automation/automation_resource_message_filter.cc b/chrome/browser/automation/automation_resource_message_filter.cc index 7c5d15d..fafded1 100644 --- a/chrome/browser/automation/automation_resource_message_filter.cc +++ b/chrome/browser/automation/automation_resource_message_filter.cc @@ -263,7 +263,7 @@ void AutomationResourceMessageFilter::RegisterRenderViewInIOThread( // instances. If the filter instances are different it means that a new // automation channel (External host process) was created for this tab. if (automation_details_iter != filtered_render_views_.Get().end() && - automation_details_iter->second.filter == filter) { + automation_details_iter->second.filter.get() == filter) { DCHECK_GT(automation_details_iter->second.ref_count, 0); automation_details_iter->second.ref_count++; // The tab handle and the pending status may have changed:- @@ -321,7 +321,7 @@ void AutomationResourceMessageFilter::ResumePendingRenderViewInIOThread( DCHECK(automation_details_iter->second.is_pending_render_view); AutomationResourceMessageFilter* old_filter = - automation_details_iter->second.filter; + automation_details_iter->second.filter.get(); DCHECK(old_filter != NULL); filtered_render_views_.Get()[renderer_key] = @@ -394,7 +394,7 @@ void AutomationResourceMessageFilter::GetCookiesForUrl( filtered_render_views_.Get().find(renderer_key)); DCHECK(automation_details_iter != filtered_render_views_.Get().end()); - DCHECK(automation_details_iter->second.filter != NULL); + DCHECK(automation_details_iter->second.filter.get() != NULL); int completion_callback_id = GetNextCompletionCallbackId(); DCHECK(!ContainsKey(completion_callback_map_.Get(), completion_callback_id)); @@ -409,13 +409,14 @@ void AutomationResourceMessageFilter::GetCookiesForUrl( completion_callback_map_.Get()[completion_callback_id] = cookie_info; - DCHECK(automation_details_iter->second.filter != NULL); + DCHECK(automation_details_iter->second.filter.get() != NULL); - if (automation_details_iter->second.filter) { - automation_details_iter->second.filter->Send( - new AutomationMsg_GetCookiesFromHost( - automation_details_iter->second.tab_handle, url, - completion_callback_id)); + if (automation_details_iter->second.filter.get()) { + automation_details_iter->second.filter + ->Send(new AutomationMsg_GetCookiesFromHost( + automation_details_iter->second.tab_handle, + url, + completion_callback_id)); } } @@ -446,12 +447,12 @@ void AutomationResourceMessageFilter::SetCookiesForUrl( filtered_render_views_.Get().find(RendererId( render_process_id, render_view_id))); DCHECK(automation_details_iter != filtered_render_views_.Get().end()); - DCHECK(automation_details_iter->second.filter != NULL); + DCHECK(automation_details_iter->second.filter.get() != NULL); - if (automation_details_iter->second.filter) { - automation_details_iter->second.filter->Send( - new AutomationMsg_SetCookieAsync( - automation_details_iter->second.tab_handle, url, cookie_line)); + if (automation_details_iter->second.filter.get()) { + automation_details_iter->second.filter + ->Send(new AutomationMsg_SetCookieAsync( + automation_details_iter->second.tab_handle, url, cookie_line)); } } diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 93c6684..ed9815a 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -3674,7 +3674,7 @@ void TestingAutomationProvider::GetExtensionsInfo(DictionaryValue* args, ExtensionActionManager::Get(browser->profile()); for (ExtensionList::const_iterator it = all.begin(); it != all.end(); ++it) { - const Extension* extension = *it; + const Extension* extension = it->get(); std::string id = extension->id(); DictionaryValue* extension_value = new DictionaryValue; extension_value->SetString("id", id); diff --git a/chrome/browser/automation/url_request_automation_job.cc b/chrome/browser/automation/url_request_automation_job.cc index 8591261d..bf3ed52 100644 --- a/chrome/browser/automation/url_request_automation_job.cc +++ b/chrome/browser/automation/url_request_automation_job.cc @@ -108,9 +108,9 @@ URLRequestAutomationJob::URLRequestAutomationJob( upload_size_(0), weak_factory_(this) { DVLOG(1) << "URLRequestAutomationJob create. Count: " << ++instance_count_; - DCHECK(message_filter_ != NULL); + DCHECK(message_filter_.get() != NULL); - if (message_filter_) { + if (message_filter_.get()) { id_ = message_filter_->NewAutomationRequestId(); DCHECK_NE(id_, 0); } @@ -152,9 +152,12 @@ net::URLRequestJob* URLRequestAutomationJob::Factory( if (AutomationResourceMessageFilter::LookupRegisteredRenderView( child_id, route_id, &details)) { URLRequestAutomationJob* job = new URLRequestAutomationJob( - request, network_delegate, + request, + network_delegate, request->context()->http_user_agent_settings(), - details.tab_handle, info->GetRequestID(), details.filter, + details.tab_handle, + info->GetRequestID(), + details.filter.get(), details.is_pending_render_view); return job; } @@ -208,7 +211,7 @@ bool URLRequestAutomationJob::ReadRawData( pending_buf_ = buf; pending_buf_size_ = buf_size; - if (message_filter_) { + if (message_filter_.get()) { message_filter_->Send(new AutomationMsg_RequestRead(tab_, id_, buf_size)); SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 0)); } else { @@ -223,7 +226,7 @@ bool URLRequestAutomationJob::ReadRawData( bool URLRequestAutomationJob::GetMimeType(std::string* mime_type) const { if (!mime_type_.empty()) { *mime_type = mime_type_; - } else if (headers_) { + } else if (headers_.get()) { headers_->GetMimeType(mime_type); } @@ -231,13 +234,13 @@ bool URLRequestAutomationJob::GetMimeType(std::string* mime_type) const { } bool URLRequestAutomationJob::GetCharset(std::string* charset) { - if (headers_) + if (headers_.get()) return headers_->GetCharset(charset); return false; } void URLRequestAutomationJob::GetResponseInfo(net::HttpResponseInfo* info) { - if (headers_) + if (headers_.get()) info->headers = headers_; if (request_->url().SchemeIsSecure()) { // Make up a fake certificate for this response since we don't have @@ -257,7 +260,7 @@ void URLRequestAutomationJob::GetResponseInfo(net::HttpResponseInfo* info) { } int URLRequestAutomationJob::GetResponseCode() const { - if (headers_) + if (headers_.get()) return headers_->response_code(); static const int kDefaultResponseCode = 200; @@ -359,7 +362,7 @@ void URLRequestAutomationJob::OnDataAvailable( // Clear any IO pending status. SetStatus(net::URLRequestStatus()); - if (pending_buf_ && pending_buf_->data()) { + if (pending_buf_.get() && pending_buf_->data()) { DCHECK_GE(pending_buf_size_, bytes.size()); const int bytes_to_copy = std::min(bytes.size(), pending_buf_size_); memcpy(pending_buf_->data(), &bytes[0], bytes_to_copy); @@ -403,7 +406,7 @@ void URLRequestAutomationJob::OnRequestEnd( // 2. In response to a read request. if (!has_response_started()) { NotifyStartError(status); - } else if (pending_buf_) { + } else if (pending_buf_.get()) { pending_buf_ = NULL; pending_buf_size_ = 0; NotifyDone(status); @@ -426,7 +429,7 @@ void URLRequestAutomationJob::Cleanup() { id_ = 0; tab_ = 0; - DCHECK(!message_filter_); + DCHECK(!message_filter_.get()); DisconnectFromMessageFilter(); pending_buf_ = NULL; @@ -506,13 +509,13 @@ void URLRequestAutomationJob::StartAsync() { automation_request.resource_type = resource_type; automation_request.load_flags = request_->load_flags(); - DCHECK(message_filter_); - message_filter_->Send(new AutomationMsg_RequestStart( - tab_, id_, automation_request)); + DCHECK(message_filter_.get()); + message_filter_->Send( + new AutomationMsg_RequestStart(tab_, id_, automation_request)); } void URLRequestAutomationJob::DisconnectFromMessageFilter() { - if (message_filter_) { + if (message_filter_.get()) { message_filter_->UnRegisterRequest(this); message_filter_ = NULL; } @@ -533,7 +536,7 @@ void URLRequestAutomationJob::NotifyJobCompletionTask() { NotifyDone(request_status_); } // Reset any pending reads. - if (pending_buf_) { + if (pending_buf_.get()) { pending_buf_ = NULL; pending_buf_size_ = 0; NotifyReadComplete(0); diff --git a/chrome/browser/automation/url_request_automation_job.h b/chrome/browser/automation/url_request_automation_job.h index ee806b0..7a73144 100644 --- a/chrome/browser/automation/url_request_automation_job.h +++ b/chrome/browser/automation/url_request_automation_job.h @@ -71,7 +71,7 @@ class URLRequestAutomationJob : public net::URLRequestJob { } AutomationResourceMessageFilter* message_filter() const { - return message_filter_; + return message_filter_.get(); } // Resumes a job, which was waiting for the external host to connect to the |