diff --git a/atom/browser/api/atom_api_session.cc b/atom/browser/api/atom_api_session.cc index ae5854df5385..c898f5f1b33f 100644 --- a/atom/browser/api/atom_api_session.cc +++ b/atom/browser/api/atom_api_session.cc @@ -241,7 +241,7 @@ void OnGetBackend(disk_cache::Backend** backend_ptr, } else if (action == Session::CacheAction::STATS) { base::StringPairs stats; (*backend_ptr)->GetStats(&stats); - for (auto& stat : stats) { + for (const auto& stat : stats) { if (stat.first == "Current size") { int current_size; base::StringToInt(stat.second, ¤t_size); diff --git a/atom/browser/common_web_contents_delegate.cc b/atom/browser/common_web_contents_delegate.cc index e94203e0b5a7..f2f0ee8aec53 100644 --- a/atom/browser/common_web_contents_delegate.cc +++ b/atom/browser/common_web_contents_delegate.cc @@ -435,7 +435,7 @@ void CommonWebContentsDelegate::DevToolsRequestFileSystems() { } base::ListValue file_system_value; - for (auto& file_system : file_systems) + for (const auto& file_system : file_systems) file_system_value.Append(CreateFileSystemValue(file_system)); web_contents_->CallClientFunction("DevToolsAPI.fileSystemsLoaded", &file_system_value, nullptr, nullptr); diff --git a/atom/browser/ui/accelerator_util.cc b/atom/browser/ui/accelerator_util.cc index 1c26af1b3965..eb89bf0c35f5 100644 --- a/atom/browser/ui/accelerator_util.cc +++ b/atom/browser/ui/accelerator_util.cc @@ -30,7 +30,7 @@ bool StringToAccelerator(const std::string& shortcut, // Now, parse it into an accelerator. int modifiers = ui::EF_NONE; ui::KeyboardCode key = ui::VKEY_UNKNOWN; - for (auto& token : tokens) { + for (const auto& token : tokens) { bool shifted = false; ui::KeyboardCode code = atom::KeyboardCodeFromStr(token, &shifted); if (shifted) diff --git a/atom/browser/window_list.cc b/atom/browser/window_list.cc index 3568df9e6dff..83bf615aad25 100644 --- a/atom/browser/window_list.cc +++ b/atom/browser/window_list.cc @@ -70,7 +70,7 @@ void WindowList::RemoveObserver(WindowListObserver* observer) { // static void WindowList::CloseAllWindows() { WindowVector windows = GetInstance()->windows_; - for (auto& window : windows) + for (const auto& window : windows) window->Close(); } diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index f694ffe7e96a..80275e26a7fe 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -63,7 +63,7 @@ float GetScaleFactorFromPath(const base::FilePath& path) { // We don't try to convert string to float here because it is very very // expensive. - for (auto& kScaleFactorPair : kScaleFactorPairs) { + for (const auto& kScaleFactorPair : kScaleFactorPairs) { if (base::EndsWith(filename, kScaleFactorPair.name, base::CompareCase::INSENSITIVE_ASCII)) return kScaleFactorPair.scale; diff --git a/atom/common/node_bindings_mac.cc b/atom/common/node_bindings_mac.cc index 6be1226ae314..cbcbdba36050 100644 --- a/atom/common/node_bindings_mac.cc +++ b/atom/common/node_bindings_mac.cc @@ -54,7 +54,8 @@ void NodeBindingsMac::PollEvents() { // Wait for new libuv events. int r; do { - r = select(fd + 1, &readset, nullptr, nullptr, timeout == -1 ? nullptr : &tv); + r = select(fd + 1, &readset, nullptr, nullptr, + timeout == -1 ? nullptr : &tv); } while (r == -1 && errno == EINTR); } diff --git a/atom/renderer/atom_render_view_observer.cc b/atom/renderer/atom_render_view_observer.cc index e579165d7260..45a41eef8acc 100644 --- a/atom/renderer/atom_render_view_observer.cc +++ b/atom/renderer/atom_render_view_observer.cc @@ -132,7 +132,7 @@ void AtomRenderViewObserver::DraggableRegionsChanged(blink::WebFrame* frame) { blink::WebVector webregions = frame->document().draggableRegions(); std::vector regions; - for (auto& webregion : webregions) { + for (const auto& webregion : webregions) { DraggableRegion region; region.bounds = webregion.bounds; region.draggable = webregion.draggable; diff --git a/atom/utility/atom_content_utility_client.cc b/atom/utility/atom_content_utility_client.cc index 518be30510c3..8d4ccf628933 100644 --- a/atom/utility/atom_content_utility_client.cc +++ b/atom/utility/atom_content_utility_client.cc @@ -58,7 +58,7 @@ bool AtomContentUtilityClient::OnMessageReceived( IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() - for (auto it = handlers_.begin(); !handled && it != handlers_.end(); ++it) { + for (auto it = handlers_.begin(); !handled && it != handlers_.end(); ++it) { handled = (*it)->OnMessageReceived(message); }