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

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.cc

Issue 1995113002: Rename WebUI::CallJavascriptFunction to WebUI::CallJavascriptFunctionUnsafe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 (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 <list> 10 #include <list>
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 #endif 507 #endif
508 } 508 }
509 509
510 void NetInternalsMessageHandler::SendJavascriptCommand( 510 void NetInternalsMessageHandler::SendJavascriptCommand(
511 const std::string& command, 511 const std::string& command,
512 base::Value* arg) { 512 base::Value* arg) {
513 std::unique_ptr<base::Value> command_value(new base::StringValue(command)); 513 std::unique_ptr<base::Value> command_value(new base::StringValue(command));
514 std::unique_ptr<base::Value> value(arg); 514 std::unique_ptr<base::Value> value(arg);
515 DCHECK_CURRENTLY_ON(BrowserThread::UI); 515 DCHECK_CURRENTLY_ON(BrowserThread::UI);
516 if (value.get()) { 516 if (value.get()) {
517 web_ui()->CallJavascriptFunction("g_browser.receive", 517 web_ui()->CallJavascriptFunctionUnsafe("g_browser.receive",
518 *command_value.get(), 518 *command_value.get(), *value.get());
519 *value.get());
520 } else { 519 } else {
521 web_ui()->CallJavascriptFunction("g_browser.receive", 520 web_ui()->CallJavascriptFunctionUnsafe("g_browser.receive",
522 *command_value.get()); 521 *command_value.get());
523 } 522 }
524 } 523 }
525 524
526 void NetInternalsMessageHandler::OnRendererReady(const base::ListValue* list) { 525 void NetInternalsMessageHandler::OnRendererReady(const base::ListValue* list) {
527 IOThreadImpl::CallbackHelper(&IOThreadImpl::OnRendererReady, proxy_, list); 526 IOThreadImpl::CallbackHelper(&IOThreadImpl::OnRendererReady, proxy_, list);
528 } 527 }
529 528
530 void NetInternalsMessageHandler::OnClearBrowserCache( 529 void NetInternalsMessageHandler::OnClearBrowserCache(
531 const base::ListValue* list) { 530 const base::ListValue* list) {
532 BrowsingDataRemover* remover = 531 BrowsingDataRemover* remover =
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 //////////////////////////////////////////////////////////////////////////////// 1179 ////////////////////////////////////////////////////////////////////////////////
1181 1180
1182 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) 1181 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui)
1183 : WebUIController(web_ui) { 1182 : WebUIController(web_ui) {
1184 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); 1183 web_ui->AddMessageHandler(new NetInternalsMessageHandler());
1185 1184
1186 // Set up the chrome://net-internals/ source. 1185 // Set up the chrome://net-internals/ source.
1187 Profile* profile = Profile::FromWebUI(web_ui); 1186 Profile* profile = Profile::FromWebUI(web_ui);
1188 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); 1187 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource());
1189 } 1188 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/net_export_ui.cc ('k') | chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698