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

Unified Diff: webkit/glue/devtools/devtools_rpc.cc

Issue 173480: DevTools: Remove base/values dependency from devtools. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/devtools/devtools_rpc.h ('k') | webkit/glue/devtools/devtools_rpc_js.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/devtools/devtools_rpc.cc
===================================================================
--- webkit/glue/devtools/devtools_rpc.cc (revision 24604)
+++ webkit/glue/devtools/devtools_rpc.cc (working copy)
@@ -1,109 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// TODO(pfeldman): Remove these once JSON is available in
-// WebCore namespace.
-
-#include "PlatformString.h"
-#undef LOG
-
-#include "base/json_reader.h"
-#include "base/json_writer.h"
-#include "base/values.h"
-#include "webkit/glue/devtools/devtools_rpc.h"
-#include "webkit/glue/glue_util.h"
-
-DevToolsRpc::DevToolsRpc(Delegate* delegate) : delegate_(delegate) {
-}
-
-DevToolsRpc::~DevToolsRpc() {
-}
-
-void DevToolsRpc::SendValueMessage(const std::string& class_name,
- const std::string& method_name,
- const Value& value) {
- delegate_->SendRpcMessage(class_name, method_name, Serialize(value));
-}
-
-// static
-Value* DevToolsRpc::ParseMessage(const std::string& raw_msg) {
- return JSONReader::Read(raw_msg, false);
-}
-
-// static
-std::string DevToolsRpc::Serialize(const Value& value) {
- std::string json;
- // TODO(pfeldman): find out why faster way in no longer working.
- // JSONWriter::WriteWithOptionalEscape(&value, false, false, &json);
- JSONWriter::Write(&value, false, &json);
- return json;
-}
-
-// static
-void DevToolsRpc::GetListValue(
- const ListValue& message,
- int index,
- bool* value) {
- message.GetBoolean(index, value);
-}
-
-// static
-void DevToolsRpc::GetListValue(
- const ListValue& message,
- int index,
- int* value) {
- message.GetInteger(index, value);
-}
-
-// static
-void DevToolsRpc::GetListValue(
- const ListValue& message,
- int index,
- String* value) {
- std::string tmp;
- message.GetString(index, &tmp);
- *value = webkit_glue::StdStringToString(tmp);
-}
-
-// static
-void DevToolsRpc::GetListValue(
- const ListValue& message,
- int index,
- std::string* value) {
- message.GetString(index, value);
-}
-
-// static
-void DevToolsRpc::GetListValue(
- const ListValue& message,
- int index,
- Value** value) {
- message.Get(index, value);
-}
-
-// static
-Value* DevToolsRpc::CreateValue(const String* value) {
- return Value::CreateStringValue(
- webkit_glue::StringToStdString(*value));
-}
-
-// static
-Value* DevToolsRpc::CreateValue(const std::string* value) {
- return Value::CreateStringValue(*value);
-}
-
-// static
-Value* DevToolsRpc::CreateValue(int* value) {
- return Value::CreateIntegerValue(*value);
-}
-
-// static
-Value* DevToolsRpc::CreateValue(bool* value) {
- return Value::CreateBooleanValue(*value);
-}
-
-// static
-Value* DevToolsRpc::CreateValue(const Value* value) {
- return value->DeepCopy();
-}
« no previous file with comments | « webkit/glue/devtools/devtools_rpc.h ('k') | webkit/glue/devtools/devtools_rpc_js.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698