Skip to content

Commit

Permalink
Clean up suspect changes in base/net (#3375)
Browse files Browse the repository at this point in the history
b/330364592
b/334975532
  • Loading branch information
andrewsavage1 committed Jun 3, 2024
1 parent c8d3eac commit 94a4841
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 136 deletions.
6 changes: 2 additions & 4 deletions cobalt/h5vcc/dial/dial_http_response.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ void DialHttpResponse::AddHeader(const std::string& header,
std::unique_ptr<net::HttpServerResponseInfo>
DialHttpResponse::ToHttpServerResponseInfo() {
if (!info_) {
info_.reset(new net::HttpServerResponseInfo());
info_.reset(
new net::HttpServerResponseInfo(net::HttpStatusCode(response_code_)));
}
#ifndef COBALT_PENDING_CLEAN_UP
info_->status_code() = net::HttpStatusCode(response_code_);
#endif
info_->SetBody(body_, mime_type_);
return std::move(info_);
}
Expand Down
4 changes: 2 additions & 2 deletions cobalt/loader/image/animated_image_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ AnimatedImageTracker::AnimatedImageTracker(
options.priority = animated_image_decode_thread_priority;
animated_image_decode_thread_.StartWithOptions(options);
#else
animated_image_decode_thread_.StartWithOptions(base::Thread::Options(
base::MessagePumpType::DEFAULT, 0 /* default stack size */));
animated_image_decode_thread_.StartWithOptions(
base::Thread::Options(animated_image_decode_thread_priority));
#endif
}

Expand Down
11 changes: 1 addition & 10 deletions cobalt/loader/script_loader_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@
namespace cobalt {
namespace loader {

namespace {

// The ResourceLoader thread uses the default stack size, which is requested
// by passing in 0 for its stack size.
const size_t kLoadThreadStackSize = 0;

} // namespace

ScriptLoaderFactory::ScriptLoaderFactory(
const char* name, FetcherFactory* fetcher_factory,
base::ThreadType loader_thread_priority)
Expand All @@ -44,8 +36,7 @@ ScriptLoaderFactory::ScriptLoaderFactory(
options.priority = loader_thread_priority;
load_thread_.StartWithOptions(options);
#else
load_thread_.StartWithOptions(base::Thread::Options(
base::MessagePumpType::DEFAULT, kLoadThreadStackSize));
load_thread_.StartWithOptions(base::Thread::Options(loader_thread_priority));
#endif
}

Expand Down
24 changes: 6 additions & 18 deletions cobalt/network/net_log_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,49 +72,37 @@ std::unique_ptr<base::Value::Dict> NetLogConstants::GetConstants() {
// Add a dictionary with information about the relationship between load flag
// enums and their symbolic names.
{
std::unique_ptr<base::Value::Dict> dict(new base::Value::Dict());
base::Value::Dict dict;

#define LOAD_FLAG(label, value) dict->Set(#label, static_cast<int>(value));
#define LOAD_FLAG(label, value) dict.Set(#label, static_cast<int>(value));
#include "net/base/load_flags_list.h"
#undef LOAD_FLAG

#ifdef REGULAR_UPSTREAM_CODE
constants_dict->Set("loadFlag", std::move(dict));
#else
constants_dict->Set("loadFlag", base::Value::Dict());
#endif
}

// Add a dictionary with information about the relationship between load state
// enums and their symbolic names.
{
std::unique_ptr<base::Value::Dict> dict(new base::Value::Dict());
base::Value::Dict dict;

#define LOAD_STATE(label, value) dict->Set(#label, static_cast<int>(value));
#define LOAD_STATE(label, value) dict.Set(#label, static_cast<int>(value));
#include "net/base/load_states_list.h"
#undef LOAD_STATE

#ifdef REGULAR_UPSTREAM_CODE
constants_dict->Set("loadState", std::move(dict));
#else
constants_dict->Set("loadState", base::Value::Dict());
#endif
}

// Add information on the relationship between net error codes and their
// symbolic names.
{
std::unique_ptr<base::Value::Dict> dict(new base::Value::Dict());
base::Value::Dict dict;

#define NET_ERROR(label, value) dict->Set(#label, static_cast<int>(value));
#define NET_ERROR(label, value) dict.Set(#label, static_cast<int>(value));
#include "net/base/net_error_list.h"
#undef NET_ERROR

#ifdef REGULAR_UPSTREAM_CODE
constants_dict->Set("netError", std::move(dict));
#else
constants_dict->Set("netError", base::Value::Dict());
#endif
}

// Information about the relationship between event phase enums and their
Expand Down
6 changes: 0 additions & 6 deletions cobalt/network/url_request_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,6 @@ URLRequestContext::URLRequestContext(
net::NetLog::Get(), /*quick_check_enabled=*/true));

#if !defined(QUIC_DISABLED_FOR_STARBOARD)
#ifndef COBALT_PENDING_CLEAN_UP
// TODO: Confirm this is not needed.
// ack decimation significantly increases download bandwidth on low-end
// android devices.
SetQuicFlag(&FLAGS_quic_reloadable_flag_quic_enable_ack_decimation, true);
#endif
bool quic_enabled =
configuration::Configuration::GetInstance()->CobaltEnableQuic();
if (quic_enabled) {
Expand Down
6 changes: 1 addition & 5 deletions cobalt/websocket/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ static_library("websocket") {
target(gtest_target_type, "websocket_test") {
testonly = true
has_pedantic_warnings = true
sources = [
"mock_websocket_channel.cc",
"mock_websocket_channel.h",
"web_socket_test.cc",
]
sources = [ "web_socket_test.cc" ]
deps = [
":websocket",
"//cobalt/base",
Expand Down
24 changes: 0 additions & 24 deletions cobalt/websocket/mock_websocket_channel.cc

This file was deleted.

59 changes: 0 additions & 59 deletions cobalt/websocket/mock_websocket_channel.h

This file was deleted.

5 changes: 1 addition & 4 deletions components/prefs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ static_library("prefs") {

configs += [ ":prefs_config" ]

deps = [
"//base",
# "//base/util/values:values_util",
]
deps = [ "//base" ]
}

source_set("test_support") {
Expand Down
2 changes: 1 addition & 1 deletion components/prefs/testing_pref_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void TestingPrefServiceBase<SuperPrefService, ConstructionPrefRegistry>::
SetPref(TestingPrefStore* pref_store,
const std::string& path,
std::unique_ptr<base::Value> value) {
pref_store->SetValue(path, base::Value(),
pref_store->SetValue(path, base::Value(std::move(*value)),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
}

Expand Down
8 changes: 6 additions & 2 deletions components/variations/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ static_library("variations") {
"client_filterable_state.h",
"entropy_provider.cc",
"entropy_provider.h",
# "experiment_labels.cc",
# "experiment_labels.h",
"experiment_labels.cc",
"experiment_labels.h",
"hashing.cc",
"hashing.h",
"metrics.cc",
Expand Down Expand Up @@ -84,6 +84,10 @@ static_library("variations") {
"proto/permuted_entropy_cache.proto",
"proto/study.proto",
"proto/variations_seed.proto",

# These can't be by compiled and aren't used in Cobalt.
"experiment_labels.cc",
"experiment_labels.h",
]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ platform_tests_path =
"//starboard/linux/shared:starboard_platform_tests($starboard_toolchain)"

# TODO(b/330364592): re-enable when in-app-dial is fixed.
enable_in_app_dial = false
enable_in_app_dial = true

v8_enable_webassembly = true

0 comments on commit 94a4841

Please sign in to comment.