OLD | NEW |
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/memory/oom_priority_manager.h" | 5 #include "chrome/browser/memory/oom_priority_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "chrome/browser/ui/browser_list.h" | 32 #include "chrome/browser/ui/browser_list.h" |
33 #include "chrome/browser/ui/host_desktop.h" | 33 #include "chrome/browser/ui/host_desktop.h" |
34 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" | 34 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
35 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 35 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
36 #include "chrome/browser/ui/tabs/tab_utils.h" | 36 #include "chrome/browser/ui/tabs/tab_utils.h" |
37 #include "chrome/common/chrome_constants.h" | 37 #include "chrome/common/chrome_constants.h" |
38 #include "chrome/common/url_constants.h" | 38 #include "chrome/common/url_constants.h" |
39 #include "content/public/browser/browser_thread.h" | 39 #include "content/public/browser/browser_thread.h" |
40 #include "content/public/browser/render_process_host.h" | 40 #include "content/public/browser/render_process_host.h" |
41 #include "content/public/browser/web_contents.h" | 41 #include "content/public/browser/web_contents.h" |
| 42 #include "ui/gfx/host_desktop_type.h" |
42 | 43 |
43 #if defined(OS_CHROMEOS) | 44 #if defined(OS_CHROMEOS) |
44 #include "chrome/browser/memory/oom_priority_manager_delegate_chromeos.h" | 45 #include "chrome/browser/memory/oom_priority_manager_delegate_chromeos.h" |
45 #endif | 46 #endif |
46 | 47 |
47 using base::TimeDelta; | 48 using base::TimeDelta; |
48 using base::TimeTicks; | 49 using base::TimeTicks; |
49 using content::BrowserThread; | 50 using content::BrowserThread; |
50 using content::WebContents; | 51 using content::WebContents; |
51 | 52 |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 // For the moment we only do something when we reach a critical state. | 452 // For the moment we only do something when we reach a critical state. |
452 if (memory_pressure_level == | 453 if (memory_pressure_level == |
453 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL) { | 454 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL) { |
454 LogMemoryAndDiscardTab(); | 455 LogMemoryAndDiscardTab(); |
455 } | 456 } |
456 // TODO(skuhne): If more memory pressure levels are introduced, we might | 457 // TODO(skuhne): If more memory pressure levels are introduced, we might |
457 // consider to call PurgeBrowserMemory() before CRITICAL is reached. | 458 // consider to call PurgeBrowserMemory() before CRITICAL is reached. |
458 } | 459 } |
459 | 460 |
460 } // namespace memory | 461 } // namespace memory |
OLD | NEW |