diff options
author | vsevik@chromium.org <vsevik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-13 19:57:25 +0000 |
---|---|---|
committer | vsevik@chromium.org <vsevik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-13 19:57:25 +0000 |
commit | dfd68217f29368caff98a05afb06d86430cf7707 (patch) | |
tree | ca02da287323bf785e8ff719987737cc9b8845fe /webkit/glue | |
parent | 41e889432dacf1044c38d23a49b7edbc44d273b6 (diff) | |
download | chromium_src-dfd68217f29368caff98a05afb06d86430cf7707.zip chromium_src-dfd68217f29368caff98a05afb06d86430cf7707.tar.gz chromium_src-dfd68217f29368caff98a05afb06d86430cf7707.tar.bz2 |
Renamed raw_data_length to encoded_data_length
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/6838021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81464 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/media/buffered_resource_loader.cc | 2 | ||||
-rw-r--r-- | webkit/glue/media/buffered_resource_loader.h | 2 | ||||
-rw-r--r-- | webkit/glue/media/simple_data_source.cc | 2 | ||||
-rw-r--r-- | webkit/glue/media/simple_data_source.h | 2 | ||||
-rw-r--r-- | webkit/glue/multipart_response_delegate.cc | 18 | ||||
-rw-r--r-- | webkit/glue/multipart_response_delegate.h | 4 | ||||
-rw-r--r-- | webkit/glue/multipart_response_delegate_unittest.cc | 38 | ||||
-rw-r--r-- | webkit/glue/resource_fetcher.cc | 2 | ||||
-rw-r--r-- | webkit/glue/resource_fetcher.h | 2 | ||||
-rw-r--r-- | webkit/glue/resource_loader_bridge.cc | 2 | ||||
-rw-r--r-- | webkit/glue/resource_loader_bridge.h | 14 | ||||
-rw-r--r-- | webkit/glue/weburlloader_impl.cc | 10 |
12 files changed, 49 insertions, 49 deletions
diff --git a/webkit/glue/media/buffered_resource_loader.cc b/webkit/glue/media/buffered_resource_loader.cc index 4eefe16..0c54fad 100644 --- a/webkit/glue/media/buffered_resource_loader.cc +++ b/webkit/glue/media/buffered_resource_loader.cc @@ -322,7 +322,7 @@ void BufferedResourceLoader::didReceiveData( WebURLLoader* loader, const char* data, int data_length, - int raw_data_length) { + int encoded_data_length) { DCHECK(!completed_); DCHECK_GT(data_length, 0); diff --git a/webkit/glue/media/buffered_resource_loader.h b/webkit/glue/media/buffered_resource_loader.h index 52513e8..9e0c870 100644 --- a/webkit/glue/media/buffered_resource_loader.h +++ b/webkit/glue/media/buffered_resource_loader.h @@ -135,7 +135,7 @@ class BufferedResourceLoader : WebKit::WebURLLoader* loader, const char* data, int data_length, - int raw_data_length); + int encoded_data_length); virtual void didReceiveCachedMetadata( WebKit::WebURLLoader* loader, const char* data, int dataLength); diff --git a/webkit/glue/media/simple_data_source.cc b/webkit/glue/media/simple_data_source.cc index 45befa0..6647e52 100644 --- a/webkit/glue/media/simple_data_source.cc +++ b/webkit/glue/media/simple_data_source.cc @@ -184,7 +184,7 @@ void SimpleDataSource::didReceiveData( WebKit::WebURLLoader* loader, const char* data, int data_length, - int raw_data_length) { + int encoded_data_length) { DCHECK(MessageLoop::current() == render_loop_); data_.append(data, data_length); } diff --git a/webkit/glue/media/simple_data_source.h b/webkit/glue/media/simple_data_source.h index 3993f3b..2c4075af 100644 --- a/webkit/glue/media/simple_data_source.h +++ b/webkit/glue/media/simple_data_source.h @@ -75,7 +75,7 @@ class SimpleDataSource : public WebDataSource, WebKit::WebURLLoader* loader, const char* data, int dataLength, - int rawDataLength); + int encodedDataLength); virtual void didReceiveCachedMetadata( WebKit::WebURLLoader* loader, const char* data, int dataLength); diff --git a/webkit/glue/multipart_response_delegate.cc b/webkit/glue/multipart_response_delegate.cc index f45ec0f..3a4f053 100644 --- a/webkit/glue/multipart_response_delegate.cc +++ b/webkit/glue/multipart_response_delegate.cc @@ -62,7 +62,7 @@ MultipartResponseDelegate::MultipartResponseDelegate( : client_(client), loader_(loader), original_response_(response), - raw_data_length_(0), + encoded_data_length_(0), boundary_("--"), first_received_data_(true), processing_headers_(false), @@ -78,7 +78,7 @@ MultipartResponseDelegate::MultipartResponseDelegate( void MultipartResponseDelegate::OnReceivedData(const char* data, int data_len, - int raw_data_length) { + int encoded_data_length) { // stop_sending_ means that we've already received the final boundary token. // The server should stop sending us data at this point, but if it does, we // just throw it away. @@ -86,7 +86,7 @@ void MultipartResponseDelegate::OnReceivedData(const char* data, return; data_.append(data, data_len); - raw_data_length_ += raw_data_length; + encoded_data_length_ += encoded_data_length; if (first_received_data_) { // Some servers don't send a boundary token before the first chunk of // data. We handle this case anyway (Gecko does too). @@ -144,8 +144,8 @@ void MultipartResponseDelegate::OnReceivedData(const char* data, client_->didReceiveData(loader_, data_.data(), static_cast<int>(data_length), - raw_data_length_); - raw_data_length_ = 0; + encoded_data_length_); + encoded_data_length_ = 0; } } size_t boundary_end_pos = boundary_pos + boundary_.length(); @@ -179,9 +179,9 @@ void MultipartResponseDelegate::OnReceivedData(const char* data, client_->didReceiveData(loader_, data_.data(), send_length, - raw_data_length_); + encoded_data_length_); data_ = data_.substr(send_length); - raw_data_length_ = 0; + encoded_data_length_ = 0; } } @@ -192,8 +192,8 @@ void MultipartResponseDelegate::OnCompletedRequest() { client_->didReceiveData(loader_, data_.data(), static_cast<int>(data_.length()), - raw_data_length_); - raw_data_length_ = 0; + encoded_data_length_); + encoded_data_length_ = 0; } } diff --git a/webkit/glue/multipart_response_delegate.h b/webkit/glue/multipart_response_delegate.h index 7c82958..5536d516 100644 --- a/webkit/glue/multipart_response_delegate.h +++ b/webkit/glue/multipart_response_delegate.h @@ -72,7 +72,7 @@ class MultipartResponseDelegate { const std::string& boundary); // Passed through from ResourceHandleInternal - void OnReceivedData(const char* data, int data_len, int raw_data_length); + void OnReceivedData(const char* data, int data_len, int encoded_data_length); void OnCompletedRequest(); // The request has been canceled, so stop making calls to the client. @@ -121,7 +121,7 @@ class MultipartResponseDelegate { size_t FindBoundary(); // Transferred data size accumulated between client callbacks. - int raw_data_length_; + int encoded_data_length_; // A temporary buffer to hold data between reads for multipart data that // gets split in the middle of a header. diff --git a/webkit/glue/multipart_response_delegate_unittest.cc b/webkit/glue/multipart_response_delegate_unittest.cc index 0aba6e9..bebb9f0 100644 --- a/webkit/glue/multipart_response_delegate_unittest.cc +++ b/webkit/glue/multipart_response_delegate_unittest.cc @@ -70,16 +70,16 @@ class MockWebURLLoaderClient : public WebURLLoaderClient { WebKit::WebURLLoader* loader, const char* data, int data_length, - int raw_data_length) { + int encoded_data_length) { ++received_data_; data_.append(data, data_length); - total_raw_data_length_ += raw_data_length; + total_encoded_data_length_ += encoded_data_length; } virtual void didFinishLoading(WebURLLoader*, double finishTime) {} virtual void didFail(WebURLLoader*, const WebURLError&) {} void Reset() { - received_response_ = received_data_ = total_raw_data_length_ = 0; + received_response_ = received_data_ = total_encoded_data_length_ = 0; data_.clear(); response_.reset(); } @@ -88,7 +88,7 @@ class MockWebURLLoaderClient : public WebURLLoaderClient { return string(response_.httpHeaderField(WebString::fromUTF8(name)).utf8()); } - int received_response_, received_data_, total_raw_data_length_; + int received_response_, received_data_, total_encoded_data_length_; string data_; WebURLResponse response_; }; @@ -223,7 +223,7 @@ TEST(MultipartResponseTest, MissingBoundaries) { EXPECT_EQ(1, client.received_data_); EXPECT_EQ(string("This is a sample response"), client.data_); EXPECT_EQ(static_cast<int>(no_start_boundary.length()), - client.total_raw_data_length_); + client.total_encoded_data_length_); delegate.OnCompletedRequest(); EXPECT_EQ(1, client.received_response_); @@ -242,14 +242,14 @@ TEST(MultipartResponseTest, MissingBoundaries) { EXPECT_EQ(1, client.received_data_); EXPECT_EQ("This is a sample response\n", client.data_); EXPECT_EQ(static_cast<int>(no_end_boundary.length()), - client.total_raw_data_length_); + client.total_encoded_data_length_); delegate2.OnCompletedRequest(); EXPECT_EQ(1, client.received_response_); EXPECT_EQ(1, client.received_data_); EXPECT_EQ(string("This is a sample response\n"), client.data_); EXPECT_EQ(static_cast<int>(no_end_boundary.length()), - client.total_raw_data_length_); + client.total_encoded_data_length_); // Neither boundary client.Reset(); @@ -264,14 +264,14 @@ TEST(MultipartResponseTest, MissingBoundaries) { EXPECT_EQ(1, client.received_data_); EXPECT_EQ("This is a sample response\n", client.data_); EXPECT_EQ(static_cast<int>(no_boundaries.length()), - client.total_raw_data_length_); + client.total_encoded_data_length_); delegate3.OnCompletedRequest(); EXPECT_EQ(1, client.received_response_); EXPECT_EQ(1, client.received_data_); EXPECT_EQ(string("This is a sample response\n"), client.data_); EXPECT_EQ(static_cast<int>(no_boundaries.length()), - client.total_raw_data_length_); + client.total_encoded_data_length_); } TEST(MultipartResponseTest, MalformedBoundary) { @@ -297,7 +297,7 @@ TEST(MultipartResponseTest, MalformedBoundary) { EXPECT_EQ(1, client.received_response_); EXPECT_EQ(1, client.received_data_); EXPECT_EQ(string("This is a sample response"), client.data_); - EXPECT_EQ(static_cast<int>(data.length()), client.total_raw_data_length_); + EXPECT_EQ(static_cast<int>(data.length()), client.total_encoded_data_length_); delegate.OnCompletedRequest(); EXPECT_EQ(1, client.received_response_); @@ -312,13 +312,13 @@ struct TestChunk { const int expected_responses; const int expected_received_data; const char* expected_data; - const int expected_raw_data_length; + const int expected_encoded_data_length; }; void VariousChunkSizesTest(const TestChunk chunks[], int chunks_size, int responses, int received_data, const char* completed_data, - int completed_raw_data_length) { + int completed_encoded_data_length) { const string data( "--bound\n" // 0-7 "Content-type: image/png\n\n" // 8-32 @@ -345,8 +345,8 @@ void VariousChunkSizesTest(const TestChunk chunks[], int chunks_size, EXPECT_EQ(chunks[i].expected_responses, client.received_response_); EXPECT_EQ(chunks[i].expected_received_data, client.received_data_); EXPECT_EQ(string(chunks[i].expected_data), client.data_); - EXPECT_EQ(chunks[i].expected_raw_data_length, - client.total_raw_data_length_); + EXPECT_EQ(chunks[i].expected_encoded_data_length, + client.total_encoded_data_length_); } // Check final state delegate.OnCompletedRequest(); @@ -354,7 +354,7 @@ void VariousChunkSizesTest(const TestChunk chunks[], int chunks_size, EXPECT_EQ(received_data, client.received_data_); string completed_data_string(completed_data); EXPECT_EQ(completed_data_string, client.data_); - EXPECT_EQ(completed_raw_data_length, client.total_raw_data_length_); + EXPECT_EQ(completed_encoded_data_length, client.total_encoded_data_length_); } TEST(MultipartResponseTest, BreakInBoundary) { @@ -462,7 +462,7 @@ TEST(MultipartResponseTest, SmallChunk) { EXPECT_EQ(4, client.received_response_); EXPECT_EQ(2, client.received_data_); EXPECT_EQ(string("end"), client.data_); - EXPECT_EQ(static_cast<int>(data.length()), client.total_raw_data_length_); + EXPECT_EQ(static_cast<int>(data.length()), client.total_encoded_data_length_); delegate.OnCompletedRequest(); EXPECT_EQ(4, client.received_response_); @@ -484,7 +484,7 @@ TEST(MultipartResponseTest, MultipleBoundaries) { EXPECT_EQ(2, client.received_response_); EXPECT_EQ(1, client.received_data_); EXPECT_EQ(string("foofoo"), client.data_); - EXPECT_EQ(static_cast<int>(data.length()), client.total_raw_data_length_); + EXPECT_EQ(static_cast<int>(data.length()), client.total_encoded_data_length_); } TEST(MultipartResponseTest, MultipartByteRangeParsingTest) { @@ -652,7 +652,7 @@ TEST(MultipartResponseTest, MultipartPayloadSet) { static_cast<int>(data.length())); EXPECT_EQ(1, client.received_response_); EXPECT_EQ(string("response data"), client.data_); - EXPECT_EQ(static_cast<int>(data.length()), client.total_raw_data_length_); + EXPECT_EQ(static_cast<int>(data.length()), client.total_encoded_data_length_); EXPECT_FALSE(client.response_.isMultipartPayload()); string data2( @@ -665,7 +665,7 @@ TEST(MultipartResponseTest, MultipartPayloadSet) { EXPECT_EQ(2, client.received_response_); EXPECT_EQ(string("response data2"), client.data_); EXPECT_EQ(static_cast<int>(data.length()) + static_cast<int>(data2.length()), - client.total_raw_data_length_); + client.total_encoded_data_length_); EXPECT_TRUE(client.response_.isMultipartPayload()); } diff --git a/webkit/glue/resource_fetcher.cc b/webkit/glue/resource_fetcher.cc index 2b3d47f..28885b4 100644 --- a/webkit/glue/resource_fetcher.cc +++ b/webkit/glue/resource_fetcher.cc @@ -89,7 +89,7 @@ void ResourceFetcher::didReceiveResponse( void ResourceFetcher::didReceiveData( WebURLLoader* loader, const char* data, int data_length, - int raw_data_length) { + int encoded_data_length) { DCHECK(!completed_); DCHECK(data_length > 0); diff --git a/webkit/glue/resource_fetcher.h b/webkit/glue/resource_fetcher.h index 1fba6d7..6af9b54 100644 --- a/webkit/glue/resource_fetcher.h +++ b/webkit/glue/resource_fetcher.h @@ -67,7 +67,7 @@ class ResourceFetcher : public WebKit::WebURLLoaderClient { virtual void didReceiveData( WebKit::WebURLLoader* loader, const char* data, int data_length, - int raw_data_length); + int encoded_data_length); virtual void didFinishLoading( WebKit::WebURLLoader* loader, double finishTime); virtual void didFail( diff --git a/webkit/glue/resource_loader_bridge.cc b/webkit/glue/resource_loader_bridge.cc index ab757df..4cc012d 100644 --- a/webkit/glue/resource_loader_bridge.cc +++ b/webkit/glue/resource_loader_bridge.cc @@ -35,7 +35,7 @@ ResourceDevToolsInfo::~ResourceDevToolsInfo() {} ResourceResponseInfo::ResourceResponseInfo() : content_length(-1), - raw_data_length(-1), + encoded_data_length(-1), appcache_id(appcache::kNoCacheId), connection_id(0), connection_reused(false), diff --git a/webkit/glue/resource_loader_bridge.h b/webkit/glue/resource_loader_bridge.h index df55897..e1a5a99 100644 --- a/webkit/glue/resource_loader_bridge.h +++ b/webkit/glue/resource_loader_bridge.h @@ -141,9 +141,9 @@ struct ResourceResponseInfo { // Content length if available. -1 if not available int64 content_length; - // Length of the raw data transferred over the network. In case there is no - // data, contains -1. - int64 raw_data_length; + // Length of the encoded data transferred over the network. In case there is + // no data, contains -1. + int64 encoded_data_length; // The appcache this response was loaded from, or kNoCacheId. int64 appcache_id; @@ -305,12 +305,12 @@ class ResourceLoaderBridge { // Called when a chunk of response data is available. This method may // be called multiple times or not at all if an error occurs. - // The raw_data_length is the length of the raw data transferred over the - // network, which could be different from data length (e.g. for gzipped - // content), or -1 if if unknown. + // The encoded_data_length is the length of the encoded data transferred + // over the network, which could be different from data length (e.g. for + // gzipped content), or -1 if if unknown. virtual void OnReceivedData(const char* data, int data_length, - int raw_data_length) = 0; + int encoded_data_length) = 0; // Called when metadata generated by the renderer is retrieved from the // cache. This method may be called zero or one times. diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc index bb7bf68..96042dc 100644 --- a/webkit/glue/weburlloader_impl.cc +++ b/webkit/glue/weburlloader_impl.cc @@ -159,7 +159,7 @@ bool GetInfoFromDataURL(const GURL& url, info->charset.swap(charset); info->security_info.clear(); info->content_length = -1; - info->raw_data_length = 0; + info->encoded_data_length = 0; info->load_timing.base_time = Time::Now(); return true; @@ -300,7 +300,7 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>, virtual void OnDownloadedData(int len); virtual void OnReceivedData(const char* data, int data_length, - int raw_data_length); + int encoded_data_length); virtual void OnReceivedCachedMetadata(const char* data, int len); virtual void OnCompletedRequest(const net::URLRequestStatus& status, const std::string& security_info, @@ -598,7 +598,7 @@ void WebURLLoaderImpl::Context::OnDownloadedData(int len) { void WebURLLoaderImpl::Context::OnReceivedData(const char* data, int data_length, - int raw_data_length) { + int encoded_data_length) { if (!client_) return; @@ -612,9 +612,9 @@ void WebURLLoaderImpl::Context::OnReceivedData(const char* data, } else if (multipart_delegate_.get()) { // The multipart delegate will make the appropriate calls to // client_->didReceiveData and client_->didReceiveResponse. - multipart_delegate_->OnReceivedData(data, data_length, raw_data_length); + multipart_delegate_->OnReceivedData(data, data_length, encoded_data_length); } else { - client_->didReceiveData(loader_, data, data_length, raw_data_length); + client_->didReceiveData(loader_, data, data_length, encoded_data_length); } } |