diff options
25 files changed, 213 insertions, 211 deletions
diff --git a/content/browser/accessibility/accessibility_tree_formatter.cc b/content/browser/accessibility/accessibility_tree_formatter.cc index 4cf30ea..bdbe4d5 100644 --- a/content/browser/accessibility/accessibility_tree_formatter.cc +++ b/content/browser/accessibility/accessibility_tree_formatter.cc @@ -47,21 +47,21 @@ AccessibilityTreeFormatter* AccessibilityTreeFormatter::Create( AccessibilityTreeFormatter::~AccessibilityTreeFormatter() { } -scoped_ptr<DictionaryValue> +scoped_ptr<base::DictionaryValue> AccessibilityTreeFormatter::BuildAccessibilityTree() { - scoped_ptr<DictionaryValue> dict(new DictionaryValue); + scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue); RecursiveBuildAccessibilityTree(*root_, dict.get()); return dict.Pass(); } void AccessibilityTreeFormatter::FormatAccessibilityTree( string16* contents) { - scoped_ptr<DictionaryValue> dict = BuildAccessibilityTree(); + scoped_ptr<base::DictionaryValue> dict = BuildAccessibilityTree(); RecursiveFormatAccessibilityTree(*(dict.get()), contents); } void AccessibilityTreeFormatter::RecursiveBuildAccessibilityTree( - const BrowserAccessibility& node, DictionaryValue* dict) { + const BrowserAccessibility& node, base::DictionaryValue* dict) { AddProperties(node, dict); ListValue* children = new ListValue; @@ -71,22 +71,22 @@ void AccessibilityTreeFormatter::RecursiveBuildAccessibilityTree( for (size_t i = 0; i < node.children().size(); ++i) { BrowserAccessibility* child_node = node.children()[i]; - DictionaryValue* child_dict = new DictionaryValue; + base::DictionaryValue* child_dict = new base::DictionaryValue; children->Append(child_dict); RecursiveBuildAccessibilityTree(*child_node, child_dict); } } void AccessibilityTreeFormatter::RecursiveFormatAccessibilityTree( - const DictionaryValue& dict, string16* contents, int depth) { + const base::DictionaryValue& dict, string16* contents, int depth) { string16 line = ToString(dict, string16(depth * kIndentSpaces, ' ')); if (line.find(ASCIIToUTF16(kSkipString)) != string16::npos) return; *contents += line; - const ListValue* children; + const base::ListValue* children; dict.GetList(kChildrenDictAttr, &children); - const DictionaryValue* child_dict; + const base::DictionaryValue* child_dict; for (size_t i = 0; i < children->GetSize(); i++) { children->GetDictionary(i, &child_dict); RecursiveFormatAccessibilityTree(*child_dict, contents, depth + 1); @@ -102,11 +102,11 @@ bool AccessibilityTreeFormatter::IncludeChildren( #if (!defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_ANDROID)) void AccessibilityTreeFormatter::AddProperties(const BrowserAccessibility& node, - DictionaryValue* dict) { + base::DictionaryValue* dict) { dict->SetInteger("id", node.renderer_id()); } -string16 AccessibilityTreeFormatter::ToString(const DictionaryValue& node, +string16 AccessibilityTreeFormatter::ToString(const base::DictionaryValue& node, const string16& indent) { int id_value; node.GetInteger("id", &id_value); @@ -168,7 +168,7 @@ bool AccessibilityTreeFormatter::MatchesFilters( string16 AccessibilityTreeFormatter::FormatCoordinates( const char* name, const char* x_name, const char* y_name, - const DictionaryValue& value) { + const base::DictionaryValue& value) { int x, y; value.GetInteger(x_name, &x); value.GetInteger(y_name, &y); diff --git a/content/browser/accessibility/accessibility_tree_formatter.h b/content/browser/accessibility/accessibility_tree_formatter.h index 5678b46..3c36b2f 100644 --- a/content/browser/accessibility/accessibility_tree_formatter.h +++ b/content/browser/accessibility/accessibility_tree_formatter.h @@ -49,7 +49,7 @@ class CONTENT_EXPORT AccessibilityTreeFormatter { // "children": [ ] // } ] // } - scoped_ptr<DictionaryValue> BuildAccessibilityTree(); + scoped_ptr<base::DictionaryValue> BuildAccessibilityTree(); // Dumps a BrowserAccessibility tree into a string. void FormatAccessibilityTree(string16* contents); @@ -103,14 +103,15 @@ class CONTENT_EXPORT AccessibilityTreeFormatter { string16* contents, int indent); void RecursiveBuildAccessibilityTree(const BrowserAccessibility& node, - DictionaryValue* tree_node); - void RecursiveFormatAccessibilityTree(const DictionaryValue& tree_node, + base::DictionaryValue* tree_node); + void RecursiveFormatAccessibilityTree(const base::DictionaryValue& tree_node, string16* contents, int depth = 0); // Overridden by each platform to add the required attributes for each node // into the given dict. - void AddProperties(const BrowserAccessibility& node, DictionaryValue* dict); + void AddProperties(const BrowserAccessibility& node, + base::DictionaryValue* dict); // Returns true by default; can be overridden by the platform to // prune some children from the tree when they wouldn't be exposed @@ -120,12 +121,12 @@ class CONTENT_EXPORT AccessibilityTreeFormatter { string16 FormatCoordinates(const char* name, const char* x_name, const char* y_name, - const DictionaryValue& value); + const base::DictionaryValue& value); // Returns a platform specific representation of a BrowserAccessibility. // Should be zero or more complete lines, each with |prefix| prepended // (to indent each line). - string16 ToString(const DictionaryValue& node, const string16& indent); + string16 ToString(const base::DictionaryValue& node, const string16& indent); void Initialize(); diff --git a/content/browser/accessibility/accessibility_tree_formatter_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_mac.mm index 84dbb8d..fda76bfb 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_mac.mm +++ b/content/browser/accessibility/accessibility_tree_formatter_mac.mm @@ -34,8 +34,9 @@ const char* kHeightDictAttr = "height"; const char* kRangeLocDictAttr = "loc"; const char* kRangeLenDictAttr = "len"; -scoped_ptr<DictionaryValue> PopulatePosition(const BrowserAccessibility& node) { - scoped_ptr<DictionaryValue> position(new DictionaryValue); +scoped_ptr<base::DictionaryValue> PopulatePosition( + const BrowserAccessibility& node) { + scoped_ptr<base::DictionaryValue> position(new base::DictionaryValue); // The NSAccessibility position of an object is in global coordinates and // based on the lower-left corner of the object. To make this easier and less // confusing, convert it to local window coordinates using the top-left @@ -59,17 +60,17 @@ scoped_ptr<DictionaryValue> PopulatePosition(const BrowserAccessibility& node) { return position.Pass(); } -scoped_ptr<DictionaryValue> +scoped_ptr<base::DictionaryValue> PopulateSize(const BrowserAccessibilityCocoa* cocoa_node) { - scoped_ptr<DictionaryValue> size(new DictionaryValue); + scoped_ptr<base::DictionaryValue> size(new base::DictionaryValue); NSSize node_size = [[cocoa_node size] sizeValue]; size->SetInteger(kHeightDictAttr, static_cast<int>(node_size.height)); size->SetInteger(kWidthDictAttr, static_cast<int>(node_size.width)); return size.Pass(); } -scoped_ptr<DictionaryValue> PopulateRange(NSRange range) { - scoped_ptr<DictionaryValue> rangeDict(new DictionaryValue); +scoped_ptr<base::DictionaryValue> PopulateRange(NSRange range) { + scoped_ptr<base::DictionaryValue> rangeDict(new base::DictionaryValue); rangeDict->SetInteger(kRangeLocDictAttr, static_cast<int>(range.location)); rangeDict->SetInteger(kRangeLenDictAttr, static_cast<int>(range.length)); return rangeDict.Pass(); @@ -123,7 +124,7 @@ void AccessibilityTreeFormatter::Initialize() { void AccessibilityTreeFormatter::AddProperties(const BrowserAccessibility& node, - DictionaryValue* dict) { + base::DictionaryValue* dict) { BrowserAccessibilityCocoa* cocoa_node = const_cast<BrowserAccessibility*>(&node)->ToBrowserAccessibilityCocoa(); NSArray* supportedAttributes = [cocoa_node accessibilityAttributeNames]; @@ -159,7 +160,7 @@ void AccessibilityTreeFormatter::AddProperties(const BrowserAccessibility& node, dict->Set(kSizeDictAttr, PopulateSize(cocoa_node).release()); } -string16 AccessibilityTreeFormatter::ToString(const DictionaryValue& dict, +string16 AccessibilityTreeFormatter::ToString(const base::DictionaryValue& dict, const string16& indent) { string16 line; NSArray* defaultAttributes = @@ -181,7 +182,7 @@ string16 AccessibilityTreeFormatter::ToString(const DictionaryValue& dict, CR_DEFINE_STATIC_LOCAL(NSArray*, all_attributes, (BuildAllAttributesArray())); for (NSString* requestedAttribute in all_attributes) { string requestedAttributeUTF8 = SysNSStringToUTF8(requestedAttribute); - const DictionaryValue* d_value; + const base::DictionaryValue* d_value; if (dict.GetDictionary(requestedAttributeUTF8, &d_value)) { std::string json_value; base::JSONWriter::Write(d_value, &json_value); @@ -200,7 +201,7 @@ string16 AccessibilityTreeFormatter::ToString(const DictionaryValue& dict, s_value.c_str()), &line); } - const DictionaryValue* d_value = NULL; + const base::DictionaryValue* d_value = NULL; if (dict.GetDictionary(kPositionDictAttr, &d_value)) { WriteAttribute(false, FormatCoordinates(kPositionDictAttr, diff --git a/content/browser/accessibility/accessibility_tree_formatter_win.cc b/content/browser/accessibility/accessibility_tree_formatter_win.cc index 464d130..679843d 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_win.cc +++ b/content/browser/accessibility/accessibility_tree_formatter_win.cc @@ -58,7 +58,7 @@ void AccessibilityTreeFormatter::Initialize() { } void AccessibilityTreeFormatter::AddProperties( - const BrowserAccessibility& node, DictionaryValue* dict) { + const BrowserAccessibility& node, base::DictionaryValue* dict) { BrowserAccessibilityWin* acc_obj = const_cast<BrowserAccessibility*>(&node)->ToBrowserAccessibilityWin(); @@ -86,7 +86,7 @@ void AccessibilityTreeFormatter::AddProperties( IAccessibleStateToStringVector(ia_state, &state_strings); IAccessible2StateToStringVector(acc_obj->ia2_state(), &state_strings); - ListValue* states = new ListValue; + base::ListValue* states = new base::ListValue; for (std::vector<string16>::const_iterator it = state_strings.begin(); it != state_strings.end(); ++it) { @@ -95,7 +95,7 @@ void AccessibilityTreeFormatter::AddProperties( dict->Set("states", states); const std::vector<string16>& ia2_attributes = acc_obj->ia2_attributes(); - ListValue* attributes = new ListValue; + base::ListValue* attributes = new base::ListValue; for (std::vector<string16>::const_iterator it = ia2_attributes.begin(); it != ia2_attributes.end(); ++it) { @@ -141,12 +141,12 @@ void AccessibilityTreeFormatter::AddProperties( && root->ToBrowserAccessibilityWin()->accLocation( &root_left, &root_top, &root_width, &root_height, variant_self) != S_FALSE) { - DictionaryValue* location = new DictionaryValue; + base::DictionaryValue* location = new base::DictionaryValue; location->SetInteger("x", left - root_left); location->SetInteger("y", top - root_top); dict->Set("location", location); - DictionaryValue* size = new DictionaryValue; + base::DictionaryValue* size = new base::DictionaryValue; size->SetInteger("width", width); size->SetInteger("height", height); dict->Set("size", size); @@ -199,7 +199,7 @@ void AccessibilityTreeFormatter::AddProperties( } } -string16 AccessibilityTreeFormatter::ToString(const DictionaryValue& dict, +string16 AccessibilityTreeFormatter::ToString(const base::DictionaryValue& dict, const string16& indent) { string16 line; @@ -214,12 +214,12 @@ string16 AccessibilityTreeFormatter::ToString(const DictionaryValue& dict, for (int i = 0; i < arraysize(ALL_ATTRIBUTES); i++) { const char* attribute_name = ALL_ATTRIBUTES[i]; - const Value* value; + const base::Value* value; if (!dict.Get(attribute_name, &value)) continue; switch (value->GetType()) { - case Value::TYPE_STRING: { + case base::Value::TYPE_STRING: { string16 string_value; value->GetAsString(&string_value); WriteAttribute(false, @@ -229,7 +229,7 @@ string16 AccessibilityTreeFormatter::ToString(const DictionaryValue& dict, &line); break; } - case Value::TYPE_INTEGER: { + case base::Value::TYPE_INTEGER: { int int_value; value->GetAsInteger(&int_value); WriteAttribute(false, @@ -239,7 +239,7 @@ string16 AccessibilityTreeFormatter::ToString(const DictionaryValue& dict, &line); break; } - case Value::TYPE_DOUBLE: { + case base::Value::TYPE_DOUBLE: { double double_value; value->GetAsDouble(&double_value); WriteAttribute(false, @@ -249,12 +249,12 @@ string16 AccessibilityTreeFormatter::ToString(const DictionaryValue& dict, &line); break; } - case Value::TYPE_LIST: { + case base::Value::TYPE_LIST: { // Currently all list values are string and are written without // attribute names. - const ListValue* list_value; + const base::ListValue* list_value; value->GetAsList(&list_value); - for (ListValue::const_iterator it = list_value->begin(); + for (base::ListValue::const_iterator it = list_value->begin(); it != list_value->end(); ++it) { string16 string_value; @@ -263,10 +263,10 @@ string16 AccessibilityTreeFormatter::ToString(const DictionaryValue& dict, } break; } - case Value::TYPE_DICTIONARY: { + case base::Value::TYPE_DICTIONARY: { // Currently all dictionary values are coordinates. // Revisit this if that changes. - const DictionaryValue* dict_value; + const base::DictionaryValue* dict_value; value->GetAsDictionary(&dict_value); if (strcmp(attribute_name, "size") == 0) { WriteAttribute(false, diff --git a/content/browser/accessibility/accessibility_ui.cc b/content/browser/accessibility/accessibility_ui.cc index d519d1c..f4044b6 100644 --- a/content/browser/accessibility/accessibility_ui.cc +++ b/content/browser/accessibility/accessibility_ui.cc @@ -28,9 +28,6 @@ #include "grit/content_resources.h" #include "net/base/escape.h" -using base::FundamentalValue; -using base::ListValue; - static const char kDataFile[] = "targets-data.json"; static const char kProcessIdField[] = "processId"; @@ -45,7 +42,7 @@ namespace content { namespace { -DictionaryValue* BuildTargetDescriptor( +base::DictionaryValue* BuildTargetDescriptor( const GURL& url, const std::string& name, const GURL& favicon_url, @@ -53,7 +50,7 @@ DictionaryValue* BuildTargetDescriptor( int route_id, AccessibilityMode accessibility_mode, base::ProcessHandle handle = base::kNullProcessHandle) { - DictionaryValue* target_data = new DictionaryValue(); + base::DictionaryValue* target_data = new base::DictionaryValue(); target_data->SetInteger(kProcessIdField, process_id); target_data->SetInteger(kRouteIdField, route_id); target_data->SetString(kUrlField, url.spec()); @@ -65,7 +62,7 @@ DictionaryValue* BuildTargetDescriptor( return target_data; } -DictionaryValue* BuildTargetDescriptor(RenderViewHost* rvh) { +base::DictionaryValue* BuildTargetDescriptor(RenderViewHost* rvh) { WebContents* web_contents = WebContents::FromRenderViewHost(rvh); std::string title; RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rvh); @@ -92,7 +89,7 @@ DictionaryValue* BuildTargetDescriptor(RenderViewHost* rvh) { void SendTargetsData( const WebUIDataSource::GotDataCallback& callback) { - scoped_ptr<ListValue> rvh_list(new ListValue()); + scoped_ptr<base::ListValue> rvh_list(new base::ListValue()); for (RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator()); !it.IsAtEnd(); it.Advance()) { @@ -118,9 +115,9 @@ void SendTargetsData( } } - scoped_ptr<DictionaryValue> data(new DictionaryValue()); + scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); data->Set("list", rvh_list.release()); - scoped_ptr<FundamentalValue> a11y_mode(new FundamentalValue( + scoped_ptr<base::FundamentalValue> a11y_mode(new base::FundamentalValue( BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode())); data->Set("global_a11y_mode", a11y_mode.release()); @@ -225,19 +222,20 @@ void AccessibilityUI::RequestAccessibilityTree(const base::ListValue* args) { RenderViewHost* rvh = RenderViewHost::FromID(process_id, route_id); if (!rvh) { - scoped_ptr<DictionaryValue> result(new DictionaryValue()); + scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue()); result->SetInteger(kProcessIdField, process_id); result->SetInteger(kRouteIdField, route_id); - result->Set("error", new StringValue("Renderer no longer exists.")); + result->Set("error", new base::StringValue("Renderer no longer exists.")); web_ui()->CallJavascriptFunction("accessibility.showTree", *(result.get())); return; } - scoped_ptr<DictionaryValue> result(BuildTargetDescriptor(rvh)); + scoped_ptr<base::DictionaryValue> result(BuildTargetDescriptor(rvh)); RenderWidgetHostViewPort* host_view = static_cast<RenderWidgetHostViewPort*>( WebContents::FromRenderViewHost(rvh)->GetRenderWidgetHostView()); if (!host_view) { - result->Set("error", new StringValue("Could not get accessibility tree.")); + result->Set("error", + new base::StringValue("Could not get accessibility tree.")); web_ui()->CallJavascriptFunction("accessibility.showTree", *(result.get())); return; } @@ -247,7 +245,8 @@ void AccessibilityUI::RequestAccessibilityTree(const base::ListValue* args) { BrowserAccessibilityManager* manager = host_view->GetBrowserAccessibilityManager(); if (!manager) { - result->Set("error", new StringValue("Could not get accessibility tree.")); + result->Set("error", + new base::StringValue("Could not get accessibility tree.")); web_ui()->CallJavascriptFunction("accessibility.showTree", *(result.get())); return; } @@ -259,7 +258,7 @@ void AccessibilityUI::RequestAccessibilityTree(const base::ListValue* args) { formatter->FormatAccessibilityTree(&accessibility_contents_utf16); result->Set("tree", - new StringValue(UTF16ToUTF8(accessibility_contents_utf16))); + new base::StringValue(UTF16ToUTF8(accessibility_contents_utf16))); web_ui()->CallJavascriptFunction("accessibility.showTree", *(result.get())); } diff --git a/content/browser/devtools/devtools_http_handler_impl.cc b/content/browser/devtools/devtools_http_handler_impl.cc index f176025..e39ca37 100644 --- a/content/browser/devtools/devtools_http_handler_impl.cc +++ b/content/browser/devtools/devtools_http_handler_impl.cc @@ -110,7 +110,7 @@ class DevToolsClientHostImpl : public DevToolsClientHost { return; is_closed_ = true; - DictionaryValue notification; + base::DictionaryValue notification; notification.SetString( devtools::Inspector::detached::kParamReason, detach_reason_); std::string response = DevToolsProtocol::CreateNotification( @@ -575,7 +575,7 @@ void DevToolsHttpHandlerImpl::OnJsonRequestUI( return; } -void DevToolsHttpHandlerImpl::CollectWorkerInfo(ListValue* target_list, +void DevToolsHttpHandlerImpl::CollectWorkerInfo(base::ListValue* target_list, std::string host) { std::vector<WorkerService::WorkerInfo> worker_info = @@ -586,7 +586,7 @@ void DevToolsHttpHandlerImpl::CollectWorkerInfo(ListValue* target_list, } void DevToolsHttpHandlerImpl::SendTargetList(int connection_id, - ListValue* target_list) { + base::ListValue* target_list) { SendJson(connection_id, net::HTTP_OK, target_list, std::string()); delete target_list; Release(); // Balanced OnJsonRequestUI. diff --git a/content/browser/devtools/devtools_netlog_observer.cc b/content/browser/devtools/devtools_netlog_observer.cc index 37ca208..d56f23d 100644 --- a/content/browser/devtools/devtools_netlog_observer.cc +++ b/content/browser/devtools/devtools_netlog_observer.cc @@ -59,7 +59,7 @@ void DevToolsNetLogObserver::OnAddURLRequestEntry( if (entry.type() == net::NetLog::TYPE_URL_REQUEST_START_JOB) { if (is_begin) { int load_flags; - scoped_ptr<Value> event_param(entry.ParametersToValue()); + scoped_ptr<base::Value> event_param(entry.ParametersToValue()); if (!net::StartEventLoadFlagsFromEventParams(event_param.get(), &load_flags)) { return; @@ -100,7 +100,7 @@ void DevToolsNetLogObserver::OnAddURLRequestEntry( switch (entry.type()) { case net::NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_HEADERS: { - scoped_ptr<Value> event_params(entry.ParametersToValue()); + scoped_ptr<base::Value> event_params(entry.ParametersToValue()); std::string request_line; net::HttpRequestHeaders request_headers; @@ -122,7 +122,7 @@ void DevToolsNetLogObserver::OnAddURLRequestEntry( break; } case net::NetLog::TYPE_HTTP_TRANSACTION_SPDY_SEND_REQUEST_HEADERS: { - scoped_ptr<Value> event_params(entry.ParametersToValue()); + scoped_ptr<base::Value> event_params(entry.ParametersToValue()); net::SpdyHeaderBlock request_headers; if (!net::SpdyHeaderBlockFromNetLogParam(event_params.get(), @@ -142,7 +142,7 @@ void DevToolsNetLogObserver::OnAddURLRequestEntry( break; } case net::NetLog::TYPE_HTTP_TRANSACTION_READ_RESPONSE_HEADERS: { - scoped_ptr<Value> event_params(entry.ParametersToValue()); + scoped_ptr<base::Value> event_params(entry.ParametersToValue()); scoped_refptr<net::HttpResponseHeaders> response_headers; @@ -169,7 +169,7 @@ void DevToolsNetLogObserver::OnAddURLRequestEntry( break; } case net::NetLog::TYPE_HTTP_STREAM_REQUEST_BOUND_TO_JOB: { - scoped_ptr<Value> event_params(entry.ParametersToValue()); + scoped_ptr<base::Value> event_params(entry.ParametersToValue()); net::NetLog::Source http_stream_job_source; if (!net::NetLog::Source::FromEventParameters(event_params.get(), &http_stream_job_source)) { @@ -204,7 +204,7 @@ void DevToolsNetLogObserver::OnAddHTTPStreamJobEntry( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (entry.type() == net::NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET) { - scoped_ptr<Value> event_params(entry.ParametersToValue()); + scoped_ptr<base::Value> event_params(entry.ParametersToValue()); net::NetLog::Source socket_source; if (!net::NetLog::Source::FromEventParameters(event_params.get(), &socket_source)) { @@ -248,11 +248,12 @@ void DevToolsNetLogObserver::OnAddSocketEntry( if (net::NetLog::TYPE_SOCKET_BYTES_RECEIVED == entry.type()) { int byte_count = 0; - scoped_ptr<Value> value(entry.ParametersToValue()); - if (!value->IsType(Value::TYPE_DICTIONARY)) + scoped_ptr<base::Value> value(entry.ParametersToValue()); + if (!value->IsType(base::Value::TYPE_DICTIONARY)) return; - DictionaryValue* dValue = static_cast<DictionaryValue*>(value.get()); + base::DictionaryValue* dValue = + static_cast<base::DictionaryValue*>(value.get()); if (!dValue->GetInteger("byte_count", &byte_count)) return; diff --git a/content/browser/devtools/devtools_protocol.cc b/content/browser/devtools/devtools_protocol.cc index 829f44e..e7dbe39 100644 --- a/content/browser/devtools/devtools_protocol.cc +++ b/content/browser/devtools/devtools_protocol.cc @@ -32,14 +32,13 @@ enum Error { } // namespace -using base::DictionaryValue; using base::Value; DevToolsProtocol::Message::~Message() { } DevToolsProtocol::Message::Message(const std::string& method, - DictionaryValue* params) + base::DictionaryValue* params) : method_(method), params_(params) { size_t pos = method.find("."); @@ -51,7 +50,7 @@ DevToolsProtocol::Command::~Command() { } std::string DevToolsProtocol::Command::Serialize() { - DictionaryValue command; + base::DictionaryValue command; command.SetInteger(kIdParam, id_); command.SetString(kMethodParam, method_); if (params_) @@ -63,7 +62,7 @@ std::string DevToolsProtocol::Command::Serialize() { } scoped_ptr<DevToolsProtocol::Response> -DevToolsProtocol::Command::SuccessResponse(DictionaryValue* result) { +DevToolsProtocol::Command::SuccessResponse(base::DictionaryValue* result) { return scoped_ptr<DevToolsProtocol::Response>( new DevToolsProtocol::Response(id_, result)); } @@ -90,19 +89,19 @@ DevToolsProtocol::Command::NoSuchMethodErrorResponse() { DevToolsProtocol::Command::Command(int id, const std::string& method, - DictionaryValue* params) + base::DictionaryValue* params) : Message(method, params), id_(id) { } std::string DevToolsProtocol::Response::Serialize() { - DictionaryValue response; + base::DictionaryValue response; if (id_ != kNoId) response.SetInteger(kIdParam, id_); if (error_code_) { - DictionaryValue* error_object = new DictionaryValue(); + base::DictionaryValue* error_object = new base::DictionaryValue(); response.Set(kErrorParam, error_object); error_object->SetInteger(kErrorCodeParam, error_code_); if (!error_message_.empty()) @@ -116,7 +115,7 @@ std::string DevToolsProtocol::Response::Serialize() { return json_response; } -DevToolsProtocol::Response::Response(int id, DictionaryValue* result) +DevToolsProtocol::Response::Response(int id, base::DictionaryValue* result) : id_(id), result_(result), error_code_(0) { @@ -131,7 +130,7 @@ DevToolsProtocol::Response::~Response() { } DevToolsProtocol::Notification::Notification(const std::string& method, - DictionaryValue* params) + base::DictionaryValue* params) : Message(method, params) { } @@ -139,7 +138,7 @@ DevToolsProtocol::Notification::~Notification() { } std::string DevToolsProtocol::Notification::Serialize() { - DictionaryValue notification; + base::DictionaryValue notification; notification.SetString(kMethodParam, method_); if (params_) notification.Set(kParamsParam, params_->DeepCopy()); @@ -176,13 +175,13 @@ void DevToolsProtocol::Handler::RegisterCommandHandler( void DevToolsProtocol::Handler::SendNotification( const std::string& method, - DictionaryValue* params) { + base::DictionaryValue* params) { DevToolsProtocol::Notification notification(method, params); if (!notifier_.is_null()) notifier_.Run(notification.Serialize()); } -static bool ParseMethod(DictionaryValue* command, +static bool ParseMethod(base::DictionaryValue* command, std::string* method) { if (!command->GetString(kMethodParam, method)) return false; @@ -196,7 +195,8 @@ static bool ParseMethod(DictionaryValue* command, DevToolsProtocol::Command* DevToolsProtocol::ParseCommand( const std::string& json, std::string* error_response) { - scoped_ptr<DictionaryValue> command_dict(ParseMessage(json, error_response)); + scoped_ptr<base::DictionaryValue> command_dict( + ParseMessage(json, error_response)); if (!command_dict) return NULL; @@ -210,7 +210,7 @@ DevToolsProtocol::Command* DevToolsProtocol::ParseCommand( return NULL; } - DictionaryValue* params = NULL; + base::DictionaryValue* params = NULL; command_dict->GetDictionary(kParamsParam, ¶ms); return new Command(id, method, params ? params->DeepCopy() : NULL); } @@ -218,7 +218,7 @@ DevToolsProtocol::Command* DevToolsProtocol::ParseCommand( // static DevToolsProtocol::Notification* DevToolsProtocol::ParseNotification(const std::string& json) { - scoped_ptr<DictionaryValue> dict(ParseMessage(json, NULL)); + scoped_ptr<base::DictionaryValue> dict(ParseMessage(json, NULL)); if (!dict) return NULL; @@ -227,7 +227,7 @@ DevToolsProtocol::ParseNotification(const std::string& json) { if (!ok) return NULL; - DictionaryValue* params = NULL; + base::DictionaryValue* params = NULL; dict->GetDictionary(kParamsParam, ¶ms); return new Notification(method, params ? params->DeepCopy() : NULL); } @@ -235,12 +235,12 @@ DevToolsProtocol::ParseNotification(const std::string& json) { //static DevToolsProtocol::Notification* DevToolsProtocol::CreateNotification( const std::string& method, - DictionaryValue* params) { + base::DictionaryValue* params) { return new Notification(method, params); } // static -DictionaryValue* DevToolsProtocol::ParseMessage( +base::DictionaryValue* DevToolsProtocol::ParseMessage( const std::string& json, std::string* error_response) { int parse_error_code; @@ -256,7 +256,7 @@ DictionaryValue* DevToolsProtocol::ParseMessage( return NULL; } - return static_cast<DictionaryValue*>(message.release()); + return static_cast<base::DictionaryValue*>(message.release()); } } // namespace content diff --git a/content/browser/download/download_net_log_parameters.cc b/content/browser/download/download_net_log_parameters.cc index 87c378d..4c204fe 100644 --- a/content/browser/download/download_net_log_parameters.cc +++ b/content/browser/download/download_net_log_parameters.cc @@ -46,7 +46,7 @@ base::Value* ItemActivatedNetLogCallback( DownloadType download_type, const std::string* file_name, net::NetLog::LogLevel log_level) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("type", download_type_names[download_type]); dict->SetString("id", base::Int64ToString(download_item->GetId())); @@ -65,7 +65,7 @@ base::Value* ItemActivatedNetLogCallback( base::Value* ItemCheckedNetLogCallback( DownloadDangerType danger_type, net::NetLog::LogLevel log_level) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("danger_type", download_danger_names[danger_type]); @@ -75,7 +75,7 @@ base::Value* ItemCheckedNetLogCallback( base::Value* ItemRenamedNetLogCallback(const base::FilePath* old_filename, const base::FilePath* new_filename, net::NetLog::LogLevel log_level) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("old_filename", old_filename->AsUTF8Unsafe()); dict->SetString("new_filename", new_filename->AsUTF8Unsafe()); @@ -87,7 +87,7 @@ base::Value* ItemInterruptedNetLogCallback(DownloadInterruptReason reason, int64 bytes_so_far, const std::string* hash_state, net::NetLog::LogLevel log_level) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("interrupt_reason", InterruptReasonDebugString(reason)); dict->SetString("bytes_so_far", base::Int64ToString(bytes_so_far)); @@ -102,7 +102,7 @@ base::Value* ItemResumingNetLogCallback(bool user_initiated, int64 bytes_so_far, const std::string* hash_state, net::NetLog::LogLevel log_level) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("user_initiated", user_initiated ? "true" : "false"); dict->SetString("interrupt_reason", InterruptReasonDebugString(reason)); @@ -116,7 +116,7 @@ base::Value* ItemResumingNetLogCallback(bool user_initiated, base::Value* ItemCompletingNetLogCallback(int64 bytes_so_far, const std::string* final_hash, net::NetLog::LogLevel log_level) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("bytes_so_far", base::Int64ToString(bytes_so_far)); dict->SetString("final_hash", @@ -127,7 +127,7 @@ base::Value* ItemCompletingNetLogCallback(int64 bytes_so_far, base::Value* ItemFinishedNetLogCallback(bool auto_opened, net::NetLog::LogLevel log_level) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("auto_opened", auto_opened ? "yes" : "no"); @@ -137,7 +137,7 @@ base::Value* ItemFinishedNetLogCallback(bool auto_opened, base::Value* ItemCanceledNetLogCallback(int64 bytes_so_far, const std::string* hash_state, net::NetLog::LogLevel log_level) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("bytes_so_far", base::Int64ToString(bytes_so_far)); dict->SetString("hash_state", @@ -149,7 +149,7 @@ base::Value* ItemCanceledNetLogCallback(int64 bytes_so_far, base::Value* FileOpenedNetLogCallback(const base::FilePath* file_name, int64 start_offset, net::NetLog::LogLevel log_level) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("file_name", file_name->AsUTF8Unsafe()); dict->SetString("start_offset", base::Int64ToString(start_offset)); @@ -160,7 +160,7 @@ base::Value* FileOpenedNetLogCallback(const base::FilePath* file_name, base::Value* FileStreamDrainedNetLogCallback(size_t stream_size, size_t num_buffers, net::NetLog::LogLevel log_level) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetInteger("stream_size", static_cast<int>(stream_size)); dict->SetInteger("num_buffers", static_cast<int>(num_buffers)); @@ -171,7 +171,7 @@ base::Value* FileStreamDrainedNetLogCallback(size_t stream_size, base::Value* FileRenamedNetLogCallback(const base::FilePath* old_filename, const base::FilePath* new_filename, net::NetLog::LogLevel log_level) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("old_filename", old_filename->AsUTF8Unsafe()); dict->SetString("new_filename", new_filename->AsUTF8Unsafe()); @@ -182,7 +182,7 @@ base::Value* FileRenamedNetLogCallback(const base::FilePath* old_filename, base::Value* FileErrorNetLogCallback(const char* operation, net::Error net_error, net::NetLog::LogLevel log_level) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("operation", operation); dict->SetInteger("net_error", net_error); @@ -194,7 +194,7 @@ base::Value* FileInterruptedNetLogCallback(const char* operation, int os_error, DownloadInterruptReason reason, net::NetLog::LogLevel log_level) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("operation", operation); if (os_error != 0) @@ -204,5 +204,4 @@ base::Value* FileInterruptedNetLogCallback(const char* operation, return dict; } - } // namespace content diff --git a/content/browser/geolocation/network_location_request.cc b/content/browser/geolocation/network_location_request.cc index 519728a..74a77e1 100644 --- a/content/browser/geolocation/network_location_request.cc +++ b/content/browser/geolocation/network_location_request.cc @@ -297,7 +297,7 @@ bool GetAsDouble(const base::DictionaryValue& object, const std::string& property_name, double* out) { DCHECK(out); - const Value* value = NULL; + const base::Value* value = NULL; if (!object.Get(property_name, &value)) return false; int value_as_int; @@ -327,7 +327,7 @@ bool ParseServerResponse(const std::string& response_body, // Parse the response, ignoring comments. std::string error_msg; - scoped_ptr<Value> response_value(base::JSONReader::ReadAndReturnError( + scoped_ptr<base::Value> response_value(base::JSONReader::ReadAndReturnError( response_body, base::JSON_PARSE_RFC, NULL, &error_msg)); if (response_value == NULL) { LOG(WARNING) << "ParseServerResponse() : JSONReader failed : " @@ -335,7 +335,7 @@ bool ParseServerResponse(const std::string& response_body, return false; } - if (!response_value->IsType(Value::TYPE_DICTIONARY)) { + if (!response_value->IsType(base::Value::TYPE_DICTIONARY)) { VLOG(1) << "ParseServerResponse() : Unexpected response type " << response_value->GetType(); return false; @@ -347,7 +347,7 @@ bool ParseServerResponse(const std::string& response_body, response_object->GetString(kAccessTokenString, access_token); // Get the location - const Value* location_value = NULL; + const base::Value* location_value = NULL; if (!response_object->Get(kLocationString, &location_value)) { VLOG(1) << "ParseServerResponse() : Missing location attribute."; // GLS returns a response with no location property to represent @@ -356,8 +356,8 @@ bool ParseServerResponse(const std::string& response_body, } DCHECK(location_value); - if (!location_value->IsType(Value::TYPE_DICTIONARY)) { - if (!location_value->IsType(Value::TYPE_NULL)) { + if (!location_value->IsType(base::Value::TYPE_DICTIONARY)) { + if (!location_value->IsType(base::Value::TYPE_NULL)) { VLOG(1) << "ParseServerResponse() : Unexpected location type " << location_value->GetType(); // If the network provider was unable to provide a position fix, it should diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc index d0f853b..7c8ea05 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -847,7 +847,7 @@ void GpuDataManagerImplPrivate::GetDriverBugWorkarounds( void GpuDataManagerImplPrivate::AddLogMessage( int level, const std::string& header, const std::string& message) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetInteger("level", level); dict->SetString("header", header); dict->SetString("message", message); diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc index 9785248..e3da336 100644 --- a/content/browser/gpu/gpu_internals_ui.cc +++ b/content/browser/gpu/gpu_internals_ui.cc @@ -66,7 +66,7 @@ base::DictionaryValue* NewDescriptionValuePair(const std::string& desc, } base::DictionaryValue* NewDescriptionValuePair(const std::string& desc, - Value* value) { + base::Value* value) { base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("description", desc); dict->Set("value", value); @@ -83,7 +83,7 @@ base::Value* NewStatusValue(const char* name, const char* status) { #if defined(OS_WIN) // Output DxDiagNode tree as nested array of {description,value} pairs base::ListValue* DxDiagNodeToList(const gpu::DxDiagNode& node) { - base::ListValue* list = new ListValue(); + base::ListValue* list = new base::ListValue(); for (std::map<std::string, std::string>::const_iterator it = node.values.begin(); it != node.values.end(); diff --git a/content/browser/indexed_db/indexed_db_internals_ui.cc b/content/browser/indexed_db/indexed_db_internals_ui.cc index 2ec1b5b..2e34138 100644 --- a/content/browser/indexed_db/indexed_db_internals_ui.cc +++ b/content/browser/indexed_db/indexed_db_internals_ui.cc @@ -127,7 +127,7 @@ void IndexedDBInternalsUI::OnOriginsReady( for (std::vector<IndexedDBInfo>::const_iterator iter = origins->begin(); iter != origins->end(); ++iter) { - base::DictionaryValue* info = new DictionaryValue; + base::DictionaryValue* info = new base::DictionaryValue; info->SetString("url", iter->origin_.spec()); info->SetDouble("size", iter->size_); info->SetDouble("last_modified", iter->last_modified_.ToJsTime()); diff --git a/content/browser/media/media_internals.h b/content/browser/media/media_internals.h index 73deaad5..4a4d2ef 100644 --- a/content/browser/media/media_internals.h +++ b/content/browser/media/media_internals.h @@ -71,7 +71,7 @@ class CONTENT_EXPORT MediaInternals { // (host, stream_id) is a unique id for the audio stream. // |host| will never be dereferenced. void UpdateAudioStream(void* host, int stream_id, - const std::string& property, Value* value); + const std::string& property, base::Value* value); // Removes |item| from |data_|. void DeleteItem(const std::string& item); @@ -79,12 +79,12 @@ class CONTENT_EXPORT MediaInternals { // Sets data_.id.property = value and notifies attached UIs using update_fn. // id may be any depth, e.g. "video.decoders.1.2.3" void UpdateItem(const std::string& update_fn, const std::string& id, - const std::string& property, Value* value); + const std::string& property, base::Value* value); // Calls javascript |function|(|value|) on each attached UI. - void SendUpdate(const std::string& function, Value* value); + void SendUpdate(const std::string& function, base::Value* value); - DictionaryValue data_; + base::DictionaryValue data_; std::vector<UpdateCallback> update_callbacks_; diff --git a/content/browser/media/webrtc_internals.cc b/content/browser/media/webrtc_internals.cc index efdba58..f8bcdc3 100644 --- a/content/browser/media/webrtc_internals.cc +++ b/content/browser/media/webrtc_internals.cc @@ -11,8 +11,6 @@ #include "content/public/browser/notification_types.h" #include "content/public/browser/render_process_host.h" -using base::DictionaryValue; -using base::ListValue; using base::ProcessId; using std::string; @@ -20,10 +18,10 @@ namespace content { namespace { // Makes sure that |dict| has a ListValue under path "log". -static ListValue* EnsureLogList(DictionaryValue* dict) { - ListValue* log = NULL; +static base::ListValue* EnsureLogList(base::DictionaryValue* dict) { + base::ListValue* log = NULL; if (!dict->GetList("log", &log)) { - log = new ListValue(); + log = new base::ListValue(); if (log) dict->Set("log", log); } @@ -55,7 +53,7 @@ void WebRTCInternals::OnAddPeerConnection(int render_process_id, const string& constraints) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); if (!dict) return; @@ -74,7 +72,7 @@ void WebRTCInternals::OnAddPeerConnection(int render_process_id, void WebRTCInternals::OnRemovePeerConnection(ProcessId pid, int lid) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); for (size_t i = 0; i < peer_connection_data_.GetSize(); ++i) { - DictionaryValue* dict = NULL; + base::DictionaryValue* dict = NULL; peer_connection_data_.GetDictionary(i, &dict); int this_pid = 0; @@ -88,7 +86,7 @@ void WebRTCInternals::OnRemovePeerConnection(ProcessId pid, int lid) { peer_connection_data_.Remove(i, NULL); if (observers_.size() > 0) { - DictionaryValue id; + base::DictionaryValue id; id.SetInteger("pid", static_cast<int>(pid)); id.SetInteger("lid", lid); SendUpdate("removePeerConnection", &id); @@ -102,7 +100,7 @@ void WebRTCInternals::OnUpdatePeerConnection( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); for (size_t i = 0; i < peer_connection_data_.GetSize(); ++i) { - DictionaryValue* record = NULL; + base::DictionaryValue* record = NULL; peer_connection_data_.GetDictionary(i, &record); int this_pid = 0, this_lid = 0; @@ -113,11 +111,11 @@ void WebRTCInternals::OnUpdatePeerConnection( continue; // Append the update to the end of the log. - ListValue* log = EnsureLogList(record); + base::ListValue* log = EnsureLogList(record); if (!log) return; - DictionaryValue* log_entry = new DictionaryValue(); + base::DictionaryValue* log_entry = new base::DictionaryValue(); if (!log_entry) return; @@ -126,7 +124,7 @@ void WebRTCInternals::OnUpdatePeerConnection( log->Append(log_entry); if (observers_.size() > 0) { - DictionaryValue update; + base::DictionaryValue update; update.SetInteger("pid", static_cast<int>(pid)); update.SetInteger("lid", lid); update.SetString("type", type); @@ -143,11 +141,11 @@ void WebRTCInternals::OnAddStats(base::ProcessId pid, int lid, if (observers_.size() == 0) return; - DictionaryValue dict; + base::DictionaryValue dict; dict.SetInteger("pid", static_cast<int>(pid)); dict.SetInteger("lid", lid); - ListValue* list = value.DeepCopy(); + base::ListValue* list = value.DeepCopy(); if (!list) return; @@ -185,7 +183,7 @@ void WebRTCInternals::StopRtpRecording() { } } -void WebRTCInternals::SendUpdate(const string& command, Value* value) { +void WebRTCInternals::SendUpdate(const string& command, base::Value* value) { DCHECK_GT(observers_.size(), (size_t)0); FOR_EACH_OBSERVER(WebRTCInternalsUIObserver, @@ -211,7 +209,7 @@ void WebRTCInternals::OnRendererExit(int render_process_id) { // Iterates from the end of the list to remove the PeerConnections created // by the exitting renderer. for (int i = peer_connection_data_.GetSize() - 1; i >= 0; --i) { - DictionaryValue* record = NULL; + base::DictionaryValue* record = NULL; peer_connection_data_.GetDictionary(i, &record); int this_rid = 0; @@ -223,7 +221,7 @@ void WebRTCInternals::OnRendererExit(int render_process_id) { record->GetInteger("lid", &lid); record->GetInteger("pid", &pid); - DictionaryValue update; + base::DictionaryValue update; update.SetInteger("lid", lid); update.SetInteger("pid", pid); SendUpdate("removePeerConnection", &update); @@ -237,7 +235,7 @@ void WebRTCInternals::OnRendererExit(int render_process_id) { // UI. void WebRTCInternals::SendRtpRecordingUpdate() { DCHECK(is_recording_rtp_); - DictionaryValue update; + base::DictionaryValue update; // TODO(justinlin): Fill in |update| with values as appropriate. SendUpdate("updateDumpStatus", &update); } diff --git a/content/browser/media/webrtc_internals_browsertest.cc b/content/browser/media/webrtc_internals_browsertest.cc index 85309cb..816b595 100644 --- a/content/browser/media/webrtc_internals_browsertest.cc +++ b/content/browser/media/webrtc_internals_browsertest.cc @@ -331,60 +331,64 @@ class WebRTCInternalsBrowserTest: public ContentBrowserTest { // Verifies |dump| contains |peer_connection_number| peer connection dumps, // each containing |update_number| updates and |stats_number| stats tables. - void VerifyPageDumpStructure(Value* dump, + void VerifyPageDumpStructure(base::Value* dump, int peer_connection_number, int update_number, int stats_number) { - EXPECT_NE((Value*)NULL, dump); - EXPECT_EQ(Value::TYPE_DICTIONARY, dump->GetType()); + EXPECT_NE((base::Value*)NULL, dump); + EXPECT_EQ(base::Value::TYPE_DICTIONARY, dump->GetType()); - DictionaryValue* dict_dump = static_cast<DictionaryValue*>(dump); + base::DictionaryValue* dict_dump = + static_cast<base::DictionaryValue*>(dump); EXPECT_EQ((size_t) peer_connection_number, dict_dump->size()); - DictionaryValue::Iterator it(*dict_dump); + base::DictionaryValue::Iterator it(*dict_dump); for (; !it.IsAtEnd(); it.Advance()) { - Value* value = NULL; + base::Value* value = NULL; dict_dump->Get(it.key(), &value); - EXPECT_EQ(Value::TYPE_DICTIONARY, value->GetType()); - DictionaryValue* pc_dump = static_cast<DictionaryValue*>(value); + EXPECT_EQ(base::Value::TYPE_DICTIONARY, value->GetType()); + base::DictionaryValue* pc_dump = + static_cast<base::DictionaryValue*>(value); EXPECT_TRUE(pc_dump->HasKey("updateLog")); EXPECT_TRUE(pc_dump->HasKey("stats")); // Verifies the number of updates. pc_dump->Get("updateLog", &value); - EXPECT_EQ(Value::TYPE_LIST, value->GetType()); - ListValue* list = static_cast<ListValue*>(value); + EXPECT_EQ(base::Value::TYPE_LIST, value->GetType()); + base::ListValue* list = static_cast<base::ListValue*>(value); EXPECT_EQ((size_t) update_number, list->GetSize()); // Verifies the number of stats tables. pc_dump->Get("stats", &value); - EXPECT_EQ(Value::TYPE_DICTIONARY, value->GetType()); - DictionaryValue* dict = static_cast<DictionaryValue*>(value); + EXPECT_EQ(base::Value::TYPE_DICTIONARY, value->GetType()); + base::DictionaryValue* dict = static_cast<base::DictionaryValue*>(value); EXPECT_EQ((size_t) stats_number, dict->size()); } } // Verifies |dump| contains the correct statsTable and statsDataSeries for // |pc|. - void VerifyStatsDump(Value* dump, + void VerifyStatsDump(base::Value* dump, const PeerConnectionEntry& pc, const string& report_type, const string& report_id, const StatsUnit& stats) { - EXPECT_NE((Value*)NULL, dump); - EXPECT_EQ(Value::TYPE_DICTIONARY, dump->GetType()); + EXPECT_NE((base::Value*)NULL, dump); + EXPECT_EQ(base::Value::TYPE_DICTIONARY, dump->GetType()); - DictionaryValue* dict_dump = static_cast<DictionaryValue*>(dump); - Value* value = NULL; + base::DictionaryValue* dict_dump = + static_cast<base::DictionaryValue*>(dump); + base::Value* value = NULL; dict_dump->Get(pc.getIdString(), &value); - DictionaryValue* pc_dump = static_cast<DictionaryValue*>(value); + base::DictionaryValue* pc_dump = static_cast<base::DictionaryValue*>(value); // Verifies there is one data series per stats name. value = NULL; pc_dump->Get("stats", &value); - EXPECT_EQ(Value::TYPE_DICTIONARY, value->GetType()); + EXPECT_EQ(base::Value::TYPE_DICTIONARY, value->GetType()); - DictionaryValue* dataSeries = static_cast<DictionaryValue*>(value); + base::DictionaryValue* dataSeries = + static_cast<base::DictionaryValue*>(value); EXPECT_EQ(stats.values.size(), dataSeries->size()); } }; @@ -681,7 +685,7 @@ IN_PROC_BROWSER_TEST_F(WebRTCInternalsBrowserTest, CreatePageDump) { "window.domAutomationController.send(" "JSON.stringify(peerConnectionDataStore));", &dump_json)); - scoped_ptr<Value> dump; + scoped_ptr<base::Value> dump; dump.reset(base::JSONReader::Read(dump_json)); VerifyPageDumpStructure(dump.get(), 2 /*peer_connection_number*/, diff --git a/content/browser/media/webrtc_internals_unittest.cc b/content/browser/media/webrtc_internals_unittest.cc index 58c7d8d..3078db9c 100644 --- a/content/browser/media/webrtc_internals_unittest.cc +++ b/content/browser/media/webrtc_internals_unittest.cc @@ -10,35 +10,33 @@ #include "content/public/test/test_browser_thread.h" #include "testing/gtest/include/gtest/gtest.h" -using base::Value; -using base::DictionaryValue; -using std::string; - namespace content { namespace { -static const string kContraints = "c"; -static const string kServers = "s"; -static const string kUrl = "u"; + +static const std::string kContraints = "c"; +static const std::string kServers = "s"; +static const std::string kUrl = "u"; class MockWebRTCInternalsProxy : public WebRTCInternalsUIObserver { public: - virtual void OnUpdate(const string& command, const Value* value) OVERRIDE { + virtual void OnUpdate(const std::string& command, + const base::Value* value) OVERRIDE { command_ = command; value_.reset(value->DeepCopy()); } - string command() { + std::string command() { return command_; } - Value* value() { + base::Value* value() { return value_.get(); } private: - string command_; - scoped_ptr<Value> value_; + std::string command_; + scoped_ptr<base::Value> value_; }; class WebRTCInternalsTest : public testing::Test { @@ -46,12 +44,12 @@ class WebRTCInternalsTest : public testing::Test { WebRTCInternalsTest() : io_thread_(BrowserThread::UI, &io_loop_) {} protected: - string ExpectedInfo(string prefix, - string id, - string suffix) { - static const string kstatic_part1 = string( + std::string ExpectedInfo(std::string prefix, + std::string id, + std::string suffix) { + static const std::string kstatic_part1 = std::string( "{\"constraints\":\"c\","); - static const string kstatic_part2 = string( + static const std::string kstatic_part2 = std::string( ",\"servers\":\"s\",\"url\":\"u\"}"); return prefix + kstatic_part1 + id + kstatic_part2 + suffix; } @@ -82,7 +80,7 @@ TEST_F(WebRTCInternalsTest, SendAddPeerConnectionUpdate) { 0, 1, 2, kUrl, kServers, kContraints); EXPECT_EQ("addPeerConnection", observer->command()); - DictionaryValue* dict = NULL; + base::DictionaryValue* dict = NULL; EXPECT_TRUE(observer->value()->GetAsDictionary(&dict)); int int_value; @@ -91,7 +89,7 @@ TEST_F(WebRTCInternalsTest, SendAddPeerConnectionUpdate) { EXPECT_TRUE(dict->GetInteger("lid", &int_value)); EXPECT_EQ(2, int_value); - string value; + std::string value; EXPECT_TRUE(dict->GetString("url", &value)); EXPECT_EQ(kUrl, value); EXPECT_TRUE(dict->GetString("servers", &value)); @@ -112,7 +110,7 @@ TEST_F(WebRTCInternalsTest, SendRemovePeerConnectionUpdate) { WebRTCInternals::GetInstance()->OnRemovePeerConnection(1, 2); EXPECT_EQ("removePeerConnection", observer->command()); - DictionaryValue* dict = NULL; + base::DictionaryValue* dict = NULL; EXPECT_TRUE(observer->value()->GetAsDictionary(&dict)); int int_value; @@ -131,14 +129,14 @@ TEST_F(WebRTCInternalsTest, SendUpdatePeerConnectionUpdate) { WebRTCInternals::GetInstance()->OnAddPeerConnection( 0, 1, 2, kUrl, kServers, kContraints); - const string update_type = "fakeType"; - const string update_value = "fakeValue"; + const std::string update_type = "fakeType"; + const std::string update_value = "fakeValue"; WebRTCInternals::GetInstance()->OnUpdatePeerConnection( 1, 2, update_type, update_value); EXPECT_EQ("updatePeerConnection", observer->command()); - DictionaryValue* dict = NULL; + base::DictionaryValue* dict = NULL; EXPECT_TRUE(observer->value()->GetAsDictionary(&dict)); int int_value; @@ -147,7 +145,7 @@ TEST_F(WebRTCInternalsTest, SendUpdatePeerConnectionUpdate) { EXPECT_TRUE(dict->GetInteger("lid", &int_value)); EXPECT_EQ(2, int_value); - string value; + std::string value; EXPECT_TRUE(dict->GetString("type", &value)); EXPECT_EQ(update_type, value); EXPECT_TRUE(dict->GetString("value", &value)); diff --git a/content/browser/speech/google_one_shot_remote_engine.cc b/content/browser/speech/google_one_shot_remote_engine.cc index 7d54aa9..a421e79 100644 --- a/content/browser/speech/google_one_shot_remote_engine.cc +++ b/content/browser/speech/google_one_shot_remote_engine.cc @@ -46,20 +46,20 @@ bool ParseServerResponse(const std::string& response_body, // Parse the response, ignoring comments. std::string error_msg; - scoped_ptr<Value> response_value(base::JSONReader::ReadAndReturnError( + scoped_ptr<base::Value> response_value(base::JSONReader::ReadAndReturnError( response_body, base::JSON_PARSE_RFC, NULL, &error_msg)); if (response_value == NULL) { LOG(WARNING) << "ParseServerResponse: JSONReader failed : " << error_msg; return false; } - if (!response_value->IsType(Value::TYPE_DICTIONARY)) { + if (!response_value->IsType(base::Value::TYPE_DICTIONARY)) { VLOG(1) << "ParseServerResponse: Unexpected response type " << response_value->GetType(); return false; } - const DictionaryValue* response_object = - static_cast<const DictionaryValue*>(response_value.get()); + const base::DictionaryValue* response_object = + static_cast<const base::DictionaryValue*>(response_value.get()); // Get the status. int status; @@ -87,40 +87,40 @@ bool ParseServerResponse(const std::string& response_body, } // Get the hypotheses. - const Value* hypotheses_value = NULL; + const base::Value* hypotheses_value = NULL; if (!response_object->Get(kHypothesesString, &hypotheses_value)) { VLOG(1) << "ParseServerResponse: Missing hypotheses attribute."; return false; } DCHECK(hypotheses_value); - if (!hypotheses_value->IsType(Value::TYPE_LIST)) { + if (!hypotheses_value->IsType(base::Value::TYPE_LIST)) { VLOG(1) << "ParseServerResponse: Unexpected hypotheses type " << hypotheses_value->GetType(); return false; } - const ListValue* hypotheses_list = - static_cast<const ListValue*>(hypotheses_value); + const base::ListValue* hypotheses_list = + static_cast<const base::ListValue*>(hypotheses_value); // For now we support only single shot recognition, so we are giving only a // final result, consisting of one fragment (with one or more hypotheses). size_t index = 0; for (; index < hypotheses_list->GetSize(); ++index) { - const Value* hypothesis = NULL; + const base::Value* hypothesis = NULL; if (!hypotheses_list->Get(index, &hypothesis)) { LOG(WARNING) << "ParseServerResponse: Unable to read hypothesis value."; break; } DCHECK(hypothesis); - if (!hypothesis->IsType(Value::TYPE_DICTIONARY)) { + if (!hypothesis->IsType(base::Value::TYPE_DICTIONARY)) { LOG(WARNING) << "ParseServerResponse: Unexpected value type " << hypothesis->GetType(); break; } - const DictionaryValue* hypothesis_value = - static_cast<const DictionaryValue*>(hypothesis); + const base::DictionaryValue* hypothesis_value = + static_cast<const base::DictionaryValue*>(hypothesis); string16 utterance; if (!hypothesis_value->GetString(kUtteranceString, &utterance)) { diff --git a/content/browser/webui/web_ui_data_source_impl.cc b/content/browser/webui/web_ui_data_source_impl.cc index 671bc3a..b564e57 100644 --- a/content/browser/webui/web_ui_data_source_impl.cc +++ b/content/browser/webui/web_ui_data_source_impl.cc @@ -104,7 +104,7 @@ void WebUIDataSourceImpl::AddLocalizedString(const std::string& name, } void WebUIDataSourceImpl::AddLocalizedStrings( - const DictionaryValue& localized_strings) { + const base::DictionaryValue& localized_strings) { localized_strings_.MergeDictionary(&localized_strings); } diff --git a/content/browser/webui/web_ui_data_source_impl.h b/content/browser/webui/web_ui_data_source_impl.h index 98f0a89..0b6f8a3 100644 --- a/content/browser/webui/web_ui_data_source_impl.h +++ b/content/browser/webui/web_ui_data_source_impl.h @@ -33,7 +33,7 @@ class CONTENT_EXPORT WebUIDataSourceImpl const std::string& value) OVERRIDE; virtual void AddLocalizedString(const std::string& name, int ids) OVERRIDE; virtual void AddLocalizedStrings( - const DictionaryValue& localized_strings) OVERRIDE; + const base::DictionaryValue& localized_strings) OVERRIDE; virtual void AddBoolean(const std::string& name, bool value) OVERRIDE; virtual void SetJsonPath(const std::string& path) OVERRIDE; virtual void SetUseJsonJSFormatV2() OVERRIDE; @@ -90,7 +90,7 @@ class CONTENT_EXPORT WebUIDataSourceImpl bool json_js_format_v2_; std::string json_path_; std::map<std::string, int> path_to_idr_map_; - DictionaryValue localized_strings_; + base::DictionaryValue localized_strings_; WebUIDataSource::HandleRequestCallback filter_callback_; bool add_csp_; bool object_src_set_; diff --git a/content/common/browser_plugin/browser_plugin_messages.h b/content/common/browser_plugin/browser_plugin_messages.h index 91c777d..4048f5e 100644 --- a/content/common/browser_plugin/browser_plugin_messages.h +++ b/content/common/browser_plugin/browser_plugin_messages.h @@ -314,7 +314,7 @@ IPC_MESSAGE_ROUTED2(BrowserPluginMsg_AllocateInstanceID_ACK, IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AddMessageToConsole, int /* instance_id */, - DictionaryValue /* message_info */) + base::DictionaryValue /* message_info */) // This message is sent in response to a completed attachment of a guest // to a BrowserPlugin. This message carries information about the guest @@ -454,7 +454,7 @@ IPC_MESSAGE_CONTROL4(BrowserPluginMsg_RequestPermission, int /* instance_id */, BrowserPluginPermissionType /* permission_type */, int /* request_id */, - DictionaryValue /* request_info */) + base::DictionaryValue /* request_info */) // Forwards a PointerLock Unlock request to the BrowserPlugin. IPC_MESSAGE_CONTROL1(BrowserPluginMsg_UnlockMouse, int /* instance_id */) diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc index 9de3e27..042d0c0 100644 --- a/content/renderer/browser_plugin/browser_plugin.cc +++ b/content/renderer/browser_plugin/browser_plugin.cc @@ -441,7 +441,7 @@ void BrowserPlugin::OnAddMessageToConsole( int guest_instance_id, const base::DictionaryValue& message_info) { std::map<std::string, base::Value*> props; // Fill in the info provided by the browser. - for (DictionaryValue::Iterator iter(message_info); !iter.IsAtEnd(); + for (base::DictionaryValue::Iterator iter(message_info); !iter.IsAtEnd(); iter.Advance()) { props[iter.key()] = iter.value().DeepCopy(); } diff --git a/content/renderer/media/peer_connection_tracker.cc b/content/renderer/media/peer_connection_tracker.cc index 5731585..69a2043 100644 --- a/content/renderer/media/peer_connection_tracker.cc +++ b/content/renderer/media/peer_connection_tracker.cc @@ -155,16 +155,17 @@ static string GetIceGatheringStateString( // Note: // The format must be consistent with what webrtc_internals.js expects. // If you change it here, you must change webrtc_internals.js as well. -static DictionaryValue* GetDictValueStats(const webrtc::StatsReport& report) { +static base::DictionaryValue* GetDictValueStats( + const webrtc::StatsReport& report) { if (report.values.empty()) return NULL; - DictionaryValue* dict = new DictionaryValue(); + DictionaryValue* dict = new base::DictionaryValue(); if (!dict) return NULL; dict->SetDouble("timestamp", report.timestamp); - ListValue* values = new ListValue(); + base::ListValue* values = new base::ListValue(); if (!values) { delete dict; return NULL; @@ -180,14 +181,14 @@ static DictionaryValue* GetDictValueStats(const webrtc::StatsReport& report) { // Builds a DictionaryValue from the StatsReport. // The caller takes the ownership of the returned value. -static DictionaryValue* GetDictValue(const webrtc::StatsReport& report) { - scoped_ptr<DictionaryValue> stats, result; +static base::DictionaryValue* GetDictValue(const webrtc::StatsReport& report) { + scoped_ptr<base::DictionaryValue> stats, result; stats.reset(GetDictValueStats(report)); if (!stats) return NULL; - result.reset(new DictionaryValue()); + result.reset(new base::DictionaryValue()); if (!result) return NULL; @@ -209,10 +210,10 @@ class InternalStatsObserver : public webrtc::StatsObserver { virtual void OnComplete( const std::vector<webrtc::StatsReport>& reports) OVERRIDE { - ListValue list; + base::ListValue list; for (size_t i = 0; i < reports.size(); ++i) { - DictionaryValue* report = GetDictValue(reports[i]); + base::DictionaryValue* report = GetDictValue(reports[i]); if (report) list.Append(report); } diff --git a/content/renderer/stats_collection_controller.cc b/content/renderer/stats_collection_controller.cc index 80ff096..829b32c 100644 --- a/content/renderer/stats_collection_controller.cc +++ b/content/renderer/stats_collection_controller.cc @@ -53,10 +53,10 @@ void ConvertLoadTimeToJSON( const base::TimeTicks& load_start_time, const base::TimeTicks& load_stop_time, std::string *result) { - DictionaryValue item; + base::DictionaryValue item; if (load_start_time.is_null()) { - item.Set("load_start_ms", Value::CreateNullValue()); + item.Set("load_start_ms", base::Value::CreateNullValue()); } else { // This code relies on an implementation detail of TimeTicks::Now() - that // its return value happens to coincide with the system uptime value in @@ -65,7 +65,7 @@ void ConvertLoadTimeToJSON( item.SetDouble("load_start_ms", load_start_time.ToInternalValue() / 1000); } if (load_stop_time.is_null() || load_stop_time.is_null()) { - item.Set("load_duration_ms", Value::CreateNullValue()); + item.Set("load_duration_ms", base::Value::CreateNullValue()); } else { item.SetDouble("load_duration_ms", (load_stop_time - load_start_time).InMilliseconds()); diff --git a/content/renderer/v8_value_converter_impl.cc b/content/renderer/v8_value_converter_impl.cc index 2f91371..6161a16 100644 --- a/content/renderer/v8_value_converter_impl.cc +++ b/content/renderer/v8_value_converter_impl.cc @@ -289,7 +289,7 @@ Value* V8ValueConverterImpl::FromV8ValueImpl( return NULL; } -Value* V8ValueConverterImpl::FromV8Array( +base::Value* V8ValueConverterImpl::FromV8Array( v8::Handle<v8::Array> val, FromV8ValueState* state) const { if (!state->UpdateAndCheckUniqueness(val)) @@ -352,7 +352,7 @@ base::BinaryValue* V8ValueConverterImpl::FromV8Buffer( return NULL; } -Value* V8ValueConverterImpl::FromV8Object( +base::Value* V8ValueConverterImpl::FromV8Object( v8::Handle<v8::Object> val, FromV8ValueState* state) const { if (!state->UpdateAndCheckUniqueness(val)) @@ -415,7 +415,7 @@ Value* V8ValueConverterImpl::FromV8Object( // there *is* a "windowId" property, but since it should be an int, code // on the browser which doesn't additionally check for null will fail. // We can avoid all bugs related to this by stripping null. - if (strip_null_from_objects_ && child->IsType(Value::TYPE_NULL)) + if (strip_null_from_objects_ && child->IsType(base::Value::TYPE_NULL)) continue; result->SetWithoutPathExpansion(std::string(*name_utf8, name_utf8.length()), |