Main benefits of NetLog inner classes extraction:
- Greater code organization.
- Promotion of files being "include-what-you-use" clean. Less files now need
to include "net_log.h"; these files are no longer susceptible to having their
includes hidden by the many inner includes of "net_log.h".
- All touched files are also now forward-clean re: NetLog,
NetLogCaptureMode and the new, extracted classes.
Here is the new structuring:
- NetLogSource (net_log_source.h/.cc)
- NetLogEntry, NetLogEntryData (net_log_entry.h/.cc)
- NetLogWithSource (net_log_with_source.h/.cc)
***Did not extract NetLog::ThreadSafeObserver into its own class since
NetLog::ThreadSafeObserver and NetLog are interrelated enough to keep
NetLog::ThreadSafeObserver as an inner class.
Further Notes:
1) On top of scripting, all files were checked manually, ensuring:
- Forwards/including added only when appropriate. No extras added.
- "net_log.h" include removals done correctly. No "net_log.h"-hiding
to occur as a result of new changes.
2) Just as any .cc file will not do the include/forward if the paired .h file
already has the include/forward, *_unittests.cc, *_browsertest.cc and
*_test.cc files exhibit the same behavior when they have a paired .h file.
3) Override methods' types do not add to logic for inserting forwards, since it
is guaranteed that the base class has the forward.
- Saw this done in codebase several times, so making sure to
follow the same rule.
4) A big change was the mass adjustment for the include-hiding of
NetLogCaptureMode by net_log.h includes. Now the NetLogCaptureMode class is
being properly forwarded/included in all files changed by the original
NetLog inner classes extraction work.
5) Many NetLog/NetLogWithSource includes/forwards were added across codebase.
All instances of files seeing their NetLog/NetLogWithSource include/forward
being hidden by their own includes should now be gone. This is to promote
greater flexibility in future changes upon the codebase.
BUG=473710
[email protected],[email protected]
[email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Review-Url: https://codereview.chromium.org/2333923004
Cr-Commit-Position: refs/heads/master@{#422691}
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 85f34e5..ac8a4d1 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -77,8 +77,8 @@
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
-#include "net/log/net_log.h"
#include "net/log/net_log_event_type.h"
+#include "net/log/net_log_source.h"
#include "net/log/test_net_log.h"
#include "net/log/test_net_log_entry.h"
#include "net/log/test_net_log_util.h"
@@ -157,7 +157,7 @@
void TestLoadTimingNotReused(const LoadTimingInfo& load_timing_info,
int connect_timing_flags) {
EXPECT_FALSE(load_timing_info.socket_reused);
- EXPECT_NE(NetLog::Source::kInvalidId, load_timing_info.socket_log_id);
+ EXPECT_NE(NetLogSource::kInvalidId, load_timing_info.socket_log_id);
EXPECT_FALSE(load_timing_info.request_start_time.is_null());
EXPECT_FALSE(load_timing_info.request_start.is_null());
@@ -180,7 +180,7 @@
const LoadTimingInfo& load_timing_info,
int connect_timing_flags) {
EXPECT_FALSE(load_timing_info.socket_reused);
- EXPECT_NE(NetLog::Source::kInvalidId, load_timing_info.socket_log_id);
+ EXPECT_NE(NetLogSource::kInvalidId, load_timing_info.socket_log_id);
EXPECT_FALSE(load_timing_info.request_start_time.is_null());
EXPECT_FALSE(load_timing_info.request_start.is_null());
@@ -203,7 +203,7 @@
void TestLoadTimingReusedWithProxy(
const LoadTimingInfo& load_timing_info) {
EXPECT_TRUE(load_timing_info.socket_reused);
- EXPECT_NE(NetLog::Source::kInvalidId, load_timing_info.socket_log_id);
+ EXPECT_NE(NetLogSource::kInvalidId, load_timing_info.socket_log_id);
EXPECT_FALSE(load_timing_info.request_start_time.is_null());
EXPECT_FALSE(load_timing_info.request_start.is_null());
@@ -246,7 +246,7 @@
void TestLoadTimingCacheHitNoNetwork(
const LoadTimingInfo& load_timing_info) {
EXPECT_FALSE(load_timing_info.socket_reused);
- EXPECT_EQ(NetLog::Source::kInvalidId, load_timing_info.socket_log_id);
+ EXPECT_EQ(NetLogSource::kInvalidId, load_timing_info.socket_log_id);
EXPECT_FALSE(load_timing_info.request_start_time.is_null());
EXPECT_FALSE(load_timing_info.request_start.is_null());
@@ -266,7 +266,7 @@
void TestLoadTimingNoHttpResponse(
const LoadTimingInfo& load_timing_info) {
EXPECT_FALSE(load_timing_info.socket_reused);
- EXPECT_EQ(NetLog::Source::kInvalidId, load_timing_info.socket_log_id);
+ EXPECT_EQ(NetLogSource::kInvalidId, load_timing_info.socket_log_id);
// Only the request times should be non-null.
EXPECT_FALSE(load_timing_info.request_start_time.is_null());