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

Side by Side Diff: chrome/browser/ui/webui/profiler_ui.cc

Issue 2590793004: MD Downloads: gzip vulcanized resources via compress="gzip" (Closed)
Patch Set: . Created 4 years 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/ui/webui/profiler_ui.h" 5 #include "chrome/browser/ui/webui/profiler_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 // When testing the javacript code, it is cumbersome to have to keep 9 // When testing the javacript code, it is cumbersome to have to keep
10 // re-building the resouces package and reloading the browser. To solve 10 // re-building the resouces package and reloading the browser. To solve
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 #else // USE_SOURCE_FILES_DIRECTLY 99 #else // USE_SOURCE_FILES_DIRECTLY
100 100
101 content::WebUIDataSource* CreateProfilerHTMLSource() { 101 content::WebUIDataSource* CreateProfilerHTMLSource() {
102 content::WebUIDataSource* source = 102 content::WebUIDataSource* source =
103 content::WebUIDataSource::Create(chrome::kChromeUIProfilerHost); 103 content::WebUIDataSource::Create(chrome::kChromeUIProfilerHost);
104 104
105 source->SetJsonPath("strings.js"); 105 source->SetJsonPath("strings.js");
106 source->AddResourcePath("profiler.js", IDR_PROFILER_JS); 106 source->AddResourcePath("profiler.js", IDR_PROFILER_JS);
107 source->SetDefaultResource(IDR_PROFILER_HTML); 107 source->SetDefaultResource(IDR_PROFILER_HTML);
108 source->DisableI18nAndUseGzipForAllPaths(); 108 source->UseGzip(std::unordered_set<std::string>());
109 source->AddBoolean("enableMemoryTaskProfiler", 109 source->AddBoolean("enableMemoryTaskProfiler",
110 BUILDFLAG(ENABLE_MEMORY_TASK_PROFILER)); 110 BUILDFLAG(ENABLE_MEMORY_TASK_PROFILER));
111 111
112 return source; 112 return source;
113 } 113 }
114 114
115 #endif 115 #endif
116 116
117 // This class receives javascript messages from the renderer. 117 // This class receives javascript messages from the renderer.
118 // Note that the WebUI infrastructure runs on the UI thread, therefore all of 118 // Note that the WebUI infrastructure runs on the UI thread, therefore all of
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // Serialize the data to JSON. 174 // Serialize the data to JSON.
175 base::DictionaryValue json_data; 175 base::DictionaryValue json_data;
176 task_profiler::TaskProfilerDataSerializer::ToValue( 176 task_profiler::TaskProfilerDataSerializer::ToValue(
177 process_data_phase, attributes.process_id, attributes.process_type, 177 process_data_phase, attributes.process_id, attributes.process_type,
178 &json_data); 178 &json_data);
179 179
180 // Send the data to the renderer. 180 // Send the data to the renderer.
181 web_ui()->CallJavascriptFunctionUnsafe("g_browserBridge.receivedData", 181 web_ui()->CallJavascriptFunctionUnsafe("g_browserBridge.receivedData",
182 json_data); 182 json_data);
183 } 183 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/predictors/predictors_ui.cc ('k') | chrome/browser/ui/webui/signin_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698