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

Side by Side Diff: chrome/browser/devtools/devtools_protocol.cc

Issue 106433007: Update some uses of Value in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 12 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/devtools/devtools_protocol.h" 5 #include "chrome/browser/devtools/devtools_protocol.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 9
10 namespace { 10 namespace {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 DevToolsProtocol::Response::Response(int id, int error_code) 60 DevToolsProtocol::Response::Response(int id, int error_code)
61 : id_(id), 61 : id_(id),
62 error_code_(error_code) { 62 error_code_(error_code) {
63 } 63 }
64 64
65 // static 65 // static
66 DevToolsProtocol::Notification* DevToolsProtocol::ParseNotification( 66 DevToolsProtocol::Notification* DevToolsProtocol::ParseNotification(
67 const std::string& json) { 67 const std::string& json) {
68 scoped_ptr<base::Value> value(base::JSONReader::Read(json)); 68 scoped_ptr<base::Value> value(base::JSONReader::Read(json));
69 if (!value || !value->IsType(Value::TYPE_DICTIONARY)) 69 if (!value || !value->IsType(base::Value::TYPE_DICTIONARY))
70 return NULL; 70 return NULL;
71 71
72 scoped_ptr<base::DictionaryValue> dict( 72 scoped_ptr<base::DictionaryValue> dict(
73 static_cast<base::DictionaryValue*>(value.release())); 73 static_cast<base::DictionaryValue*>(value.release()));
74 74
75 std::string method; 75 std::string method;
76 if (!dict->GetString(kMethodParam, &method)) 76 if (!dict->GetString(kMethodParam, &method))
77 return NULL; 77 return NULL;
78 78
79 base::DictionaryValue* params = NULL; 79 base::DictionaryValue* params = NULL;
80 dict->GetDictionary(kParamsParam, &params); 80 dict->GetDictionary(kParamsParam, &params);
81 return new Notification(method, params); 81 return new Notification(method, params);
82 } 82 }
83 83
84 DevToolsProtocol::Response* DevToolsProtocol::ParseResponse( 84 DevToolsProtocol::Response* DevToolsProtocol::ParseResponse(
85 const std::string& json) { 85 const std::string& json) {
86 scoped_ptr<base::Value> value(base::JSONReader::Read(json)); 86 scoped_ptr<base::Value> value(base::JSONReader::Read(json));
87 if (!value || !value->IsType(Value::TYPE_DICTIONARY)) 87 if (!value || !value->IsType(base::Value::TYPE_DICTIONARY))
88 return NULL; 88 return NULL;
89 89
90 scoped_ptr<base::DictionaryValue> dict( 90 scoped_ptr<base::DictionaryValue> dict(
91 static_cast<base::DictionaryValue*>(value.release())); 91 static_cast<base::DictionaryValue*>(value.release()));
92 92
93 int id; 93 int id;
94 if (!dict->GetInteger(kIdParam, &id)) 94 if (!dict->GetInteger(kIdParam, &id))
95 return NULL; 95 return NULL;
96 96
97 int error_code = 0; 97 int error_code = 0;
98 base::DictionaryValue* error_dict = NULL; 98 base::DictionaryValue* error_dict = NULL;
99 if (dict->GetDictionary(kErrorParam, &error_dict)) 99 if (dict->GetDictionary(kErrorParam, &error_dict))
100 error_dict->GetInteger(kErrorCodeParam, &error_code); 100 error_dict->GetInteger(kErrorCodeParam, &error_code);
101 return new Response(id, error_code); 101 return new Response(id, error_code);
102 } 102 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_file_helper.cc ('k') | chrome/browser/devtools/devtools_targets_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698