OLD | NEW |
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/net_internals/net_internals_ui.h" | 5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 // Closes file handle, so, should be called on the WorkerPool thread. | 316 // Closes file handle, so, should be called on the WorkerPool thread. |
317 void CloseDebugLogFile(PassPlatformFile pass_platform_file) { | 317 void CloseDebugLogFile(PassPlatformFile pass_platform_file) { |
318 base::ClosePlatformFile(pass_platform_file.ReleaseValue()); | 318 base::ClosePlatformFile(pass_platform_file.ReleaseValue()); |
319 } | 319 } |
320 | 320 |
321 // Closes file handle and deletes debug log file, so, should be called | 321 // Closes file handle and deletes debug log file, so, should be called |
322 // on the WorkerPool thread. | 322 // on the WorkerPool thread. |
323 void CloseAndDeleteDebugLogFile(PassPlatformFile pass_platform_file, | 323 void CloseAndDeleteDebugLogFile(PassPlatformFile pass_platform_file, |
324 const base::FilePath& file_path) { | 324 const base::FilePath& file_path) { |
325 CloseDebugLogFile(pass_platform_file); | 325 CloseDebugLogFile(pass_platform_file); |
326 file_util::Delete(file_path, false); | 326 base::Delete(file_path, false); |
327 } | 327 } |
328 | 328 |
329 // Called upon completion of |WriteDebugLogToFile|. Closes file | 329 // Called upon completion of |WriteDebugLogToFile|. Closes file |
330 // descriptor, deletes log file in the case of failure and calls | 330 // descriptor, deletes log file in the case of failure and calls |
331 // |callback|. | 331 // |callback|. |
332 void WriteDebugLogToFileCompleted(const StoreDebugLogsCallback& callback, | 332 void WriteDebugLogToFileCompleted(const StoreDebugLogsCallback& callback, |
333 PassPlatformFile pass_platform_file, | 333 PassPlatformFile pass_platform_file, |
334 const base::FilePath& file_path, | 334 const base::FilePath& file_path, |
335 bool succeeded) { | 335 bool succeeded) { |
336 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 336 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1884 } | 1884 } |
1885 | 1885 |
1886 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1886 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1887 : WebUIController(web_ui) { | 1887 : WebUIController(web_ui) { |
1888 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1888 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1889 | 1889 |
1890 // Set up the chrome://net-internals/ source. | 1890 // Set up the chrome://net-internals/ source. |
1891 Profile* profile = Profile::FromWebUI(web_ui); | 1891 Profile* profile = Profile::FromWebUI(web_ui); |
1892 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1892 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
1893 } | 1893 } |
OLD | NEW |