Pass actual HTTP response code to CefLoadHandler::OnLoadEnd (issue #521).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@922 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-11-21 22:11:22 +00:00
parent 9ce5dc6293
commit 8d37ead057
6 changed files with 46 additions and 32 deletions

View File

@@ -1591,21 +1591,6 @@ void CefBrowserHostImpl::DocumentAvailableInMainFrame() {
has_document_ = true;
}
void CefBrowserHostImpl::DidFinishLoad(
int64 frame_id,
const GURL& validated_url,
bool is_main_frame,
content::RenderViewHost* render_view_host) {
CefRefPtr<CefFrame> frame = GetOrCreateFrame(frame_id,
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, string16(),
validated_url);
// Give internal scheme handlers an opportunity to update content.
scheme::DidFinishLoad(frame, validated_url);
OnLoadEnd(frame, validated_url);
}
void CefBrowserHostImpl::DidFailLoad(
int64 frame_id,
const GURL& validated_url,
@@ -1617,7 +1602,7 @@ void CefBrowserHostImpl::DidFailLoad(
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, string16(),
validated_url);
OnLoadError(frame, validated_url, error_code, error_description);
OnLoadEnd(frame, validated_url);
OnLoadEnd(frame, validated_url, error_code);
}
void CefBrowserHostImpl::PluginCrashed(const FilePath& plugin_path) {
@@ -1634,6 +1619,7 @@ bool CefBrowserHostImpl::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(CefHostMsg_FrameIdentified, OnFrameIdentified)
IPC_MESSAGE_HANDLER(CefHostMsg_FrameDetached, DetachFrame)
IPC_MESSAGE_HANDLER(CefHostMsg_FrameFocusChange, SetFocusedFrame)
IPC_MESSAGE_HANDLER(CefHostMsg_DidFinishLoad, OnDidFinishLoad)
IPC_MESSAGE_HANDLER(CefHostMsg_LoadingURLChange, OnLoadingURLChange)
IPC_MESSAGE_HANDLER(CefHostMsg_Request, OnRequest)
IPC_MESSAGE_HANDLER(CefHostMsg_Response, OnResponse)
@@ -1670,6 +1656,20 @@ void CefBrowserHostImpl::OnFrameIdentified(int64 frame_id,
GetOrCreateFrame(frame_id, parent_frame_id, is_main_frame, name, GURL());
}
void CefBrowserHostImpl::OnDidFinishLoad(int64 frame_id,
const GURL& validated_url,
bool is_main_frame,
int http_status_code) {
CefRefPtr<CefFrame> frame = GetOrCreateFrame(frame_id,
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, string16(),
validated_url);
// Give internal scheme handlers an opportunity to update content.
scheme::DidFinishLoad(frame, validated_url);
OnLoadEnd(frame, validated_url, http_status_code);
}
void CefBrowserHostImpl::OnLoadingURLChange(const GURL& loading_url) {
base::AutoLock lock_scope(state_lock_);
loading_url_ = loading_url;
@@ -1952,14 +1952,12 @@ void CefBrowserHostImpl::OnLoadError(CefRefPtr<CefFrame> frame,
}
void CefBrowserHostImpl::OnLoadEnd(CefRefPtr<CefFrame> frame,
const GURL& url) {
const GURL& url,
int http_status_code) {
if (client_.get()) {
CefRefPtr<CefLoadHandler> handler = client_->GetLoadHandler();
if (handler.get()) {
// Notify the handler that loading has ended.
// TODO(cef): Identify the HTTP status code.
handler->OnLoadEnd(this, frame, 200);
}
if (handler.get())
handler->OnLoadEnd(this, frame, http_status_code);
}
}