| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WEB_CONTENTS_RENDERER_TASK_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WEB_CONTENTS_RENDERER_TASK_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WEB_CONTENTS_RENDERER_TASK_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WEB_CONTENTS_RENDERER_TASK_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 const gfx::Image& image) override; | 73 const gfx::Image& image) override; |
| 74 | 74 |
| 75 void set_termination_status(base::TerminationStatus status) { | 75 void set_termination_status(base::TerminationStatus status) { |
| 76 termination_status_ = status; | 76 termination_status_ = status; |
| 77 } | 77 } |
| 78 | 78 |
| 79 void set_termination_error_code(int error_code) { | 79 void set_termination_error_code(int error_code) { |
| 80 termination_error_code_ = error_code; | 80 termination_error_code_ = error_code; |
| 81 } | 81 } |
| 82 | 82 |
| 83 content::WebContents* web_contents() const { return web_contents_; } |
| 84 |
| 83 protected: | 85 protected: |
| 84 // Returns the title of the given |web_contents|. | 86 // Returns the title of the given |web_contents|. |
| 85 static base::string16 GetTitleFromWebContents( | 87 static base::string16 GetTitleFromWebContents( |
| 86 content::WebContents* web_contents); | 88 content::WebContents* web_contents); |
| 87 | 89 |
| 88 // Returns the favicon of the given |web_contents| if any, and returns | 90 // Returns the favicon of the given |web_contents| if any, and returns |
| 89 // |nullptr| otherwise. | 91 // |nullptr| otherwise. |
| 90 static const gfx::ImageSkia* GetFaviconFromWebContents( | 92 static const gfx::ImageSkia* GetFaviconFromWebContents( |
| 91 content::WebContents* web_contents); | 93 content::WebContents* web_contents); |
| 92 | 94 |
| 93 // Prefixes the given renderer |title| with the appropriate string based on | 95 // Prefixes the given renderer |title| with the appropriate string based on |
| 94 // whether it's an app, an extension, incognito or a background page or | 96 // whether it's an app, an extension, incognito or a background page or |
| 95 // contents. | 97 // contents. |
| 96 static const base::string16 PrefixRendererTitle(const base::string16& title, | 98 static const base::string16 PrefixRendererTitle(const base::string16& title, |
| 97 bool is_app, | 99 bool is_app, |
| 98 bool is_extension, | 100 bool is_extension, |
| 99 bool is_incognito, | 101 bool is_incognito, |
| 100 bool is_background); | 102 bool is_background); |
| 101 | 103 |
| 102 content::WebContents* web_contents() const { return web_contents_; } | |
| 103 | |
| 104 private: | 104 private: |
| 105 // The WebContents of the task this object represents. | 105 // The WebContents of the task this object represents. |
| 106 content::WebContents* web_contents_; | 106 content::WebContents* web_contents_; |
| 107 | 107 |
| 108 // The render process host of the task this object represents. | 108 // The render process host of the task this object represents. |
| 109 content::RenderProcessHost* render_process_host_; | 109 content::RenderProcessHost* render_process_host_; |
| 110 | 110 |
| 111 // The Mojo service wrapper that will provide us with the V8 memory usage and | 111 // The Mojo service wrapper that will provide us with the V8 memory usage and |
| 112 // the WebCache resource stats of the render process represented by this | 112 // the WebCache resource stats of the render process represented by this |
| 113 // object. | 113 // object. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 129 | 129 |
| 130 base::TerminationStatus termination_status_; | 130 base::TerminationStatus termination_status_; |
| 131 int termination_error_code_; | 131 int termination_error_code_; |
| 132 | 132 |
| 133 DISALLOW_COPY_AND_ASSIGN(RendererTask); | 133 DISALLOW_COPY_AND_ASSIGN(RendererTask); |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 } // namespace task_manager | 136 } // namespace task_manager |
| 137 | 137 |
| 138 #endif // CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WEB_CONTENTS_RENDERER_TASK_H_ | 138 #endif // CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WEB_CONTENTS_RENDERER_TASK_H_ |
| OLD | NEW |