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

Side by Side Diff: ios/chrome/browser/ui/webui/net_export/net_export_ui.cc

Issue 2698143004: Add ongoing events to net-export log when logging starts (Closed)
Patch Set: Fixed Eric's comments from ps10 Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ios/chrome/browser/ui/webui/net_export/net_export_ui.h" 5 #include "ios/chrome/browser/ui/webui/net_export/net_export_ui.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 133
134 void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) { 134 void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) {
135 DCHECK_CURRENTLY_ON(web::WebThread::UI); 135 DCHECK_CURRENTLY_ON(web::WebThread::UI);
136 std::string capture_mode_string; 136 std::string capture_mode_string;
137 bool result = list->GetString(0, &capture_mode_string); 137 bool result = list->GetString(0, &capture_mode_string);
138 DCHECK(result); 138 DCHECK(result);
139 139
140 net::NetLogCaptureMode capture_mode = 140 net::NetLogCaptureMode capture_mode =
141 net_log::NetLogFileWriter::CaptureModeFromString(capture_mode_string); 141 net_log::NetLogFileWriter::CaptureModeFromString(capture_mode_string);
142 file_writer_->StartNetLog(base::FilePath(), capture_mode); 142 file_writer_->StartNetLog(
143 base::FilePath(), capture_mode,
144 {GetApplicationContext()->GetSystemURLRequestContext()});
143 } 145 }
144 146
145 void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) { 147 void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) {
146 DCHECK_CURRENTLY_ON(web::WebThread::UI); 148 DCHECK_CURRENTLY_ON(web::WebThread::UI);
147 file_writer_->StopNetLog( 149 file_writer_->StopNetLog(
148 nullptr, GetApplicationContext()->GetSystemURLRequestContext()); 150 nullptr, GetApplicationContext()->GetSystemURLRequestContext());
149 } 151 }
150 152
151 void NetExportMessageHandler::OnSendNetLog(const base::ListValue* list) { 153 void NetExportMessageHandler::OnSendNetLog(const base::ListValue* list) {
152 DCHECK_CURRENTLY_ON(web::WebThread::UI); 154 DCHECK_CURRENTLY_ON(web::WebThread::UI);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 } 187 }
186 188
187 } // namespace 189 } // namespace
188 190
189 NetExportUI::NetExportUI(web::WebUIIOS* web_ui) 191 NetExportUI::NetExportUI(web::WebUIIOS* web_ui)
190 : web::WebUIIOSController(web_ui) { 192 : web::WebUIIOSController(web_ui) {
191 web_ui->AddMessageHandler(base::MakeUnique<NetExportMessageHandler>()); 193 web_ui->AddMessageHandler(base::MakeUnique<NetExportMessageHandler>());
192 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui), 194 web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui),
193 CreateNetExportHTMLSource()); 195 CreateNetExportHTMLSource());
194 } 196 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698