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

Side by Side Diff: chrome/browser/extensions/api/debugger/debugger_api.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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 // Implements the Chrome Extensions Debugger API. 5 // Implements the Chrome Extensions Debugger API.
6 6
7 #include "chrome/browser/extensions/api/debugger/debugger_api.h" 7 #include "chrome/browser/extensions/api/debugger/debugger_api.h"
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 Close(); 425 Close();
426 } 426 }
427 427
428 void ExtensionDevToolsClientHost::DispatchProtocolMessage( 428 void ExtensionDevToolsClientHost::DispatchProtocolMessage(
429 DevToolsAgentHost* agent_host, const std::string& message) { 429 DevToolsAgentHost* agent_host, const std::string& message) {
430 DCHECK(agent_host == agent_host_.get()); 430 DCHECK(agent_host == agent_host_.get());
431 if (!EventRouter::Get(profile_)) 431 if (!EventRouter::Get(profile_))
432 return; 432 return;
433 433
434 std::unique_ptr<base::Value> result = base::JSONReader::Read(message); 434 std::unique_ptr<base::Value> result = base::JSONReader::Read(message);
435 if (!result || !result->IsType(base::Value::TYPE_DICTIONARY)) 435 if (!result || !result->IsType(base::Value::Type::DICTIONARY))
436 return; 436 return;
437 base::DictionaryValue* dictionary = 437 base::DictionaryValue* dictionary =
438 static_cast<base::DictionaryValue*>(result.get()); 438 static_cast<base::DictionaryValue*>(result.get());
439 439
440 int id; 440 int id;
441 if (!dictionary->GetInteger("id", &id)) { 441 if (!dictionary->GetInteger("id", &id)) {
442 std::string method_name; 442 std::string method_name;
443 if (!dictionary->GetString("method", &method_name)) 443 if (!dictionary->GetString("method", &method_name))
444 return; 444 return;
445 445
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 void DebuggerGetTargetsFunction::SendTargetList( 729 void DebuggerGetTargetsFunction::SendTargetList(
730 const content::DevToolsAgentHost::List& target_list) { 730 const content::DevToolsAgentHost::List& target_list) {
731 std::unique_ptr<base::ListValue> result(new base::ListValue()); 731 std::unique_ptr<base::ListValue> result(new base::ListValue());
732 for (size_t i = 0; i < target_list.size(); ++i) 732 for (size_t i = 0; i < target_list.size(); ++i)
733 result->Append(SerializeTarget(target_list[i])); 733 result->Append(SerializeTarget(target_list[i]));
734 SetResult(std::move(result)); 734 SetResult(std::move(result));
735 SendResponse(true); 735 SendResponse(true);
736 } 736 }
737 737
738 } // namespace extensions 738 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698