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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 // | 385 // |
386 //////////////////////////////////////////////////////////////////////////////// | 386 //////////////////////////////////////////////////////////////////////////////// |
387 | 387 |
388 NetInternalsMessageHandler::NetInternalsMessageHandler() {} | 388 NetInternalsMessageHandler::NetInternalsMessageHandler() {} |
389 | 389 |
390 NetInternalsMessageHandler::~NetInternalsMessageHandler() { | 390 NetInternalsMessageHandler::~NetInternalsMessageHandler() { |
391 if (proxy_) { | 391 if (proxy_) { |
392 proxy_->OnWebUIDeleted(); | 392 proxy_->OnWebUIDeleted(); |
393 // Notify the handler on the IO thread that the renderer is gone. | 393 // Notify the handler on the IO thread that the renderer is gone. |
394 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 394 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
395 base::Bind(&IOThreadImpl::Detach, proxy_.get())); | 395 base::Bind(&IOThreadImpl::Detach, proxy_)); |
396 } | 396 } |
397 } | 397 } |
398 | 398 |
399 void NetInternalsMessageHandler::RegisterMessages() { | 399 void NetInternalsMessageHandler::RegisterMessages() { |
400 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 400 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
401 | 401 |
402 Profile* profile = Profile::FromWebUI(web_ui()); | 402 Profile* profile = Profile::FromWebUI(web_ui()); |
403 | 403 |
404 proxy_ = new IOThreadImpl(this->AsWeakPtr(), g_browser_process->io_thread(), | 404 proxy_ = new IOThreadImpl(this->AsWeakPtr(), g_browser_process->io_thread(), |
405 profile->GetRequestContext()); | 405 profile->GetRequestContext()); |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1175 //////////////////////////////////////////////////////////////////////////////// | 1175 //////////////////////////////////////////////////////////////////////////////// |
1176 | 1176 |
1177 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1177 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1178 : WebUIController(web_ui) { | 1178 : WebUIController(web_ui) { |
1179 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1179 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1180 | 1180 |
1181 // Set up the chrome://net-internals/ source. | 1181 // Set up the chrome://net-internals/ source. |
1182 Profile* profile = Profile::FromWebUI(web_ui); | 1182 Profile* profile = Profile::FromWebUI(web_ui); |
1183 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1183 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
1184 } | 1184 } |
OLD | NEW |