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

Unified Diff: chrome/browser/ui/webui/tracing_ui.cc

Issue 10907098: Revert 155218 - Move gpu blacklist to content side. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/gpu_internals_ui.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/tracing_ui.cc
===================================================================
--- chrome/browser/ui/webui/tracing_ui.cc (revision 155222)
+++ chrome/browser/ui/webui/tracing_ui.cc (working copy)
@@ -15,6 +15,8 @@
#include "base/string_number_conversions.h"
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/gpu_blacklist.h"
+#include "chrome/browser/gpu_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
@@ -68,7 +70,8 @@
: public WebUIMessageHandler,
public ui::SelectFileDialog::Listener,
public base::SupportsWeakPtr<TracingMessageHandler>,
- public content::TraceSubscriber {
+ public content::TraceSubscriber,
+ public content::GpuDataManagerObserver {
public:
TracingMessageHandler();
virtual ~TracingMessageHandler();
@@ -86,6 +89,11 @@
const scoped_refptr<base::RefCountedString>& trace_fragment);
virtual void OnTraceBufferPercentFullReply(float percent_full);
+ // GpuDataManagerObserver implementation.
+ virtual void OnGpuInfoUpdate() OVERRIDE;
+ virtual void OnVideoMemoryUsageStatsUpdate(
+ const content::GPUVideoMemoryUsageStats& video_memory) OVERRIDE {}
+
// Messages.
void OnTracingControllerInitialized(const ListValue* list);
void OnBeginTracing(const ListValue* list);
@@ -115,6 +123,10 @@
// True while system tracing is active.
bool system_trace_in_progress_;
+ // True if observing the GpuDataManager (re-attaching as observer would
+ // DCHECK).
+ bool observing_;
+
void OnEndSystemTracingAck(
const scoped_refptr<base::RefCountedString>& events_str_ptr);
@@ -157,10 +169,13 @@
TracingMessageHandler::TracingMessageHandler()
: select_trace_file_dialog_type_(ui::SelectFileDialog::SELECT_NONE),
trace_enabled_(false),
- system_trace_in_progress_(false) {
+ system_trace_in_progress_(false),
+ observing_(false) {
}
TracingMessageHandler::~TracingMessageHandler() {
+ GpuDataManager::GetInstance()->RemoveObserver(this);
+
if (select_trace_file_dialog_)
select_trace_file_dialog_->ListenerDestroyed();
@@ -204,6 +219,19 @@
const ListValue* args) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ // Watch for changes in GPUInfo
+ if (!observing_)
+ GpuDataManager::GetInstance()->AddObserver(this);
+ observing_ = true;
+
+ // Tell GpuDataManager it should have full GpuInfo. If the
+ // Gpu process has not run yet, this will trigger its launch.
+ GpuDataManager::GetInstance()->RequestCompleteGpuInfoIfNeeded();
+
+ // Run callback immediately in case the info is ready and no update in the
+ // future.
+ OnGpuInfoUpdate();
+
// Send the client info to the tracingController
{
scoped_ptr<DictionaryValue> dict(new DictionaryValue());
@@ -228,7 +256,7 @@
}
dict->SetString("blacklist_version",
- GpuDataManager::GetInstance()->GetBlacklistVersion());
+ GpuBlacklist::GetInstance()->GetVersion());
web_ui()->CallJavascriptFunction("tracingController.onClientInfoUpdate",
*dict);
}
@@ -239,6 +267,21 @@
TraceController::GetInstance()->GetTraceBufferPercentFullAsync(this);
}
+void TracingMessageHandler::OnGpuInfoUpdate() {
+ // Get GPU Info.
+ scoped_ptr<base::DictionaryValue> gpu_info_val(
+ gpu_util::GpuInfoAsDictionaryValue());
+
+ // Add in blacklisting features
+ Value* feature_status = gpu_util::GetFeatureStatus();
+ if (feature_status)
+ gpu_info_val->Set("featureStatus", feature_status);
+
+ // Send GPU Info to javascript.
+ web_ui()->CallJavascriptFunction("tracingController.onGpuInfoUpdate",
+ *(gpu_info_val.get()));
+}
+
// A callback used for asynchronously reading a file to a string. Calls the
// TaskProxy callback when reading is complete.
void ReadTraceFileCallback(TaskProxy* proxy, const FilePath& path) {
« no previous file with comments | « chrome/browser/ui/webui/gpu_internals_ui.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698