diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-12 22:28:01 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-12 22:28:01 +0000 |
commit | 0cd50aa38b761f0b4959794664698f19eeeffb23 (patch) | |
tree | b147a1f64956b452813295a793f4ad10ec40f7ea /content/browser | |
parent | 292393b6a5bb764ef9e9bdb8f08e6045664358f4 (diff) | |
download | chromium_src-0cd50aa38b761f0b4959794664698f19eeeffb23.zip chromium_src-0cd50aa38b761f0b4959794664698f19eeeffb23.tar.gz chromium_src-0cd50aa38b761f0b4959794664698f19eeeffb23.tar.bz2 |
Cleanup: Remove deprecated base::Value methods from contents. Use base::Value too.
Review URL: https://chromiumcodereview.appspot.com/12207089
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182042 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r-- | content/browser/devtools/devtools_http_handler_impl.cc | 20 | ||||
-rw-r--r-- | content/browser/gpu/gpu_blacklist.cc | 5 | ||||
-rw-r--r-- | content/browser/gpu/gpu_internals_ui.cc | 96 | ||||
-rw-r--r-- | content/browser/media/media_internals.cc | 27 | ||||
-rw-r--r-- | content/browser/media/media_internals_proxy.cc | 18 | ||||
-rw-r--r-- | content/browser/media/media_internals_unittest.cc | 19 | ||||
-rw-r--r-- | content/browser/renderer_host/pepper/pepper_tcp_socket.cc | 4 | ||||
-rw-r--r-- | content/browser/tracing/tracing_ui.cc | 30 | ||||
-rw-r--r-- | content/browser/webui/web_ui_message_handler_unittest.cc | 30 |
9 files changed, 124 insertions, 125 deletions
diff --git a/content/browser/devtools/devtools_http_handler_impl.cc b/content/browser/devtools/devtools_http_handler_impl.cc index bbe4c46..48d6811 100644 --- a/content/browser/devtools/devtools_http_handler_impl.cc +++ b/content/browser/devtools/devtools_http_handler_impl.cc @@ -512,7 +512,7 @@ void DevToolsHttpHandlerImpl::OnJsonRequestUI( } if (command == "version") { - DictionaryValue version; + base::DictionaryValue version; version.SetString("Protocol-Version", WebKit::WebDevToolsAgent::inspectorProtocolVersion()); version.SetString("WebKit-Version", @@ -527,7 +527,7 @@ void DevToolsHttpHandlerImpl::OnJsonRequestUI( if (command == "list") { PageList page_list = GeneratePageList(); - ListValue json_pages_list; + base::ListValue json_pages_list; std::string host = info.headers["Host"]; for (PageList::iterator i = page_list.begin(); i != page_list.end(); ++i) json_pages_list.Append(SerializePageInfo(*i, host)); @@ -545,11 +545,11 @@ void DevToolsHttpHandlerImpl::OnJsonRequestUI( jsonp); return; } - PageInfo page_info = CreatePageInfo( - rvh, - DevToolsHttpHandlerDelegate::kTargetTypeTab); + PageInfo page_info = + CreatePageInfo(rvh, DevToolsHttpHandlerDelegate::kTargetTypeTab); std::string host = info.headers["Host"]; - scoped_ptr<DictionaryValue> dictionary(SerializePageInfo(page_info, host)); + scoped_ptr<base::DictionaryValue> dictionary( + SerializePageInfo(page_info, host)); SendJson(connection_id, net::HTTP_OK, dictionary.get(), "", jsonp); return; } @@ -748,7 +748,7 @@ void DevToolsHttpHandlerImpl::StopHandlerThread() { void DevToolsHttpHandlerImpl::SendJson(int connection_id, net::HttpStatusCode status_code, - Value* value, + base::Value* value, const std::string& message, const std::string& jsonp) { if (!thread_.get()) @@ -762,7 +762,7 @@ void DevToolsHttpHandlerImpl::SendJson(int connection_id, &json_value); } std::string json_message; - scoped_ptr<Value> message_object(Value::CreateStringValue(message)); + scoped_ptr<base::Value> message_object(new base::StringValue(message)); base::JSONWriter::Write(message_object.get(), &json_message); std::string response; @@ -872,10 +872,10 @@ DevToolsHttpHandlerImpl::CreatePageInfo(RenderViewHost* rvh, return page_info; } -DictionaryValue* DevToolsHttpHandlerImpl::SerializePageInfo( +base::DictionaryValue* DevToolsHttpHandlerImpl::SerializePageInfo( const PageInfo& page_info, const std::string& host) { - DictionaryValue* dictionary = new DictionaryValue; + base::DictionaryValue* dictionary = new base::DictionaryValue; dictionary->SetString("title", page_info.title); dictionary->SetString("url", page_info.url); dictionary->SetString("type", page_info.type); diff --git a/content/browser/gpu/gpu_blacklist.cc b/content/browser/gpu/gpu_blacklist.cc index c4a28de..a3f55cb 100644 --- a/content/browser/gpu/gpu_blacklist.cc +++ b/content/browser/gpu/gpu_blacklist.cc @@ -1317,13 +1317,12 @@ void GpuBlacklist::GetBlacklistReasons(base::ListValue* problem_list) const { base::ListValue* cr_bugs = new base::ListValue(); for (size_t j = 0; j < entry->cr_bugs().size(); ++j) - cr_bugs->Append(base::Value::CreateIntegerValue(entry->cr_bugs()[j])); + cr_bugs->Append(new base::FundamentalValue(entry->cr_bugs()[j])); problem->Set("crBugs", cr_bugs); base::ListValue* webkit_bugs = new base::ListValue(); for (size_t j = 0; j < entry->webkit_bugs().size(); ++j) { - webkit_bugs->Append(base::Value::CreateIntegerValue( - entry->webkit_bugs()[j])); + webkit_bugs->Append(new base::FundamentalValue(entry->webkit_bugs()[j])); } problem->Set("webkitBugs", webkit_bugs); diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc index d6541b5..ca989ae 100644 --- a/content/browser/gpu/gpu_internals_ui.cc +++ b/content/browser/gpu/gpu_internals_ui.cc @@ -50,24 +50,24 @@ WebUIDataSource* CreateGpuHTMLSource() { return source; } -DictionaryValue* NewDescriptionValuePair(const std::string& desc, +base::DictionaryValue* NewDescriptionValuePair(const std::string& desc, const std::string& value) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("description", desc); dict->SetString("value", value); return dict; } -DictionaryValue* NewDescriptionValuePair(const std::string& desc, +base::DictionaryValue* NewDescriptionValuePair(const std::string& desc, Value* value) { - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("description", desc); dict->Set("value", value); return dict; } -Value* NewStatusValue(const char* name, const char* status) { - DictionaryValue* value = new DictionaryValue(); +base::Value* NewStatusValue(const char* name, const char* status) { + base::DictionaryValue* value = new base::DictionaryValue(); value->SetString("name", name); value->SetString("status", status); return value; @@ -75,8 +75,8 @@ Value* NewStatusValue(const char* name, const char* status) { #if defined(OS_WIN) // Output DxDiagNode tree as nested array of {description,value} pairs -ListValue* DxDiagNodeToList(const DxDiagNode& node) { - ListValue* list = new ListValue(); +base::ListValue* DxDiagNodeToList(const DxDiagNode& node) { + base::ListValue* list = new ListValue(); for (std::map<std::string, std::string>::const_iterator it = node.values.begin(); it != node.values.end(); @@ -88,7 +88,7 @@ ListValue* DxDiagNodeToList(const DxDiagNode& node) { node.children.begin(); it != node.children.end(); ++it) { - ListValue* sublist = DxDiagNodeToList(it->second); + base::ListValue* sublist = DxDiagNodeToList(it->second); list->Append(NewDescriptionValuePair(it->first, sublist)); } return list; @@ -106,15 +106,14 @@ std::string GPUDeviceToString(const GPUInfo::GPUDevice& gpu) { "VENDOR = %s, DEVICE= %s", vendor.c_str(), device.c_str()); } -DictionaryValue* GpuInfoAsDictionaryValue() { +base::DictionaryValue* GpuInfoAsDictionaryValue() { GPUInfo gpu_info = GpuDataManagerImpl::GetInstance()->GetGPUInfo(); - ListValue* basic_info = new ListValue(); + base::ListValue* basic_info = new base::ListValue(); basic_info->Append(NewDescriptionValuePair( "Initialization time", base::Int64ToString(gpu_info.initialization_time.InMilliseconds()))); basic_info->Append(NewDescriptionValuePair( - "Sandboxed", - Value::CreateBooleanValue(gpu_info.sandboxed))); + "Sandboxed", new base::FundamentalValue(gpu_info.sandboxed))); basic_info->Append(NewDescriptionValuePair( "GPU0", GPUDeviceToString(gpu_info.gpu))); for (size_t i = 0; i < gpu_info.secondary_gpus.size(); ++i) { @@ -123,9 +122,9 @@ DictionaryValue* GpuInfoAsDictionaryValue() { GPUDeviceToString(gpu_info.secondary_gpus[i]))); } basic_info->Append(NewDescriptionValuePair( - "Optimus", Value::CreateBooleanValue(gpu_info.optimus))); + "Optimus", new base::FundamentalValue(gpu_info.optimus))); basic_info->Append(NewDescriptionValuePair( - "AMD switchable", Value::CreateBooleanValue(gpu_info.amd_switchable))); + "AMD switchable", new base::FundamentalValue(gpu_info.amd_switchable))); basic_info->Append(NewDescriptionValuePair("Driver vendor", gpu_info.driver_vendor)); basic_info->Append(NewDescriptionValuePair("Driver version", @@ -149,11 +148,11 @@ DictionaryValue* GpuInfoAsDictionaryValue() { basic_info->Append(NewDescriptionValuePair("GL_EXTENSIONS", gpu_info.gl_extensions)); - DictionaryValue* info = new DictionaryValue(); + base::DictionaryValue* info = new base::DictionaryValue(); info->Set("basic_info", basic_info); #if defined(OS_WIN) - ListValue* perf_info = new ListValue(); + base::ListValue* perf_info = new base::ListValue(); perf_info->Append(NewDescriptionValuePair( "Graphics", base::StringPrintf("%.1f", gpu_info.performance_stats.graphics))); @@ -165,11 +164,9 @@ DictionaryValue* GpuInfoAsDictionaryValue() { base::StringPrintf("%.1f", gpu_info.performance_stats.overall))); info->Set("performance_info", perf_info); - Value* dx_info; - if (gpu_info.dx_diagnostics.children.size()) - dx_info = DxDiagNodeToList(gpu_info.dx_diagnostics); - else - dx_info = Value::CreateNullValue(); + base::Value* dx_info = gpu_info.dx_diagnostics.children.size() ? + DxDiagNodeToList(gpu_info.dx_diagnostics) : + base::Value::CreateNullValue(); info->Set("diagnostics", dx_info); #endif @@ -188,13 +185,13 @@ bool SupportsAccelerated2dCanvas() { #endif } -Value* GetFeatureStatus() { +base::Value* GetFeatureStatus() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); bool gpu_access_blocked = !GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(); uint32 flags = GpuDataManagerImpl::GetInstance()->GetBlacklistedFeatures(); - DictionaryValue* status = new DictionaryValue(); + base::DictionaryValue* status = new base::DictionaryValue(); const GpuFeatureInfo kGpuFeatureInfo[] = { { @@ -329,7 +326,7 @@ Value* GetFeatureStatus() { // Build the feature_status field. { - ListValue* feature_status_list = new ListValue(); + base::ListValue* feature_status_list = new base::ListValue(); for (size_t i = 0; i < kNumFeatures; ++i) { // force_compositing_mode status is part of the compositing status. @@ -406,25 +403,25 @@ Value* GetFeatureStatus() { // Build the problems list. { - ListValue* problem_list = + base::ListValue* problem_list = GpuDataManagerImpl::GetInstance()->GetBlacklistReasons(); if (gpu_access_blocked) { - DictionaryValue* problem = new DictionaryValue(); + base::DictionaryValue* problem = new base::DictionaryValue(); problem->SetString("description", "GPU process was unable to boot. Access to GPU disallowed."); - problem->Set("crBugs", new ListValue()); - problem->Set("webkitBugs", new ListValue()); + problem->Set("crBugs", new base::ListValue()); + problem->Set("webkitBugs", new base::ListValue()); problem_list->Append(problem); } for (size_t i = 0; i < kNumFeatures; ++i) { if (kGpuFeatureInfo[i].disabled) { - DictionaryValue* problem = new DictionaryValue(); + base::DictionaryValue* problem = new base::DictionaryValue(); problem->SetString( "description", kGpuFeatureInfo[i].disabled_description); - problem->Set("crBugs", new ListValue()); - problem->Set("webkitBugs", new ListValue()); + problem->Set("crBugs", new base::ListValue()); + problem->Set("webkitBugs", new base::ListValue()); problem_list->Append(problem); } } @@ -455,12 +452,12 @@ class GpuMessageHandler const GPUVideoMemoryUsageStats& video_memory_usage_stats) OVERRIDE {} // Messages - void OnBrowserBridgeInitialized(const ListValue* list); - void OnCallAsync(const ListValue* list); + void OnBrowserBridgeInitialized(const base::ListValue* list); + void OnCallAsync(const base::ListValue* list); // Submessages dispatched from OnCallAsync - Value* OnRequestClientInfo(const ListValue* list); - Value* OnRequestLogMessages(const ListValue* list); + base::Value* OnRequestClientInfo(const base::ListValue* list); + base::Value* OnRequestLogMessages(const base::ListValue* list); private: // True if observing the GpuDataManager (re-attaching as observer would @@ -496,11 +493,11 @@ void GpuMessageHandler::RegisterMessages() { base::Unretained(this))); } -void GpuMessageHandler::OnCallAsync(const ListValue* args) { +void GpuMessageHandler::OnCallAsync(const base::ListValue* args) { DCHECK_GE(args->GetSize(), static_cast<size_t>(2)); // unpack args into requestId, submessage and submessageArgs bool ok; - const Value* requestId; + const base::Value* requestId; ok = args->Get(0, &requestId); DCHECK(ok); @@ -508,18 +505,18 @@ void GpuMessageHandler::OnCallAsync(const ListValue* args) { ok = args->GetString(1, &submessage); DCHECK(ok); - ListValue* submessageArgs = new ListValue(); + base::ListValue* submessageArgs = new base::ListValue(); for (size_t i = 2; i < args->GetSize(); ++i) { - const Value* arg; + const base::Value* arg; ok = args->Get(i, &arg); DCHECK(ok); - Value* argCopy = arg->DeepCopy(); + base::Value* argCopy = arg->DeepCopy(); submessageArgs->Append(argCopy); } // call the submessage handler - Value* ret = NULL; + base::Value* ret = NULL; if (submessage == "requestClientInfo") { ret = OnRequestClientInfo(submessageArgs); } else if (submessage == "requestLogMessages") { @@ -543,7 +540,8 @@ void GpuMessageHandler::OnCallAsync(const ListValue* args) { } } -void GpuMessageHandler::OnBrowserBridgeInitialized(const ListValue* args) { +void GpuMessageHandler::OnBrowserBridgeInitialized( + const base::ListValue* args) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Watch for changes in GPUInfo @@ -560,10 +558,11 @@ void GpuMessageHandler::OnBrowserBridgeInitialized(const ListValue* args) { OnGpuInfoUpdate(); } -Value* GpuMessageHandler::OnRequestClientInfo(const ListValue* list) { +base::Value* GpuMessageHandler::OnRequestClientInfo( + const base::ListValue* list) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - DictionaryValue* dict = new DictionaryValue(); + base::DictionaryValue* dict = new base::DictionaryValue(); dict->SetString("version", GetContentClient()->GetProduct()); dict->SetString("command_line", @@ -583,7 +582,7 @@ Value* GpuMessageHandler::OnRequestClientInfo(const ListValue* list) { return dict; } -Value* GpuMessageHandler::OnRequestLogMessages(const ListValue*) { +base::Value* GpuMessageHandler::OnRequestLogMessages(const base::ListValue*) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); return GpuDataManagerImpl::GetInstance()->GetLogMessages(); @@ -591,11 +590,10 @@ Value* GpuMessageHandler::OnRequestLogMessages(const ListValue*) { void GpuMessageHandler::OnGpuInfoUpdate() { // Get GPU Info. - scoped_ptr<base::DictionaryValue> gpu_info_val( - GpuInfoAsDictionaryValue()); + scoped_ptr<base::DictionaryValue> gpu_info_val(GpuInfoAsDictionaryValue()); // Add in blacklisting features - Value* feature_status = GetFeatureStatus(); + base::Value* feature_status = GetFeatureStatus(); if (feature_status) gpu_info_val->Set("featureStatus", feature_status); diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc index dd503a1..6b55d2a 100644 --- a/content/browser/media/media_internals.cc +++ b/content/browser/media/media_internals.cc @@ -31,21 +31,21 @@ void MediaInternals::OnSetAudioStreamPlaying( void* host, int stream_id, bool playing) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); UpdateAudioStream(host, stream_id, - "playing", Value::CreateBooleanValue(playing)); + "playing", new base::FundamentalValue(playing)); } void MediaInternals::OnSetAudioStreamStatus( void* host, int stream_id, const std::string& status) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); UpdateAudioStream(host, stream_id, - "status", Value::CreateStringValue(status)); + "status", new base::StringValue(status)); } void MediaInternals::OnSetAudioStreamVolume( void* host, int stream_id, double volume) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); UpdateAudioStream(host, stream_id, - "volume", Value::CreateDoubleValue(volume)); + "volume", new base::FundamentalValue(volume)); } void MediaInternals::OnMediaEvent( @@ -53,7 +53,7 @@ void MediaInternals::OnMediaEvent( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); // Notify observers that |event| has occured. - DictionaryValue dict; + base::DictionaryValue dict; dict.SetInteger("renderer", render_process_id); dict.SetInteger("player", event.id); dict.SetString("type", media::MediaLog::EventTypeToString(event.type)); @@ -84,8 +84,10 @@ void MediaInternals::SendEverything() { MediaInternals::MediaInternals() { } -void MediaInternals::UpdateAudioStream( - void* host, int stream_id, const std::string& property, Value* value) { +void MediaInternals::UpdateAudioStream(void* host, + int stream_id, + const std::string& property, + base::Value* value) { std::string stream = base::StringPrintf("audio_streams.%p:%d", host, stream_id); UpdateItem("media.addAudioStream", stream, property, value); @@ -93,16 +95,16 @@ void MediaInternals::UpdateAudioStream( void MediaInternals::DeleteItem(const std::string& item) { data_.Remove(item, NULL); - scoped_ptr<Value> value(Value::CreateStringValue(item)); + scoped_ptr<base::Value> value(new base::StringValue(item)); SendUpdate("media.onItemDeleted", value.get()); } void MediaInternals::UpdateItem( const std::string& update_fn, const std::string& id, - const std::string& property, Value* value) { - DictionaryValue* item_properties; + const std::string& property, base::Value* value) { + base::DictionaryValue* item_properties; if (!data_.GetDictionary(id, &item_properties)) { - item_properties = new DictionaryValue(); + item_properties = new base::DictionaryValue(); data_.Set(id, item_properties); item_properties->SetString("id", id); } @@ -110,12 +112,13 @@ void MediaInternals::UpdateItem( SendUpdate(update_fn, item_properties); } -void MediaInternals::SendUpdate(const std::string& function, Value* value) { +void MediaInternals::SendUpdate(const std::string& function, + base::Value* value) { // Only bother serializing the update to JSON if someone is watching. if (update_callbacks_.empty()) return; - std::vector<const Value*> args; + std::vector<const base::Value*> args; args.push_back(value); string16 update = WebUI::GetJavascriptCall(function, args); for (size_t i = 0; i < update_callbacks_.size(); i++) diff --git a/content/browser/media/media_internals_proxy.cc b/content/browser/media/media_internals_proxy.cc index f682a8c..5d837d6 100644 --- a/content/browser/media/media_internals_proxy.cc +++ b/content/browser/media/media_internals_proxy.cc @@ -37,7 +37,7 @@ void MediaInternalsProxy::Observe(int type, DCHECK_EQ(type, NOTIFICATION_RENDERER_PROCESS_TERMINATED); RenderProcessHost* process = Source<RenderProcessHost>(source).ptr(); CallJavaScriptFunctionOnUIThread("media.onRendererTerminated", - base::Value::CreateIntegerValue(process->GetID())); + new base::FundamentalValue(process->GetID())); } void MediaInternalsProxy::Attach(MediaInternalsMessageHandler* handler) { @@ -96,8 +96,8 @@ void MediaInternalsProxy::OnAddEntry(const net::NetLog::Entry& entry) { MediaInternalsProxy::~MediaInternalsProxy() {} -Value* MediaInternalsProxy::GetConstants() { - DictionaryValue* event_phases = new DictionaryValue(); +base::Value* MediaInternalsProxy::GetConstants() { + base::DictionaryValue* event_phases = new base::DictionaryValue(); event_phases->SetInteger( net::NetLog::EventPhaseToString(net::NetLog::PHASE_NONE), net::NetLog::PHASE_NONE); @@ -108,7 +108,7 @@ Value* MediaInternalsProxy::GetConstants() { net::NetLog::EventPhaseToString(net::NetLog::PHASE_END), net::NetLog::PHASE_END); - DictionaryValue* constants = new DictionaryValue(); + base::DictionaryValue* constants = new base::DictionaryValue(); constants->Set("eventTypes", net::NetLog::GetEventTypesAsValue()); constants->Set("eventPhases", event_phases); @@ -147,13 +147,13 @@ void MediaInternalsProxy::UpdateUIOnUIThread(const string16& update) { handler_->OnUpdate(update); } -void MediaInternalsProxy::AddNetEventOnUIThread(Value* entry) { +void MediaInternalsProxy::AddNetEventOnUIThread(base::Value* entry) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Send the updates to the page in kMediaInternalsProxyEventDelayMilliseconds // if an update is not already pending. if (!pending_net_updates_.get()) { - pending_net_updates_.reset(new ListValue()); + pending_net_updates_.reset(new base::ListValue()); MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind( @@ -171,10 +171,10 @@ void MediaInternalsProxy::SendNetEventsOnUIThread() { } void MediaInternalsProxy::CallJavaScriptFunctionOnUIThread( - const std::string& function, Value* args) { + const std::string& function, base::Value* args) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - scoped_ptr<Value> args_value(args); - std::vector<const Value*> args_vector; + scoped_ptr<base::Value> args_value(args); + std::vector<const base::Value*> args_vector; args_vector.push_back(args_value.get()); string16 update = WebUI::GetJavascriptCall(function, args_vector); UpdateUIOnUIThread(update); diff --git a/content/browser/media/media_internals_unittest.cc b/content/browser/media/media_internals_unittest.cc index 9ee9e15..0db2580 100644 --- a/content/browser/media/media_internals_unittest.cc +++ b/content/browser/media/media_internals_unittest.cc @@ -7,7 +7,6 @@ #include "base/bind.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" -#include "content/browser/media/media_internals.h" #include "content/public/test/test_browser_thread.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -32,7 +31,7 @@ class MockMediaInternalsObserver : public MockObserverBaseClass { class MediaInternalsTest : public testing::Test { public: MediaInternalsTest() : io_thread_(BrowserThread::IO, &loop_) {} - DictionaryValue* data() { + base::DictionaryValue* data() { return &internals_->data_; } @@ -41,11 +40,11 @@ class MediaInternalsTest : public testing::Test { } void UpdateItem(const std::string& item, const std::string& property, - Value* value) { + base::Value* value) { internals_->UpdateItem("", item, property, value); } - void SendUpdate(const std::string& function, Value* value) { + void SendUpdate(const std::string& function, base::Value* value) { internals_->SendUpdate(function, value); } @@ -60,7 +59,7 @@ class MediaInternalsTest : public testing::Test { }; TEST_F(MediaInternalsTest, UpdateAddsNewItem) { - UpdateItem("some.item", "testing", Value::CreateBooleanValue(true)); + UpdateItem("some.item", "testing", new base::FundamentalValue(true)); bool testing = false; std::string id; @@ -72,9 +71,9 @@ TEST_F(MediaInternalsTest, UpdateAddsNewItem) { } TEST_F(MediaInternalsTest, UpdateModifiesExistingItem) { - UpdateItem("some.item", "testing", Value::CreateBooleanValue(true)); - UpdateItem("some.item", "value", Value::CreateIntegerValue(5)); - UpdateItem("some.item", "testing", Value::CreateBooleanValue(false)); + UpdateItem("some.item", "testing", new base::FundamentalValue(true)); + UpdateItem("some.item", "value", new base::FundamentalValue(5)); + UpdateItem("some.item", "testing", new base::FundamentalValue(false)); bool testing = true; int value = 0; std::string id; @@ -117,9 +116,9 @@ TEST_F(MediaInternalsTest, RemovedObserversReceiveNoNotifications) { } TEST_F(MediaInternalsTest, DeleteRemovesItem) { - Value* out; + base::Value* out; - UpdateItem("some.item", "testing", Value::CreateNullValue()); + UpdateItem("some.item", "testing", base::Value::CreateNullValue()); EXPECT_TRUE(data()->Get("some.item", &out)); EXPECT_TRUE(data()->Get("some", &out)); diff --git a/content/browser/renderer_host/pepper/pepper_tcp_socket.cc b/content/browser/renderer_host/pepper/pepper_tcp_socket.cc index 61ccdc2..aeb0425 100644 --- a/content/browser/renderer_host/pepper/pepper_tcp_socket.cc +++ b/content/browser/renderer_host/pepper/pepper_tcp_socket.cc @@ -252,9 +252,9 @@ bool PepperTCPSocket::GetCertificateFields( base::BinaryValue::CreateWithCopiedBuffer(serial_number.data(), serial_number.length())); fields->SetField(PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_BEFORE, - base::Value::CreateDoubleValue(cert.valid_start().ToDoubleT())); + new base::FundamentalValue(cert.valid_start().ToDoubleT())); fields->SetField(PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_AFTER, - base::Value::CreateDoubleValue(cert.valid_expiry().ToDoubleT())); + new base::FundamentalValue(cert.valid_expiry().ToDoubleT())); std::string der; net::X509Certificate::GetDEREncoded(cert.os_cert_handle(), &der); fields->SetField(PP_X509CERTIFICATE_PRIVATE_RAW, diff --git a/content/browser/tracing/tracing_ui.cc b/content/browser/tracing/tracing_ui.cc index c1c4813..72f6451 100644 --- a/content/browser/tracing/tracing_ui.cc +++ b/content/browser/tracing/tracing_ui.cc @@ -77,12 +77,12 @@ class TracingMessageHandler virtual void OnTraceBufferPercentFullReply(float percent_full) OVERRIDE; // Messages. - void OnTracingControllerInitialized(const ListValue* list); - void OnBeginTracing(const ListValue* list); - void OnEndTracingAsync(const ListValue* list); - void OnBeginRequestBufferPercentFull(const ListValue* list); - void OnLoadTraceFile(const ListValue* list); - void OnSaveTraceFile(const ListValue* list); + void OnTracingControllerInitialized(const base::ListValue* list); + void OnBeginTracing(const base::ListValue* list); + void OnEndTracingAsync(const base::ListValue* list); + void OnBeginRequestBufferPercentFull(const base::ListValue* list); + void OnLoadTraceFile(const base::ListValue* list); + void OnSaveTraceFile(const base::ListValue* list); // Callbacks. void LoadTraceFileComplete(string16* file_contents); @@ -191,12 +191,12 @@ void TracingMessageHandler::RegisterMessages() { } void TracingMessageHandler::OnTracingControllerInitialized( - const ListValue* args) { + const base::ListValue* args) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Send the client info to the tracingController { - scoped_ptr<DictionaryValue> dict(new DictionaryValue()); + scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); dict->SetString("version", GetContentClient()->GetProduct()); dict->SetString("command_line", @@ -208,7 +208,7 @@ void TracingMessageHandler::OnTracingControllerInitialized( } void TracingMessageHandler::OnBeginRequestBufferPercentFull( - const ListValue* list) { + const base::ListValue* list) { TraceController::GetInstance()->GetTraceBufferPercentFullAsync(this); } @@ -298,7 +298,7 @@ void TracingMessageHandler::FileSelectionCanceled(void* params) { } } -void TracingMessageHandler::OnLoadTraceFile(const ListValue* list) { +void TracingMessageHandler::OnLoadTraceFile(const base::ListValue* list) { // Only allow a single dialog at a time. if (select_trace_file_dialog_.get()) return; @@ -340,7 +340,7 @@ void TracingMessageHandler::LoadTraceFileComplete(string16* contents) { "delete window.traceData;")); } -void TracingMessageHandler::OnSaveTraceFile(const ListValue* list) { +void TracingMessageHandler::OnSaveTraceFile(const base::ListValue* list) { // Only allow a single dialog at a time. if (select_trace_file_dialog_.get()) return; @@ -370,7 +370,7 @@ void TracingMessageHandler::SaveTraceFileComplete() { web_ui()->CallJavascriptFunction("tracingController.onSaveTraceFileComplete"); } -void TracingMessageHandler::OnBeginTracing(const ListValue* args) { +void TracingMessageHandler::OnBeginTracing(const base::ListValue* args) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_EQ(args->GetSize(), (size_t) 2); @@ -400,7 +400,7 @@ void TracingMessageHandler::OnBeginTracing(const ListValue* args) { } } -void TracingMessageHandler::OnEndTracingAsync(const ListValue* list) { +void TracingMessageHandler::OnEndTracingAsync(const base::ListValue* list) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // TODO(nduca): fix javascript code to make sure trace_enabled_ is always true @@ -442,7 +442,7 @@ void TracingMessageHandler::OnEndSystemTracingAck( web_ui()->CallJavascriptFunction( "tracingController.onSystemTraceDataCollected", - *scoped_ptr<Value>(Value::CreateStringValue(events_str_ptr->data()))); + *scoped_ptr<base::Value>(new base::StringValue(events_str_ptr->data()))); DCHECK(!system_trace_in_progress_); OnEndTracingComplete(); @@ -469,7 +469,7 @@ void TracingMessageHandler::OnTraceBufferPercentFullReply(float percent_full) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); web_ui()->CallJavascriptFunction( "tracingController.onRequestBufferPercentFullComplete", - *scoped_ptr<Value>(Value::CreateDoubleValue(percent_full))); + *scoped_ptr<base::Value>(new base::FundamentalValue(percent_full))); } } // namespace diff --git a/content/browser/webui/web_ui_message_handler_unittest.cc b/content/browser/webui/web_ui_message_handler_unittest.cc index 9b98211..496bcdb 100644 --- a/content/browser/webui/web_ui_message_handler_unittest.cc +++ b/content/browser/webui/web_ui_message_handler_unittest.cc @@ -18,78 +18,78 @@ TEST(WebUIMessageHandlerTest, ExtractIntegerValue) { string16 neg_string(UTF8ToUTF16("-1234")); string16 pos_string(UTF8ToUTF16("1234")); - list.Append(Value::CreateIntegerValue(zero_value)); + list.Append(new base::FundamentalValue(zero_value)); EXPECT_TRUE(WebUIMessageHandler::ExtractIntegerValue(&list, &value)); EXPECT_EQ(value, zero_value); list.Clear(); - list.Append(Value::CreateIntegerValue(neg_value)); + list.Append(new base::FundamentalValue(neg_value)); EXPECT_TRUE(WebUIMessageHandler::ExtractIntegerValue(&list, &value)); EXPECT_EQ(value, neg_value); list.Clear(); - list.Append(Value::CreateIntegerValue(pos_value)); + list.Append(new base::FundamentalValue(pos_value)); EXPECT_TRUE(WebUIMessageHandler::ExtractIntegerValue(&list, &value)); EXPECT_EQ(value, pos_value); list.Clear(); - list.Append(Value::CreateStringValue(zero_string)); + list.Append(new base::StringValue(zero_string)); EXPECT_TRUE(WebUIMessageHandler::ExtractIntegerValue(&list, &value)); EXPECT_EQ(value, zero_value); list.Clear(); - list.Append(Value::CreateStringValue(neg_string)); + list.Append(new base::StringValue(neg_string)); EXPECT_TRUE(WebUIMessageHandler::ExtractIntegerValue(&list, &value)); EXPECT_EQ(value, neg_value); list.Clear(); - list.Append(Value::CreateStringValue(pos_string)); + list.Append(new base::StringValue(pos_string)); EXPECT_TRUE(WebUIMessageHandler::ExtractIntegerValue(&list, &value)); EXPECT_EQ(value, pos_value); } TEST(WebUIMessageHandlerTest, ExtractDoubleValue) { - ListValue list; + base::ListValue list; double value, zero_value = 0.0, neg_value = -1234.5, pos_value = 1234.5; string16 zero_string(UTF8ToUTF16("0")); string16 neg_string(UTF8ToUTF16("-1234.5")); string16 pos_string(UTF8ToUTF16("1234.5")); - list.Append(Value::CreateDoubleValue(zero_value)); + list.Append(new base::FundamentalValue(zero_value)); EXPECT_TRUE(WebUIMessageHandler::ExtractDoubleValue(&list, &value)); EXPECT_DOUBLE_EQ(value, zero_value); list.Clear(); - list.Append(Value::CreateDoubleValue(neg_value)); + list.Append(new base::FundamentalValue(neg_value)); EXPECT_TRUE(WebUIMessageHandler::ExtractDoubleValue(&list, &value)); EXPECT_DOUBLE_EQ(value, neg_value); list.Clear(); - list.Append(Value::CreateDoubleValue(pos_value)); + list.Append(new base::FundamentalValue(pos_value)); EXPECT_TRUE(WebUIMessageHandler::ExtractDoubleValue(&list, &value)); EXPECT_DOUBLE_EQ(value, pos_value); list.Clear(); - list.Append(Value::CreateStringValue(zero_string)); + list.Append(new base::StringValue(zero_string)); EXPECT_TRUE(WebUIMessageHandler::ExtractDoubleValue(&list, &value)); EXPECT_DOUBLE_EQ(value, zero_value); list.Clear(); - list.Append(Value::CreateStringValue(neg_string)); + list.Append(new base::StringValue(neg_string)); EXPECT_TRUE(WebUIMessageHandler::ExtractDoubleValue(&list, &value)); EXPECT_DOUBLE_EQ(value, neg_value); list.Clear(); - list.Append(Value::CreateStringValue(pos_string)); + list.Append(new base::StringValue(pos_string)); EXPECT_TRUE(WebUIMessageHandler::ExtractDoubleValue(&list, &value)); EXPECT_DOUBLE_EQ(value, pos_value); } TEST(WebUIMessageHandlerTest, ExtractStringValue) { - ListValue list; + base::ListValue list; string16 in_string(UTF8ToUTF16( "The facts, though interesting, are irrelevant.")); - list.Append(Value::CreateStringValue(in_string)); + list.Append(new base::StringValue(in_string)); string16 out_string = WebUIMessageHandler::ExtractStringValue(&list); EXPECT_EQ(in_string, out_string); } |