Commit af101146 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Reland "Remove unnecessary #includes from Assertions.h"

Difference from the reverted CL:
Renames JSONObject::GetObject to GetJSONObject to avoid a Windows build
issue.


Change-Id: I3ec8abedaa63b4d38fc9c9d3a53f7826de6b5392
Reviewed-on: https://chromium-review.googlesource.com/578633
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarYuta Kitamura <yutak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488298}
parent eff09799
...@@ -199,7 +199,7 @@ void extractEntity(const JSONObject& val, Entity& entity, int recursionLevel) { ...@@ -199,7 +199,7 @@ void extractEntity(const JSONObject& val, Entity& entity, int recursionLevel) {
property->values->set_entity_values(Vector<EntityPtr>()); property->values->set_entity_values(Vector<EntityPtr>());
property->values->get_entity_values().push_back(Entity::New()); property->values->get_entity_values().push_back(Entity::New());
extractEntity(*(val.GetObject(entry.first)), extractEntity(*(val.GetJSONObject(entry.first)),
*(property->values->get_entity_values().at(0)), *(property->values->get_entity_values().at(0)),
recursionLevel + 1); recursionLevel + 1);
} break; } break;
......
include_rules = [ include_rules = [
# To whitelist base/ stuff Blink is allowed to include, we list up all # To whitelist base/ stuff Blink is allowed to include, we list up all
# directories and files instead of writing 'base/'. # directories and files instead of writing 'base/'.
"+base/allocator/partition_allocator/oom.h",
"+base/bind.h", "+base/bind.h",
"+base/bind_helpers.h", "+base/bind_helpers.h",
"+base/callback.h", "+base/callback.h",
......
...@@ -578,7 +578,7 @@ JSONObject* AutoLogger::LogItemWithParams(const String& name) { ...@@ -578,7 +578,7 @@ JSONObject* AutoLogger::LogItemWithParams(const String& name) {
JSONObject* item = LogItem(name); JSONObject* item = LogItem(name);
std::unique_ptr<JSONObject> params = JSONObject::Create(); std::unique_ptr<JSONObject> params = JSONObject::Create();
item->SetObject("params", std::move(params)); item->SetObject("params", std::move(params));
return item->GetObject("params"); return item->GetJSONObject("params");
} }
LoggingCanvas::LoggingCanvas(int width, int height) LoggingCanvas::LoggingCanvas(int width, int height)
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "platform/heap/PageMemory.h" #include "platform/heap/PageMemory.h"
#include "base/allocator/partition_allocator/oom.h"
#include "platform/heap/Heap.h" #include "platform/heap/Heap.h"
#include "platform/wtf/AddressSanitizer.h" #include "platform/wtf/AddressSanitizer.h"
#include "platform/wtf/Assertions.h" #include "platform/wtf/Assertions.h"
......
...@@ -343,7 +343,7 @@ TEST(JSONParserTest, Reading) { ...@@ -343,7 +343,7 @@ TEST(JSONParserTest, Reading) {
EXPECT_EQ(JSONValue::kTypeObject, root->GetType()); EXPECT_EQ(JSONValue::kTypeObject, root->GetType());
object_val = JSONObject::Cast(root.get()); object_val = JSONObject::Cast(root.get());
ASSERT_TRUE(object_val); ASSERT_TRUE(object_val);
JSONObject* inner_object = object_val->GetObject("inner"); JSONObject* inner_object = object_val->GetJSONObject("inner");
ASSERT_TRUE(inner_object); ASSERT_TRUE(inner_object);
JSONArray* inner_array = inner_object->GetArray("array"); JSONArray* inner_array = inner_object->GetArray("array");
ASSERT_TRUE(inner_array); ASSERT_TRUE(inner_array);
...@@ -351,7 +351,7 @@ TEST(JSONParserTest, Reading) { ...@@ -351,7 +351,7 @@ TEST(JSONParserTest, Reading) {
bool_value = true; bool_value = true;
EXPECT_TRUE(object_val->GetBoolean("false", &bool_value)); EXPECT_TRUE(object_val->GetBoolean("false", &bool_value));
EXPECT_FALSE(bool_value); EXPECT_FALSE(bool_value);
inner_object = object_val->GetObject("d"); inner_object = object_val->GetJSONObject("d");
EXPECT_TRUE(inner_object); EXPECT_TRUE(inner_object);
// Test keys with periods // Test keys with periods
...@@ -365,7 +365,7 @@ TEST(JSONParserTest, Reading) { ...@@ -365,7 +365,7 @@ TEST(JSONParserTest, Reading) {
EXPECT_EQ(3, integer_value); EXPECT_EQ(3, integer_value);
EXPECT_TRUE(object_val->GetInteger("c", &integer_value)); EXPECT_TRUE(object_val->GetInteger("c", &integer_value));
EXPECT_EQ(2, integer_value); EXPECT_EQ(2, integer_value);
inner_object = object_val->GetObject("d.e.f"); inner_object = object_val->GetJSONObject("d.e.f");
ASSERT_TRUE(inner_object); ASSERT_TRUE(inner_object);
EXPECT_EQ(1U, inner_object->size()); EXPECT_EQ(1U, inner_object->size());
EXPECT_TRUE(inner_object->GetInteger("g.h.i.j", &integer_value)); EXPECT_TRUE(inner_object->GetInteger("g.h.i.j", &integer_value));
...@@ -376,7 +376,7 @@ TEST(JSONParserTest, Reading) { ...@@ -376,7 +376,7 @@ TEST(JSONParserTest, Reading) {
EXPECT_EQ(JSONValue::kTypeObject, root->GetType()); EXPECT_EQ(JSONValue::kTypeObject, root->GetType());
object_val = JSONObject::Cast(root.get()); object_val = JSONObject::Cast(root.get());
ASSERT_TRUE(object_val); ASSERT_TRUE(object_val);
inner_object = object_val->GetObject("a"); inner_object = object_val->GetJSONObject("a");
ASSERT_TRUE(inner_object); ASSERT_TRUE(inner_object);
EXPECT_TRUE(inner_object->GetInteger("b", &integer_value)); EXPECT_TRUE(inner_object->GetInteger("b", &integer_value));
EXPECT_EQ(2, integer_value); EXPECT_EQ(2, integer_value);
......
...@@ -301,7 +301,7 @@ bool JSONObject::GetString(const String& name, String* output) const { ...@@ -301,7 +301,7 @@ bool JSONObject::GetString(const String& name, String* output) const {
return value->AsString(output); return value->AsString(output);
} }
JSONObject* JSONObject::GetObject(const String& name) const { JSONObject* JSONObject::GetJSONObject(const String& name) const {
return JSONObject::Cast(Get(name)); return JSONObject::Cast(Get(name));
} }
......
...@@ -212,7 +212,9 @@ class PLATFORM_EXPORT JSONObject : public JSONValue { ...@@ -212,7 +212,9 @@ class PLATFORM_EXPORT JSONObject : public JSONValue {
bool GetDouble(const String& name, double* output) const; bool GetDouble(const String& name, double* output) const;
bool GetString(const String& name, String* output) const; bool GetString(const String& name, String* output) const;
JSONObject* GetObject(const String& name) const; // This function is not "GetObject" in order to avoid replacement by
// windows.h.
JSONObject* GetJSONObject(const String& name) const;
JSONArray* GetArray(const String& name) const; JSONArray* GetArray(const String& name) const;
JSONValue* Get(const String& name) const; JSONValue* Get(const String& name) const;
Entry at(size_t index) const; Entry at(size_t index) const;
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "platform/text/ICUError.h" #include "platform/text/ICUError.h"
#include "base/allocator/partition_allocator/oom.h"
namespace blink { namespace blink {
// Distinguish memory allocation failures from other errors. // Distinguish memory allocation failures from other errors.
......
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
*/ */
#include "platform/transforms/TransformationMatrix.h" #include "platform/transforms/TransformationMatrix.h"
#if HAVE(MIPS_MSA_INTRINSICS)
#include "platform/cpu/mips/CommonMacrosMSA.h" #include <cmath>
#endif #include <cstdlib>
#include "platform/geometry/FloatBox.h" #include "platform/geometry/FloatBox.h"
#include "platform/geometry/FloatQuad.h" #include "platform/geometry/FloatQuad.h"
...@@ -37,18 +37,20 @@ ...@@ -37,18 +37,20 @@
#include "platform/geometry/LayoutRect.h" #include "platform/geometry/LayoutRect.h"
#include "platform/transforms/AffineTransform.h" #include "platform/transforms/AffineTransform.h"
#include "platform/transforms/Rotation.h" #include "platform/transforms/Rotation.h"
#include "platform/wtf/Assertions.h" #include "platform/wtf/Assertions.h"
#include "platform/wtf/CPU.h"
#include "platform/wtf/MathExtras.h" #include "platform/wtf/MathExtras.h"
#include "platform/wtf/build_config.h"
#include "platform/wtf/text/WTFString.h" #include "platform/wtf/text/WTFString.h"
#include <cmath>
#include <cstdlib>
#if defined(ARCH_CPU_X86_64) #if defined(ARCH_CPU_X86_64)
#include <emmintrin.h> #include <emmintrin.h>
#endif #endif
#if HAVE(MIPS_MSA_INTRINSICS)
#include "platform/cpu/mips/CommonMacrosMSA.h"
#endif
namespace blink { namespace blink {
// //
......
...@@ -27,23 +27,13 @@ ...@@ -27,23 +27,13 @@
#ifndef WTF_Assertions_h #ifndef WTF_Assertions_h
#define WTF_Assertions_h #define WTF_Assertions_h
// This file uses some GCC extensions, but it should be compatible with C++ and
// Objective C++.
#include <stdarg.h> #include <stdarg.h>
#include "base/allocator/partition_allocator/oom.h" #include "base/compiler_specific.h"
#include "base/gtest_prod_util.h" #include "base/gtest_prod_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "build/build_config.h"
#include "platform/wtf/Compiler.h"
#include "platform/wtf/Noncopyable.h" #include "platform/wtf/Noncopyable.h"
#include "platform/wtf/WTFExport.h" #include "platform/wtf/WTFExport.h"
#include "platform/wtf/build_config.h"
#if defined(OS_WIN)
#include <windows.h>
#endif
// WTFLogAlways() is deprecated. crbug.com/638849 // WTFLogAlways() is deprecated. crbug.com/638849
WTF_EXPORT PRINTF_FORMAT(1, 2) // NOLINT WTF_EXPORT PRINTF_FORMAT(1, 2) // NOLINT
......
include_rules = [ include_rules = [
# To whitelist base/ stuff Blink is allowed to include, we list up all # To whitelist base/ stuff Blink is allowed to include, we list up all
# directories and files instead of writing 'base/'. # directories and files instead of writing 'base/'.
"+base/allocator/oom.h",
"+base/allocator/partition_allocator", "+base/allocator/partition_allocator",
"+base/process/process_metrics.h", "+base/process/process_metrics.h",
"+base/atomic_ref_count.h", "+base/atomic_ref_count.h",
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "platform/wtf/allocator/Partitions.h" #include "platform/wtf/allocator/Partitions.h"
#include "base/allocator/partition_allocator/oom.h"
#include "base/allocator/partition_allocator/page_allocator.h" #include "base/allocator/partition_allocator/page_allocator.h"
#include "base/debug/alias.h" #include "base/debug/alias.h"
#include "platform/wtf/allocator/PartitionAllocator.h" #include "platform/wtf/allocator/PartitionAllocator.h"
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#ifndef ArrayBuffer_h #ifndef ArrayBuffer_h
#define ArrayBuffer_h #define ArrayBuffer_h
#include "base/allocator/partition_allocator/oom.h"
#include "platform/wtf/Assertions.h" #include "platform/wtf/Assertions.h"
#include "platform/wtf/HashSet.h" #include "platform/wtf/HashSet.h"
#include "platform/wtf/RefCounted.h" #include "platform/wtf/RefCounted.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment