OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 | 54 |
55 virtual void StartDataRequest(const std::string& path, | 55 virtual void StartDataRequest(const std::string& path, |
56 bool is_incognito, | 56 bool is_incognito, |
57 int request_id) OVERRIDE { | 57 int request_id) OVERRIDE { |
58 FilePath base_path; | 58 FilePath base_path; |
59 PathService::Get(base::DIR_SOURCE_ROOT, &base_path); | 59 PathService::Get(base::DIR_SOURCE_ROOT, &base_path); |
60 base_path = base_path.AppendASCII("chrome"); | 60 base_path = base_path.AppendASCII("chrome"); |
61 base_path = base_path.AppendASCII("browser"); | 61 base_path = base_path.AppendASCII("browser"); |
62 base_path = base_path.AppendASCII("resources"); | 62 base_path = base_path.AppendASCII("resources"); |
| 63 base_path = base_path.AppendASCII("profiler"); |
63 | 64 |
64 // If no resource was specified, default to profiler.html. | 65 // If no resource was specified, default to profiler.html. |
65 std::string filename = path.empty() ? "profiler.html" : path; | 66 std::string filename = path.empty() ? "profiler.html" : path; |
66 | 67 |
67 FilePath file_path; | 68 FilePath file_path; |
68 file_path = base_path.AppendASCII(filename); | 69 file_path = base_path.AppendASCII(filename); |
69 | 70 |
70 // Read the file synchronously and send it as the response. | 71 // Read the file synchronously and send it as the response. |
71 base::ThreadRestrictions::ScopedAllowIO allow; | 72 base::ThreadRestrictions::ScopedAllowIO allow; |
72 std::string file_contents; | 73 std::string file_contents; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 void ProfilerUI::GetData() { | 164 void ProfilerUI::GetData() { |
164 TrackingSynchronizer::FetchProfilerDataAsynchronously(ui_weak_ptr_); | 165 TrackingSynchronizer::FetchProfilerDataAsynchronously(ui_weak_ptr_); |
165 } | 166 } |
166 | 167 |
167 void ProfilerUI::ReceivedData(base::Value* value) { | 168 void ProfilerUI::ReceivedData(base::Value* value) { |
168 // Send the data to the renderer. | 169 // Send the data to the renderer. |
169 scoped_ptr<Value> data_values(value); | 170 scoped_ptr<Value> data_values(value); |
170 CallJavascriptFunction("g_browserBridge.receivedData", *data_values.get()); | 171 CallJavascriptFunction("g_browserBridge.receivedData", *data_values.get()); |
171 } | 172 } |
172 | 173 |
OLD | NEW |