| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/slow_trace_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/slow_trace_ui.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 std::string SlowTraceSource::GetMimeType(const std::string& path) const { | 52 std::string SlowTraceSource::GetMimeType(const std::string& path) const { |
| 53 return "application/zip"; | 53 return "application/zip"; |
| 54 } | 54 } |
| 55 | 55 |
| 56 SlowTraceSource::~SlowTraceSource() {} | 56 SlowTraceSource::~SlowTraceSource() {} |
| 57 | 57 |
| 58 void SlowTraceSource::OnGetTraceData( | 58 void SlowTraceSource::OnGetTraceData( |
| 59 const content::URLDataSource::GotDataCallback& callback, | 59 const content::URLDataSource::GotDataCallback& callback, |
| 60 scoped_refptr<base::RefCountedString> trace_data) { | 60 scoped_refptr<base::RefCountedString> trace_data) { |
| 61 callback.Run(trace_data); | 61 callback.Run(trace_data.get()); |
| 62 } | 62 } |
| 63 | 63 |
| 64 //////////////////////////////////////////////////////////////////////////////// | 64 //////////////////////////////////////////////////////////////////////////////// |
| 65 // | 65 // |
| 66 // SlowTraceController | 66 // SlowTraceController |
| 67 // | 67 // |
| 68 //////////////////////////////////////////////////////////////////////////////// | 68 //////////////////////////////////////////////////////////////////////////////// |
| 69 | 69 |
| 70 SlowTraceController::SlowTraceController(content::WebUI* web_ui) | 70 SlowTraceController::SlowTraceController(content::WebUI* web_ui) |
| 71 : WebUIController(web_ui) { | 71 : WebUIController(web_ui) { |
| 72 SlowTraceSource* html_source = new SlowTraceSource(); | 72 SlowTraceSource* html_source = new SlowTraceSource(); |
| 73 | 73 |
| 74 // Set up the chrome://slow_trace/ source. | 74 // Set up the chrome://slow_trace/ source. |
| 75 Profile* profile = Profile::FromWebUI(web_ui); | 75 Profile* profile = Profile::FromWebUI(web_ui); |
| 76 content::URLDataSource::Add(profile, html_source); | 76 content::URLDataSource::Add(profile, html_source); |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace chromeos | 79 } // namespace chromeos |
| OLD | NEW |