summaryrefslogtreecommitdiffstats
path: root/content/common
diff options
context:
space:
mode:
authormkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-07 18:24:29 +0000
committermkosiba@chromium.org <mkosiba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-07 18:24:29 +0000
commit2756a8ead95f2e02e1df63f86ce8703bbada27b8 (patch)
tree4fc1797ef163d09d2e618b3ed7b7c89719b681cc /content/common
parented028002706859ad939e24f13771bca3243cbe05 (diff)
downloadchromium_src-2756a8ead95f2e02e1df63f86ce8703bbada27b8.zip
chromium_src-2756a8ead95f2e02e1df63f86ce8703bbada27b8.tar.gz
chromium_src-2756a8ead95f2e02e1df63f86ce8703bbada27b8.tar.bz2
Remove the HANDLED_EXTERNALLY status code.
This removes the HANDLED_EXTERNALLY status replacing its use with ResourceRequestInfo::HandledExternally. BUG=none TEST=unit_tests, content_unittests Review URL: https://chromiumcodereview.appspot.com/10640019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155427 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r--content/common/resource_dispatcher.cc14
-rw-r--r--content/common/resource_dispatcher.h3
-rw-r--r--content/common/resource_dispatcher_unittest.cc22
-rw-r--r--content/common/resource_messages.h7
4 files changed, 27 insertions, 19 deletions
diff --git a/content/common/resource_dispatcher.cc b/content/common/resource_dispatcher.cc
index 5fc9091..7758a48 100644
--- a/content/common/resource_dispatcher.cc
+++ b/content/common/resource_dispatcher.cc
@@ -185,7 +185,7 @@ void IPCResourceLoaderBridge::SetDefersLoading(bool value) {
void IPCResourceLoaderBridge::SyncLoad(SyncLoadResponse* response) {
if (request_id_ != -1) {
NOTREACHED() << "Starting a request twice";
- response->status.set_status(net::URLRequestStatus::FAILED);
+ response->error_code = net::ERR_FAILED;
return;
}
@@ -197,11 +197,11 @@ void IPCResourceLoaderBridge::SyncLoad(SyncLoadResponse* response) {
request_, &result);
// NOTE: This may pump events (see RenderThread::Send).
if (!dispatcher_->message_sender()->Send(msg)) {
- response->status.set_status(net::URLRequestStatus::FAILED);
+ response->error_code = net::ERR_FAILED;
return;
}
- response->status = result.status;
+ response->error_code = result.error_code;
response->url = result.final_url;
response->headers = result.headers;
response->mime_type = result.mime_type;
@@ -406,7 +406,8 @@ void ResourceDispatcher::FollowPendingRedirect(
void ResourceDispatcher::OnRequestComplete(
int request_id,
- const net::URLRequestStatus& status,
+ int error_code,
+ bool was_ignored_by_handler,
const std::string& security_info,
const base::TimeTicks& browser_completion_time) {
PendingRequestInfo* request_info = GetPendingRequestInfo(request_id);
@@ -419,7 +420,7 @@ void ResourceDispatcher::OnRequestComplete(
if (delegate_) {
ResourceLoaderBridge::Peer* new_peer =
delegate_->OnRequestComplete(
- request_info->peer, request_info->resource_type, status);
+ request_info->peer, request_info->resource_type, error_code);
if (new_peer)
request_info->peer = new_peer;
}
@@ -429,7 +430,8 @@ void ResourceDispatcher::OnRequestComplete(
// The request ID will be removed from our pending list in the destructor.
// Normally, dispatching this message causes the reference-counted request to
// die immediately.
- peer->OnCompletedRequest(status, security_info, renderer_completion_time);
+ peer->OnCompletedRequest(error_code, was_ignored_by_handler, security_info,
+ renderer_completion_time);
}
int ResourceDispatcher::AddPendingRequest(
diff --git a/content/common/resource_dispatcher.h b/content/common/resource_dispatcher.h
index 79d955b..96c33e0 100644
--- a/content/common/resource_dispatcher.h
+++ b/content/common/resource_dispatcher.h
@@ -124,7 +124,8 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener {
int data_len);
void OnRequestComplete(
int request_id,
- const net::URLRequestStatus& status,
+ int error_code,
+ bool was_ignored_by_handler,
const std::string& security_info,
const base::TimeTicks& completion_time);
diff --git a/content/common/resource_dispatcher_unittest.cc b/content/common/resource_dispatcher_unittest.cc
index b1e6c58..ce514c0 100644
--- a/content/common/resource_dispatcher_unittest.cc
+++ b/content/common/resource_dispatcher_unittest.cc
@@ -13,6 +13,7 @@
#include "content/common/resource_dispatcher.h"
#include "content/common/resource_messages.h"
#include "content/public/common/resource_response.h"
+#include "net/base/net_errors.h"
#include "net/base/upload_data.h"
#include "net/http/http_response_headers.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -68,9 +69,10 @@ class TestRequestCallback : public ResourceLoaderBridge::Peer {
}
virtual void OnCompletedRequest(
- const net::URLRequestStatus& status,
+ int error_code,
+ bool was_ignored_by_handler,
const std::string& security_info,
- const base::TimeTicks& completion_time) OVERRIDE {
+ const base::TimeTicks& completion_time) {
EXPECT_FALSE(complete_);
complete_ = true;
}
@@ -246,7 +248,7 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest,
set_defer_loading(true);
ResourceResponseHead response_head;
- response_head.status.set_status(net::URLRequestStatus::SUCCESS);
+ response_head.error_code = net::OK;
dispatcher_->OnMessageReceived(
ResourceMsg_ReceivedResponse(0, 0, response_head));
@@ -292,9 +294,10 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest,
}
virtual void OnCompletedRequest(
- const net::URLRequestStatus& status,
+ int error_code,
+ bool was_ignored_by_handler,
const std::string& security_info,
- const base::TimeTicks& completion_time) OVERRIDE {
+ const base::TimeTicks& completion_time) {
}
protected:
@@ -378,7 +381,8 @@ class TimeConversionTest : public ResourceDispatcherTest,
}
virtual void OnCompletedRequest(
- const net::URLRequestStatus& status,
+ int error_code,
+ bool was_ignored_by_handler,
const std::string& security_info,
const base::TimeTicks& completion_time) OVERRIDE {
}
@@ -392,7 +396,7 @@ class TimeConversionTest : public ResourceDispatcherTest,
// TODO(simonjam): Enable this when 10829031 lands.
TEST_F(TimeConversionTest, DISABLED_ProperlyInitialized) {
ResourceResponseHead response_head;
- response_head.status.set_status(net::URLRequestStatus::SUCCESS);
+ response_head.error_code = net::OK;
response_head.request_start = base::TimeTicks::FromInternalValue(5);
response_head.response_start = base::TimeTicks::FromInternalValue(15);
response_head.load_timing.base_time = base::Time::Now();
@@ -409,7 +413,7 @@ TEST_F(TimeConversionTest, DISABLED_ProperlyInitialized) {
TEST_F(TimeConversionTest, PartiallyInitialized) {
ResourceResponseHead response_head;
- response_head.status.set_status(net::URLRequestStatus::SUCCESS);
+ response_head.error_code = net::OK;
response_head.request_start = base::TimeTicks::FromInternalValue(5);
response_head.response_start = base::TimeTicks::FromInternalValue(15);
@@ -421,7 +425,7 @@ TEST_F(TimeConversionTest, PartiallyInitialized) {
TEST_F(TimeConversionTest, NotInitialized) {
ResourceResponseHead response_head;
- response_head.status.set_status(net::URLRequestStatus::SUCCESS);
+ response_head.error_code = net::OK;
PerformTest(response_head);
diff --git a/content/common/resource_messages.h b/content/common/resource_messages.h
index 638d238..ac39813 100644
--- a/content/common/resource_messages.h
+++ b/content/common/resource_messages.h
@@ -17,7 +17,7 @@
IPC_STRUCT_TRAITS_BEGIN(content::ResourceResponseHead)
IPC_STRUCT_TRAITS_PARENT(webkit_glue::ResourceResponseInfo)
- IPC_STRUCT_TRAITS_MEMBER(status)
+ IPC_STRUCT_TRAITS_MEMBER(error_code)
IPC_STRUCT_TRAITS_MEMBER(request_start)
IPC_STRUCT_TRAITS_MEMBER(response_start)
IPC_STRUCT_TRAITS_END()
@@ -172,9 +172,10 @@ IPC_MESSAGE_ROUTED2(ResourceMsg_DataDownloaded,
int /* data_len */)
// Sent when the request has been completed.
-IPC_MESSAGE_ROUTED4(ResourceMsg_RequestComplete,
+IPC_MESSAGE_ROUTED5(ResourceMsg_RequestComplete,
int /* request_id */,
- net::URLRequestStatus /* status */,
+ int /* error_code */,
+ bool /* was_ignored_by_handler */,
std::string /* security info */,
base::TimeTicks /* completion_time */)