diff --git a/chromium_src/chrome/browser/browser_process.cc b/chromium_src/chrome/browser/browser_process.cc index 34e79812bf21..2c07333210ea 100644 --- a/chromium_src/chrome/browser/browser_process.cc +++ b/chromium_src/chrome/browser/browser_process.cc @@ -7,7 +7,7 @@ #include "chrome/browser/printing/print_job_manager.h" #include "ui/base/l10n/l10n_util.h" -BrowserProcess* g_browser_process = nullptr; +BrowserProcess* g_browser_process = NULL; BrowserProcess::BrowserProcess() { g_browser_process = this; @@ -16,7 +16,7 @@ BrowserProcess::BrowserProcess() { } BrowserProcess::~BrowserProcess() { - g_browser_process = nullptr; + g_browser_process = NULL; } std::string BrowserProcess::GetApplicationLocale() { diff --git a/chromium_src/chrome/browser/extensions/global_shortcut_listener.cc b/chromium_src/chrome/browser/extensions/global_shortcut_listener.cc index d6ba8c6c82e6..925cb40d0f96 100644 --- a/chromium_src/chrome/browser/extensions/global_shortcut_listener.cc +++ b/chromium_src/chrome/browser/extensions/global_shortcut_listener.cc @@ -53,7 +53,7 @@ void GlobalShortcutListener::UnregisterAccelerator( if (IsShortcutHandlingSuspended()) return; - auto it = accelerator_map_.find(accelerator); + AcceleratorMap::iterator it = accelerator_map_.find(accelerator); // We should never get asked to unregister something that we didn't register. DCHECK(it != accelerator_map_.end()); // The caller should call this function with the right observer. @@ -70,10 +70,10 @@ void GlobalShortcutListener::UnregisterAccelerators(Observer* observer) { if (IsShortcutHandlingSuspended()) return; - auto it = accelerator_map_.begin(); + AcceleratorMap::iterator it = accelerator_map_.begin(); while (it != accelerator_map_.end()) { if (it->second == observer) { - auto to_remove = it++; + AcceleratorMap::iterator to_remove = it++; UnregisterAccelerator(to_remove->first, observer); } else { ++it; @@ -87,16 +87,18 @@ void GlobalShortcutListener::SetShortcutHandlingSuspended(bool suspended) { return; shortcut_handling_suspended_ = suspended; - for (auto& it : accelerator_map_) { + for (AcceleratorMap::iterator it = accelerator_map_.begin(); + it != accelerator_map_.end(); + ++it) { // On Linux, when shortcut handling is suspended we cannot simply early // return in NotifyKeyPressed (similar to what we do for non-global // shortcuts) because we'd eat the keyboard event thereby preventing the // user from setting the shortcut. Therefore we must unregister while // handling is suspended and register when handling resumes. if (shortcut_handling_suspended_) - UnregisterAcceleratorImpl(it.first); + UnregisterAcceleratorImpl(it->first); else - RegisterAcceleratorImpl(it.first); + RegisterAcceleratorImpl(it->first); } } @@ -106,7 +108,7 @@ bool GlobalShortcutListener::IsShortcutHandlingSuspended() const { void GlobalShortcutListener::NotifyKeyPressed( const ui::Accelerator& accelerator) { - auto iter = accelerator_map_.find(accelerator); + AcceleratorMap::iterator iter = accelerator_map_.find(accelerator); if (iter == accelerator_map_.end()) { // This should never occur, because if it does, we have failed to unregister // or failed to clean up the map after unregistering the shortcut. diff --git a/chromium_src/chrome/browser/media/native_desktop_media_list.cc b/chromium_src/chrome/browser/media/native_desktop_media_list.cc index eec35303530e..a524dfcf38cb 100644 --- a/chromium_src/chrome/browser/media/native_desktop_media_list.cc +++ b/chromium_src/chrome/browser/media/native_desktop_media_list.cc @@ -152,12 +152,13 @@ void NativeDesktopMediaList::Worker::Refresh( if (window_capturer_) { webrtc::WindowCapturer::WindowList windows; if (window_capturer_->GetWindowList(&windows)) { - for (auto& window : windows) { + for (webrtc::WindowCapturer::WindowList::iterator it = windows.begin(); + it != windows.end(); ++it) { // Skip the picker dialog window. - if (window.id != view_dialog_id) { + if (it->id != view_dialog_id) { sources.push_back(SourceDescription( - DesktopMediaID(DesktopMediaID::TYPE_WINDOW, window.id), - base::UTF8ToUTF16(window.title))); + DesktopMediaID(DesktopMediaID::TYPE_WINDOW, it->id), + base::UTF8ToUTF16(it->title))); } } } @@ -198,7 +199,7 @@ void NativeDesktopMediaList::Worker::Refresh( new_image_hashes[source.id] = frame_hash; // Scale the image only if it has changed. - auto it = image_hashes_.find(source.id); + ImageHashesMap::iterator it = image_hashes_.find(source.id); if (it == image_hashes_.end() || it->second != frame_hash) { gfx::ImageSkia thumbnail = ScaleDesktopFrame(std::move(current_frame_), thumbnail_size); @@ -219,7 +220,7 @@ void NativeDesktopMediaList::Worker::Refresh( webrtc::SharedMemory* NativeDesktopMediaList::Worker::CreateSharedMemory( size_t size) { - return nullptr; + return NULL; } void NativeDesktopMediaList::Worker::OnCaptureCompleted( @@ -235,7 +236,7 @@ NativeDesktopMediaList::NativeDesktopMediaList( update_period_(base::TimeDelta::FromMilliseconds(kDefaultUpdatePeriod)), thumbnail_size_(100, 100), view_dialog_id_(-1), - observer_(nullptr), + observer_(NULL), weak_factory_(this) { base::SequencedWorkerPool* worker_pool = BrowserThread::GetBlockingPool(); capture_task_runner_ = worker_pool->GetSequencedTaskRunner( @@ -296,8 +297,8 @@ void NativeDesktopMediaList::OnSourcesList( const std::vector& new_sources) { typedef std::set SourceSet; SourceSet new_source_set; - for (const auto& new_source : new_sources) { - new_source_set.insert(new_source.id); + for (size_t i = 0; i < new_sources.size(); ++i) { + new_source_set.insert(new_sources[i].id); } // Iterate through the old sources to find the removed sources. for (size_t i = 0; i < sources_.size(); ++i) { @@ -310,8 +311,8 @@ void NativeDesktopMediaList::OnSourcesList( // Iterate through the new sources to find the added sources. if (new_sources.size() > sources_.size()) { SourceSet old_source_set; - for (auto& source : sources_) { - old_source_set.insert(source.id); + for (size_t i = 0; i < sources_.size(); ++i) { + old_source_set.insert(sources_[i].id); } for (size_t i = 0; i < new_sources.size(); ++i) { diff --git a/chromium_src/chrome/browser/printing/print_job.cc b/chromium_src/chrome/browser/printing/print_job.cc index abc1f3c652f8..87971055e68f 100644 --- a/chromium_src/chrome/browser/printing/print_job.cc +++ b/chromium_src/chrome/browser/printing/print_job.cc @@ -38,7 +38,7 @@ void HoldRefCallback(const scoped_refptr& owner, namespace printing { PrintJob::PrintJob() - : source_(nullptr), + : source_(NULL), worker_(), settings_(), is_job_pending_(false), @@ -71,8 +71,10 @@ void PrintJob::Initialize(PrintJobWorkerOwner* job, worker_.reset(job->DetachWorker(this)); settings_ = job->settings(); - auto* new_doc = - new PrintedDocument(settings_, source_, job->cookie(), + PrintedDocument* new_doc = + new PrintedDocument(settings_, + source_, + job->cookie(), content::BrowserThread::GetBlockingPool()); new_doc->set_page_count(page_count); UpdatePrintedDocument(new_doc); @@ -104,7 +106,7 @@ void PrintJob::GetSettingsDone(const PrintSettings& new_settings, PrintJobWorker* PrintJob::DetachWorker(PrintJobWorkerOwner* new_owner) { NOTREACHED(); - return nullptr; + return NULL; } const PrintSettings& PrintJob::settings() const { @@ -137,7 +139,7 @@ void PrintJob::StartPrinting() { // Tell everyone! scoped_refptr details( - new JobEventDetails(JobEventDetails::NEW_DOC, document_.get(), nullptr)); + new JobEventDetails(JobEventDetails::NEW_DOC, document_.get(), NULL)); content::NotificationService::current()->Notify( chrome::NOTIFICATION_PRINT_JOB_EVENT, content::Source(this), @@ -161,7 +163,7 @@ void PrintJob::Stop() { ControlledWorkerShutdown(); } else { // Flush the cached document. - UpdatePrintedDocument(nullptr); + UpdatePrintedDocument(NULL); } } @@ -181,7 +183,7 @@ void PrintJob::Cancel() { } // Make sure a Cancel() is broadcast. scoped_refptr details( - new JobEventDetails(JobEventDetails::FAILED, nullptr, nullptr)); + new JobEventDetails(JobEventDetails::FAILED, NULL, NULL)); content::NotificationService::current()->Notify( chrome::NOTIFICATION_PRINT_JOB_EVENT, content::Source(this), @@ -205,7 +207,7 @@ bool PrintJob::FlushJob(base::TimeDelta timeout) { } void PrintJob::DisconnectSource() { - source_ = nullptr; + source_ = NULL; if (document_.get()) document_->DisconnectSource(); } @@ -386,7 +388,7 @@ void PrintJob::OnDocumentDone() { Stop(); scoped_refptr details( - new JobEventDetails(JobEventDetails::JOB_DONE, document_.get(), nullptr)); + new JobEventDetails(JobEventDetails::JOB_DONE, document_.get(), NULL)); content::NotificationService::current()->Notify( chrome::NOTIFICATION_PRINT_JOB_EVENT, content::Source(this), @@ -432,7 +434,7 @@ void PrintJob::ControlledWorkerShutdown() { is_job_pending_ = false; registrar_.RemoveAll(); - UpdatePrintedDocument(nullptr); + UpdatePrintedDocument(NULL); } void PrintJob::HoldUntilStopIsCalled() { diff --git a/chromium_src/chrome/browser/printing/print_job_manager.cc b/chromium_src/chrome/browser/printing/print_job_manager.cc index 17ee260c620f..ec08a9892335 100644 --- a/chromium_src/chrome/browser/printing/print_job_manager.cc +++ b/chromium_src/chrome/browser/printing/print_job_manager.cc @@ -32,8 +32,8 @@ void PrintQueriesQueue::QueuePrinterQuery(PrinterQuery* job) { scoped_refptr PrintQueriesQueue::PopPrinterQuery( int document_cookie) { base::AutoLock lock(lock_); - for (auto itr = queued_queries_.begin(); itr != queued_queries_.end(); - ++itr) { + for (PrinterQueries::iterator itr = queued_queries_.begin(); + itr != queued_queries_.end(); ++itr) { if ((*itr)->cookie() == document_cookie && !(*itr)->is_callback_pending()) { scoped_refptr current_query(*itr); queued_queries_.erase(itr); @@ -41,7 +41,7 @@ scoped_refptr PrintQueriesQueue::PopPrinterQuery( return current_query; } } - return nullptr; + return NULL; } scoped_refptr PrintQueriesQueue::CreatePrinterQuery( @@ -61,8 +61,9 @@ void PrintQueriesQueue::Shutdown() { // Stop all pending queries, requests to generate print preview do not have // corresponding PrintJob, so any pending preview requests are not covered // by PrintJobManager::StopJobs and should be stopped explicitly. - for (auto& itr : queries_to_stop) { - itr->PostTask(FROM_HERE, base::Bind(&PrinterQuery::StopWorker, itr)); + for (PrinterQueries::iterator itr = queries_to_stop.begin(); + itr != queries_to_stop.end(); ++itr) { + (*itr)->PostTask(FROM_HERE, base::Bind(&PrinterQuery::StopWorker, *itr)); } } @@ -89,7 +90,7 @@ void PrintJobManager::Shutdown() { StopJobs(true); if (queue_.get()) queue_->Shutdown(); - queue_ = nullptr; + queue_ = NULL; } void PrintJobManager::StopJobs(bool wait_for_finish) { @@ -98,11 +99,12 @@ void PrintJobManager::StopJobs(bool wait_for_finish) { PrintJobs to_stop; to_stop.swap(current_jobs_); - for (const auto& job : to_stop) { + for (PrintJobs::const_iterator job = to_stop.begin(); job != to_stop.end(); + ++job) { // Wait for two minutes for the print job to be spooled. if (wait_for_finish) - job->FlushJob(base::TimeDelta::FromMinutes(2)); - job->Stop(); + (*job)->FlushJob(base::TimeDelta::FromMinutes(2)); + (*job)->Stop(); } } diff --git a/chromium_src/chrome/browser/printing/print_job_worker.cc b/chromium_src/chrome/browser/printing/print_job_worker.cc index 33a8b7d7352e..7a88a8570c42 100644 --- a/chromium_src/chrome/browser/printing/print_job_worker.cc +++ b/chromium_src/chrome/browser/printing/print_job_worker.cc @@ -38,10 +38,10 @@ void HoldRefCallback(const scoped_refptr& owner, class PrintingContextDelegate : public PrintingContext::Delegate { public: PrintingContextDelegate(int render_process_id, int render_view_id); - ~PrintingContextDelegate() override; + virtual ~PrintingContextDelegate(); - gfx::NativeView GetParentView() override; - std::string GetAppLocale() override; + virtual gfx::NativeView GetParentView() override; + virtual std::string GetAppLocale() override; private: int render_process_id_; @@ -62,9 +62,9 @@ gfx::NativeView PrintingContextDelegate::GetParentView() { content::RenderViewHost* view = content::RenderViewHost::FromID(render_process_id_, render_view_id_); if (!view) - return nullptr; + return NULL; content::WebContents* wc = content::WebContents::FromRenderViewHost(view); - return wc ? wc->GetNativeView() : nullptr; + return wc ? wc->GetNativeView() : NULL; } std::string PrintingContextDelegate::GetAppLocale() { @@ -75,7 +75,7 @@ void NotificationCallback(PrintJobWorkerOwner* print_job, JobEventDetails::Type detail_type, PrintedDocument* document, PrintedPage* page) { - auto* details = new JobEventDetails(detail_type, document, page); + JobEventDetails* details = new JobEventDetails(detail_type, document, page); content::NotificationService::current()->Notify( chrome::NOTIFICATION_PRINT_JOB_EVENT, // We know that is is a PrintJob object in this circumstance. @@ -343,7 +343,7 @@ void PrintJobWorker::OnDocumentDone() { base::RetainedRef(document_), nullptr)); // Makes sure the variables are reinitialized. - document_ = nullptr; + document_ = NULL; } void PrintJobWorker::SpoolPage(PrintedPage* page) { @@ -397,7 +397,7 @@ void PrintJobWorker::OnFailure() { Cancel(); // Makes sure the variables are reinitialized. - document_ = nullptr; + document_ = NULL; page_number_ = PageNumber::npos(); } diff --git a/chromium_src/chrome/browser/printing/print_preview_message_handler.cc b/chromium_src/chrome/browser/printing/print_preview_message_handler.cc index 9e1fca5c4699..d1f3660f8d2d 100644 --- a/chromium_src/chrome/browser/printing/print_preview_message_handler.cc +++ b/chromium_src/chrome/browser/printing/print_preview_message_handler.cc @@ -48,7 +48,7 @@ char* CopyPDFDataOnIOThread( if (!shared_buf->Map(params.data_size)) return nullptr; char* memory_pdf_data = static_cast(shared_buf->memory()); - auto* pdf_data = new char[params.data_size]; + char* pdf_data = new char[params.data_size]; memcpy(pdf_data, memory_pdf_data, params.data_size); return pdf_data; } diff --git a/chromium_src/chrome/browser/printing/print_view_manager_base.cc b/chromium_src/chrome/browser/printing/print_view_manager_base.cc index 7de8ae56fd72..2bbafdd8e55a 100644 --- a/chromium_src/chrome/browser/printing/print_view_manager_base.cc +++ b/chromium_src/chrome/browser/printing/print_view_manager_base.cc @@ -394,7 +394,7 @@ void PrintViewManagerBase::ReleasePrintJob() { content::Source(print_job_.get())); print_job_->DisconnectSource(); // Don't close the worker thread. - print_job_ = nullptr; + print_job_ = NULL; } bool PrintViewManagerBase::RunInnerMessageLoop() { diff --git a/chromium_src/chrome/browser/printing/printer_query.cc b/chromium_src/chrome/browser/printing/printer_query.cc index d36d51a9f890..72e2b85f635c 100644 --- a/chromium_src/chrome/browser/printing/printer_query.cc +++ b/chromium_src/chrome/browser/printing/printer_query.cc @@ -122,7 +122,7 @@ bool PrinterQuery::is_callback_pending() const { } bool PrinterQuery::is_valid() const { - return worker_.get() != nullptr; + return worker_.get() != NULL; } } // namespace printing diff --git a/chromium_src/chrome/browser/printing/printing_message_filter.cc b/chromium_src/chrome/browser/printing/printing_message_filter.cc index 31a7cf535a66..819c6af5b020 100644 --- a/chromium_src/chrome/browser/printing/printing_message_filter.cc +++ b/chromium_src/chrome/browser/printing/printing_message_filter.cc @@ -246,7 +246,7 @@ content::WebContents* PrintingMessageFilter::GetWebContentsForRenderView( DCHECK_CURRENTLY_ON(BrowserThread::UI); content::RenderViewHost* view = content::RenderViewHost::FromID( render_process_id_, render_view_id); - return view ? content::WebContents::FromRenderViewHost(view) : nullptr; + return view ? content::WebContents::FromRenderViewHost(view) : NULL; } void PrintingMessageFilter::OnGetDefaultPrintSettings(IPC::Message* reply_msg) { diff --git a/chromium_src/chrome/browser/process_singleton_posix.cc b/chromium_src/chrome/browser/process_singleton_posix.cc index 88dfa9e0fa10..5742b3585205 100644 --- a/chromium_src/chrome/browser/process_singleton_posix.cc +++ b/chromium_src/chrome/browser/process_singleton_posix.cc @@ -171,7 +171,7 @@ int WaitSocketForRead(int fd, const base::TimeDelta& timeout) { FD_ZERO(&read_fds); FD_SET(fd, &read_fds); - return HANDLE_EINTR(select(fd + 1, &read_fds, nullptr, nullptr, &tv)); + return HANDLE_EINTR(select(fd + 1, &read_fds, NULL, NULL, &tv)); } // Read a message from a socket fd, with an optional timeout. @@ -579,7 +579,9 @@ void ProcessSingleton::LinuxWatcher::OnFileCanReadWithoutBlocking(int fd) { } int rv = base::SetNonBlocking(connection_socket); DCHECK_EQ(0, rv) << "Failed to make non-blocking socket."; - auto* reader = new SocketReader(this, ui_message_loop_, connection_socket); + SocketReader* reader = new SocketReader(this, + ui_message_loop_, + connection_socket); readers_.insert(reader); } @@ -820,9 +822,10 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout( to_send.append(current_dir.value()); const std::vector& argv = atom::AtomCommandLine::argv(); - for (const auto& it : argv) { + for (std::vector::const_iterator it = argv.begin(); + it != argv.end(); ++it) { to_send.push_back(kTokenDelimiter); - to_send.append(it); + to_send.append(*it); } // Send the message diff --git a/chromium_src/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc b/chromium_src/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc index d402dd9b61b8..4e66d772ec38 100644 --- a/chromium_src/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc +++ b/chromium_src/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc @@ -86,10 +86,12 @@ std::string ReadDataFromPickle(const base::string16& format, bool WriteDataToPickle(const std::map& data, base::Pickle* pickle) { pickle->WriteUInt32(data.size()); - for (const auto& it : data) { - if (!pickle->WriteString16(it.first)) + for (std::map::const_iterator it = data.begin(); + it != data.end(); + ++it) { + if (!pickle->WriteString16(it->first)) return false; - if (!pickle->WriteString(it.second)) + if (!pickle->WriteString(it->second)) return false; } return true; diff --git a/chromium_src/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc b/chromium_src/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc index bf4d0f02a66a..10c07906af9b 100644 --- a/chromium_src/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc +++ b/chromium_src/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc @@ -26,7 +26,7 @@ PepperIsolatedFileSystemMessageFilter::Create(PP_Instance instance, int unused_render_frame_id; if (!host->GetRenderFrameIDsForInstance( instance, &render_process_id, &unused_render_frame_id)) { - return nullptr; + return NULL; } return new PepperIsolatedFileSystemMessageFilter( render_process_id, diff --git a/chromium_src/chrome/browser/renderer_host/pepper/widevine_cdm_message_filter.cc b/chromium_src/chrome/browser/renderer_host/pepper/widevine_cdm_message_filter.cc index 4264f92c6c73..c926b9e94aa7 100644 --- a/chromium_src/chrome/browser/renderer_host/pepper/widevine_cdm_message_filter.cc +++ b/chromium_src/chrome/browser/renderer_host/pepper/widevine_cdm_message_filter.cc @@ -43,14 +43,16 @@ void WidevineCdmMessageFilter::OnIsInternalPluginAvailableForMimeType( std::vector plugins; PluginService::GetInstance()->GetInternalPlugins(&plugins); - for (auto& plugin : plugins) { + for (size_t i = 0; i < plugins.size(); ++i) { + const WebPluginInfo& plugin = plugins[i]; const std::vector& mime_types = plugin.mime_types; - for (const auto& j : mime_types) { - if (j.mime_type == mime_type) { + for (size_t j = 0; j < mime_types.size(); ++j) { + + if (mime_types[j].mime_type == mime_type) { *is_available = true; - *additional_param_names = j.additional_param_names; - *additional_param_values = j.additional_param_values; + *additional_param_names = mime_types[j].additional_param_names; + *additional_param_values = mime_types[j].additional_param_values; return; } } diff --git a/chromium_src/chrome/browser/speech/tts_controller_impl.cc b/chromium_src/chrome/browser/speech/tts_controller_impl.cc index 5e1c630fc4cb..610ce1656759 100644 --- a/chromium_src/chrome/browser/speech/tts_controller_impl.cc +++ b/chromium_src/chrome/browser/speech/tts_controller_impl.cc @@ -115,10 +115,10 @@ TtsControllerImpl* TtsControllerImpl::GetInstance() { } TtsControllerImpl::TtsControllerImpl() - : current_utterance_(nullptr), + : current_utterance_(NULL), paused_(false), - platform_impl_(nullptr), - tts_engine_delegate_(nullptr) { + platform_impl_(NULL), + tts_engine_delegate_(NULL) { } TtsControllerImpl::~TtsControllerImpl() { @@ -206,7 +206,7 @@ void TtsControllerImpl::SpeakNow(Utterance* utterance) { if (!sends_end_event) { utterance->Finish(); delete utterance; - current_utterance_ = nullptr; + current_utterance_ = NULL; SpeakNextUtterance(); } #endif @@ -222,7 +222,7 @@ void TtsControllerImpl::SpeakNow(Utterance* utterance) { voice, utterance->continuous_parameters()); if (!success) - current_utterance_ = nullptr; + current_utterance_ = NULL; // If the native voice wasn't able to process this speech, see if // the browser has built-in TTS that isn't loaded yet. @@ -323,7 +323,7 @@ void TtsControllerImpl::GetVoices(content::BrowserContext* browser_context, } bool TtsControllerImpl::IsSpeaking() { - return current_utterance_ != nullptr || GetPlatformImpl()->IsSpeaking(); + return current_utterance_ != NULL || GetPlatformImpl()->IsSpeaking(); } void TtsControllerImpl::FinishCurrentUtterance() { @@ -332,7 +332,7 @@ void TtsControllerImpl::FinishCurrentUtterance() { current_utterance_->OnTtsEvent(TTS_EVENT_INTERRUPTED, kInvalidCharIndex, std::string()); delete current_utterance_; - current_utterance_ = nullptr; + current_utterance_ = NULL; } } @@ -415,8 +415,11 @@ int TtsControllerImpl::GetMatchingVoice( if (utterance->required_event_types().size() > 0) { bool has_all_required_event_types = true; - for (auto iter : utterance->required_event_types()) { - if (voice.events.find(iter) == voice.events.end()) { + for (std::set::const_iterator iter = + utterance->required_event_types().begin(); + iter != utterance->required_event_types().end(); + ++iter) { + if (voice.events.find(*iter) == voice.events.end()) { has_all_required_event_types = false; break; } @@ -433,8 +436,10 @@ int TtsControllerImpl::GetMatchingVoice( } void TtsControllerImpl::VoicesChanged() { - for (auto voices_changed_delegate : voices_changed_delegates_) { - voices_changed_delegate->OnVoicesChanged(); + for (std::set::iterator iter = + voices_changed_delegates_.begin(); + iter != voices_changed_delegates_.end(); ++iter) { + (*iter)->OnVoicesChanged(); } } diff --git a/chromium_src/chrome/renderer/media/chrome_key_systems.cc b/chromium_src/chrome/renderer/media/chrome_key_systems.cc index df51559dafd8..417a61fcdab9 100644 --- a/chromium_src/chrome/renderer/media/chrome_key_systems.cc +++ b/chromium_src/chrome/renderer/media/chrome_key_systems.cc @@ -112,13 +112,13 @@ static void AddPepperBasedWidevine( supported_codecs |= media::EME_CODEC_MP4_AAC; #endif // defined(USE_PROPRIETARY_CODECS) - for (auto& codec : codecs) { - if (codec == kCdmSupportedCodecVp8) + for (size_t i = 0; i < codecs.size(); ++i) { + if (codecs[i] == kCdmSupportedCodecVp8) supported_codecs |= media::EME_CODEC_WEBM_VP8; - if (codec == kCdmSupportedCodecVp9) + if (codecs[i] == kCdmSupportedCodecVp9) supported_codecs |= media::EME_CODEC_WEBM_VP9; #if defined(USE_PROPRIETARY_CODECS) - if (codec == kCdmSupportedCodecAvc1) + if (codecs[i] == kCdmSupportedCodecAvc1) supported_codecs |= media::EME_CODEC_MP4_AVC1; #endif // defined(USE_PROPRIETARY_CODECS) } diff --git a/chromium_src/chrome/renderer/pepper/pepper_flash_menu_host.cc b/chromium_src/chrome/renderer/pepper/pepper_flash_menu_host.cc index 424b6ac6fdb7..3b7a438f7220 100644 --- a/chromium_src/chrome/renderer/pepper/pepper_flash_menu_host.cc +++ b/chromium_src/chrome/renderer/pepper/pepper_flash_menu_host.cc @@ -195,7 +195,7 @@ void PepperFlashMenuHost::OnMenuClosed(int request_id) { void PepperFlashMenuHost::SendMenuReply(int32_t result, int action) { ppapi::host::ReplyMessageContext reply_context( ppapi::proxy::ResourceMessageReplyParams(pp_resource(), 0), - nullptr, + NULL, MSG_ROUTING_NONE); reply_context.params.set_result(result); host()->SendReply(reply_context, PpapiPluginMsg_FlashMenu_ShowReply(action)); diff --git a/chromium_src/chrome/renderer/pepper/pepper_flash_renderer_host.cc b/chromium_src/chrome/renderer/pepper/pepper_flash_renderer_host.cc index 6606d736c042..59046b328bfe 100644 --- a/chromium_src/chrome/renderer/pepper/pepper_flash_renderer_host.cc +++ b/chromium_src/chrome/renderer/pepper/pepper_flash_renderer_host.cc @@ -115,7 +115,7 @@ bool IsSimpleHeader(const std::string& lower_case_header_name, &lower_case_mime_type, &lower_case_charset, &had_charset, - nullptr); + NULL); return lower_case_mime_type == "application/x-www-form-urlencoded" || lower_case_mime_type == "multipart/form-data" || lower_case_mime_type == "text/plain"; diff --git a/chromium_src/chrome/renderer/printing/print_web_view_helper.cc b/chromium_src/chrome/renderer/printing/print_web_view_helper.cc index 46506343d20c..7ff3471f953a 100644 --- a/chromium_src/chrome/renderer/printing/print_web_view_helper.cc +++ b/chromium_src/chrome/renderer/printing/print_web_view_helper.cc @@ -110,8 +110,8 @@ PrintMsg_Print_Params GetCssPrintParams( // Invalid page size and/or margins. We just use the default setting. if (new_content_width < 1 || new_content_height < 1) { - CHECK(frame != nullptr); - page_css_params = GetCssPrintParams(nullptr, page_index, page_params); + CHECK(frame != NULL); + page_css_params = GetCssPrintParams(NULL, page_index, page_params); return page_css_params; } @@ -254,7 +254,7 @@ void ComputeWebKitPrintParamsInDesiredDpi( blink::WebPlugin* GetPlugin(const blink::WebFrame* frame) { return frame->document().isPluginDocument() ? - frame->document().to().plugin() : nullptr; + frame->document().to().plugin() : NULL; } bool PrintingNodeOrPdfFrame(const blink::WebFrame* frame, @@ -323,7 +323,7 @@ FrameReference::FrameReference(blink::WebLocalFrame* frame) { } FrameReference::FrameReference() { - Reset(nullptr); + Reset(NULL); } FrameReference::~FrameReference() { @@ -334,20 +334,20 @@ void FrameReference::Reset(blink::WebLocalFrame* frame) { view_ = frame->view(); frame_ = frame; } else { - view_ = nullptr; - frame_ = nullptr; + view_ = NULL; + frame_ = NULL; } } blink::WebLocalFrame* FrameReference::GetFrame() { - if (view_ == nullptr || frame_ == nullptr) - return nullptr; - for (blink::WebFrame* frame = view_->mainFrame(); frame != nullptr; + if (view_ == NULL || frame_ == NULL) + return NULL; + for (blink::WebFrame* frame = view_->mainFrame(); frame != NULL; frame = frame->traverseNext(false)) { if (frame == frame_) return frame_; } - return nullptr; + return NULL; } blink::WebView* FrameReference::view() { @@ -477,7 +477,7 @@ PrepareFrameAndViewForPrint::PrepareFrameAndViewForPrint( frame->printBegin(web_print_params_, node_to_print_); print_params = CalculatePrintParamsForCss(frame, 0, print_params, ignore_css_margins, fit_to_page, - nullptr); + NULL); frame->printEnd(); } ComputeWebKitPrintParamsInDesiredDpi(print_params, &web_print_params_); @@ -623,7 +623,7 @@ void PrepareFrameAndViewForPrint::FinishPrinting() { web_view->close(); } } - frame_.Reset(nullptr); + frame_.Reset(NULL); on_ready_.Reset(); } @@ -980,10 +980,10 @@ bool PrintWebViewHelper::PrintPagesNative(blink::WebFrame* frame, PrintPageInternal(page_params, frame); } } else { - for (int page : params.pages) { - if (page >= page_count) + for (size_t i = 0; i < params.pages.size(); ++i) { + if (params.pages[i] >= page_count) break; - page_params.page_number = page; + page_params.page_number = params.pages[i]; PrintPageInternal(page_params, frame); } } diff --git a/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.cc b/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.cc index 4b1b03956272..46465f4dfd4a 100644 --- a/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.cc +++ b/chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.cc @@ -301,8 +301,8 @@ bool SpellcheckCharAttribute::OutputDefault(UChar c, // SpellcheckWordIterator implementation: SpellcheckWordIterator::SpellcheckWordIterator() - : text_(nullptr), - attribute_(nullptr), + : text_(NULL), + attribute_(NULL), iterator_() { } diff --git a/chromium_src/extensions/common/url_pattern.cc b/chromium_src/extensions/common/url_pattern.cc index 3742d2fe38a2..4303689fe81c 100644 --- a/chromium_src/extensions/common/url_pattern.cc +++ b/chromium_src/extensions/common/url_pattern.cc @@ -118,8 +118,8 @@ std::string StripTrailingWildcard(const std::string& path) { namespace extensions { // static bool URLPattern::IsValidSchemeForExtensions(const std::string& scheme) { - for (auto& kValidScheme : kValidSchemes) { - if (scheme == kValidScheme) + for (size_t i = 0; i < arraysize(kValidSchemes); ++i) { + if (scheme == kValidSchemes[i]) return true; } return false; @@ -346,7 +346,7 @@ bool URLPattern::SetPort(const std::string& port) { bool URLPattern::MatchesURL(const GURL& test) const { const GURL* test_url = &test; - bool has_inner_url = test.inner_url() != nullptr; + bool has_inner_url = test.inner_url() != NULL; if (has_inner_url) { if (!test.SchemeIsFileSystem()) @@ -370,7 +370,7 @@ bool URLPattern::MatchesURL(const GURL& test) const { bool URLPattern::MatchesSecurityOrigin(const GURL& test) const { const GURL* test_url = &test; - bool has_inner_url = test.inner_url() != nullptr; + bool has_inner_url = test.inner_url() != NULL; if (has_inner_url) { if (!test.SchemeIsFileSystem()) @@ -543,8 +543,9 @@ bool URLPattern::Contains(const URLPattern& other) const { bool URLPattern::MatchesAnyScheme( const std::vector& schemes) const { - for (const auto& scheme : schemes) { - if (MatchesScheme(scheme)) + for (std::vector::const_iterator i = schemes.begin(); + i != schemes.end(); ++i) { + if (MatchesScheme(*i)) return true; } @@ -553,8 +554,9 @@ bool URLPattern::MatchesAnyScheme( bool URLPattern::MatchesAllSchemes( const std::vector& schemes) const { - for (const auto& scheme : schemes) { - if (!MatchesScheme(scheme)) + for (std::vector::const_iterator i = schemes.begin(); + i != schemes.end(); ++i) { + if (!MatchesScheme(*i)) return false; } @@ -584,9 +586,9 @@ std::vector URLPattern::GetExplicitSchemes() const { return result; } - for (auto& kValidScheme : kValidSchemes) { - if (MatchesScheme(kValidScheme)) { - result.push_back(kValidScheme); + for (size_t i = 0; i < arraysize(kValidSchemes); ++i) { + if (MatchesScheme(kValidSchemes[i])) { + result.push_back(kValidSchemes[i]); } } diff --git a/chromium_src/net/test/embedded_test_server/stream_listen_socket.cc b/chromium_src/net/test/embedded_test_server/stream_listen_socket.cc index 0b93c7a93697..2514c636cbee 100644 --- a/chromium_src/net/test/embedded_test_server/stream_listen_socket.cc +++ b/chromium_src/net/test/embedded_test_server/stream_listen_socket.cc @@ -123,7 +123,7 @@ int StreamListenSocket::GetPeerAddress(IPEndPoint* address) const { } SocketDescriptor StreamListenSocket::AcceptSocket() { - SocketDescriptor conn = HANDLE_EINTR(accept(socket_, nullptr, nullptr)); + SocketDescriptor conn = HANDLE_EINTR(accept(socket_, NULL, NULL)); if (conn == kInvalidSocket) LOG(ERROR) << "Error accepting connection."; else