Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Side by Side Diff: chrome/browser/chromeos/memory/low_memory_observer.cc

Issue 623293003: replace OVERRIDE and FINAL with override and final in chrome/browser/chromeos/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: run git cl format on echo_dialog_view.h Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/memory/low_memory_observer.h" 5 #include "chrome/browser/chromeos/memory/low_memory_observer.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 void StartWatchingDescriptor(); 73 void StartWatchingDescriptor();
74 74
75 // Delegate to receive events from WatchFileDescriptor. 75 // Delegate to receive events from WatchFileDescriptor.
76 class FileWatcherDelegate : public base::MessageLoopForIO::Watcher { 76 class FileWatcherDelegate : public base::MessageLoopForIO::Watcher {
77 public: 77 public:
78 explicit FileWatcherDelegate(LowMemoryObserverImpl* owner) 78 explicit FileWatcherDelegate(LowMemoryObserverImpl* owner)
79 : owner_(owner) {} 79 : owner_(owner) {}
80 virtual ~FileWatcherDelegate() {} 80 virtual ~FileWatcherDelegate() {}
81 81
82 // Overrides for base::MessageLoopForIO::Watcher 82 // Overrides for base::MessageLoopForIO::Watcher
83 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE {} 83 virtual void OnFileCanWriteWithoutBlocking(int fd) override {}
84 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE { 84 virtual void OnFileCanReadWithoutBlocking(int fd) override {
85 LOG(WARNING) << "Low memory condition detected. Discarding a tab."; 85 LOG(WARNING) << "Low memory condition detected. Discarding a tab.";
86 // We can only discard tabs on the UI thread. 86 // We can only discard tabs on the UI thread.
87 base::Callback<void(void)> callback = base::Bind(&DiscardTab); 87 base::Callback<void(void)> callback = base::Bind(&DiscardTab);
88 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback); 88 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback);
89 owner_->ScheduleNextObservation(); 89 owner_->ScheduleNextObservation();
90 } 90 }
91 91
92 // Sends off a discard request to the OomPriorityManager. Must be run on 92 // Sends off a discard request to the OomPriorityManager. Must be run on
93 // the UI thread. 93 // the UI thread.
94 static void DiscardTab() { 94 static void DiscardTab() {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 void LowMemoryObserver::Stop() { 183 void LowMemoryObserver::Stop() {
184 BrowserThread::PostTask( 184 BrowserThread::PostTask(
185 BrowserThread::FILE, 185 BrowserThread::FILE,
186 FROM_HERE, 186 FROM_HERE,
187 base::Bind(&LowMemoryObserverImpl::StopObservingOnFileThread, 187 base::Bind(&LowMemoryObserverImpl::StopObservingOnFileThread,
188 observer_.get())); 188 observer_.get()));
189 } 189 }
190 190
191 } // namespace chromeos 191 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller_browsertest.cc ('k') | chrome/browser/chromeos/memory/oom_priority_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698