diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 20:42:12 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 20:42:12 +0000 |
commit | ee1a29b05d2e42c596d83ab862af8ec72e99a805 (patch) | |
tree | 08f3d8f63891bac3710d155743543098c87ff09a /chrome/browser/renderer_host | |
parent | f3a696be8b7b99ab44a2c7fb3e5945f1ee45e30d (diff) | |
download | chromium_src-ee1a29b05d2e42c596d83ab862af8ec72e99a805.zip chromium_src-ee1a29b05d2e42c596d83ab862af8ec72e99a805.tar.gz chromium_src-ee1a29b05d2e42c596d83ab862af8ec72e99a805.tar.bz2 |
Use net::HttpRequestHeaders instead of std::string in URLRequest and friends.
BUG=22588
Review URL: http://codereview.chromium.org/1998001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46612 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r-- | chrome/browser/renderer_host/resource_dispatcher_host.cc | 2 | ||||
-rw-r--r-- | chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index 357a826..4c73634 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc @@ -1120,7 +1120,7 @@ int ResourceDispatcherHost::CalculateApproximateMemoryCost( // The following fields should be a minor size contribution (experimentally // on the order of 100). However since they are variable length, it could // in theory be a sizeable contribution. - int strings_cost = request->extra_request_headers().size() + + int strings_cost = request->extra_request_headers().ToString().size() + request->original_url().spec().size() + request->referrer().size() + request->method().size(); diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc index 097ad9ca..ef133b2 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc @@ -648,11 +648,11 @@ TEST_F(ResourceDispatcherHostTest, TestBlockedRequestsDontLeak) { // Test the private helper method "CalculateApproximateMemoryCost()". TEST_F(ResourceDispatcherHostTest, CalculateApproximateMemoryCost) { URLRequest req(GURL("http://www.google.com"), NULL); - EXPECT_EQ(4425, ResourceDispatcherHost::CalculateApproximateMemoryCost(&req)); + EXPECT_EQ(4427, ResourceDispatcherHost::CalculateApproximateMemoryCost(&req)); // Add 9 bytes of referrer. req.set_referrer("123456789"); - EXPECT_EQ(4434, ResourceDispatcherHost::CalculateApproximateMemoryCost(&req)); + EXPECT_EQ(4436, ResourceDispatcherHost::CalculateApproximateMemoryCost(&req)); // Add 33 bytes of upload content. std::string upload_content; @@ -661,11 +661,11 @@ TEST_F(ResourceDispatcherHostTest, CalculateApproximateMemoryCost) { req.AppendBytesToUpload(upload_content.data(), upload_content.size()); // Since the upload throttling is disabled, this has no effect on the cost. - EXPECT_EQ(4434, ResourceDispatcherHost::CalculateApproximateMemoryCost(&req)); + EXPECT_EQ(4436, ResourceDispatcherHost::CalculateApproximateMemoryCost(&req)); // Add a file upload -- should have no effect. req.AppendFileToUpload(FilePath(FILE_PATH_LITERAL("does-not-exist.png"))); - EXPECT_EQ(4434, ResourceDispatcherHost::CalculateApproximateMemoryCost(&req)); + EXPECT_EQ(4436, ResourceDispatcherHost::CalculateApproximateMemoryCost(&req)); } // Test the private helper method "IncrementOutstandingRequestsMemoryCost()". |