summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authoryurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 15:08:28 +0000
committeryurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 15:08:28 +0000
commit617e7516c430fff771bd35a3962cabf96504f95d (patch)
tree0b34d7e87913a1dade9097dce55f97bb0c822c51 /webkit
parent9e6cd27dfb4ae8651fcbf0c7333c843c32aa07a8 (diff)
downloadchromium_src-617e7516c430fff771bd35a3962cabf96504f95d.zip
chromium_src-617e7516c430fff771bd35a3962cabf96504f95d.tar.gz
chromium_src-617e7516c430fff771bd35a3962cabf96504f95d.tar.bz2
Check that frame has not been closed when getting DevToolsAgent.
Updated test expectations. The test that used to crash is failing on Linux(it is already expected to crash or fail on Win and Mac). BUG=29339 Review URL: http://codereview.chromium.org/460072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/webplugin_impl.cc22
-rw-r--r--webkit/glue/webplugin_impl.h4
-rw-r--r--webkit/tools/layout_tests/test_expectations.txt2
3 files changed, 20 insertions, 8 deletions
diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc
index c0c035d..a3148b1 100644
--- a/webkit/glue/webplugin_impl.cc
+++ b/webkit/glue/webplugin_impl.cc
@@ -703,7 +703,7 @@ void WebPluginImpl::didReceiveResponse(WebURLLoader* loader,
response_info.last_modified,
request_is_seekable);
- if (WebDevToolsAgent* devtools_agent = webframe_->view()->devToolsAgent()) {
+ if (WebDevToolsAgent* devtools_agent = GetDevToolsAgent()) {
ClientInfo* client_info = GetClientInfoFromLoader(loader);
if (client_info)
devtools_agent->didReceiveResponse(client_info->id, response);
@@ -745,7 +745,7 @@ void WebPluginImpl::didReceiveData(WebURLLoader* loader,
client->DidReceiveData(buffer, length, 0);
}
- if (WebDevToolsAgent* devtools_agent = webframe_->view()->devToolsAgent()) {
+ if (WebDevToolsAgent* devtools_agent = GetDevToolsAgent()) {
ClientInfo* client_info = GetClientInfoFromLoader(loader);
if (client_info)
devtools_agent->didReceiveData(client_info->id, length);
@@ -770,7 +770,7 @@ void WebPluginImpl::didFinishLoading(WebURLLoader* loader) {
client_info->client = NULL;
resource_client->DidFinishLoading();
- if (WebDevToolsAgent* devtools_agent = webframe_->view()->devToolsAgent())
+ if (WebDevToolsAgent* devtools_agent = GetDevToolsAgent())
devtools_agent->didFinishLoading(client_info->id);
}
}
@@ -786,7 +786,7 @@ void WebPluginImpl::didFail(WebURLLoader* loader,
client_info->client = NULL;
resource_client->DidFail();
- if (WebDevToolsAgent* devtools_agent = webframe_->view()->devToolsAgent())
+ if (WebDevToolsAgent* devtools_agent = GetDevToolsAgent())
devtools_agent->didFailLoading(client_info->id, error);
}
}
@@ -928,7 +928,7 @@ bool WebPluginImpl::InitiateHTTPRequest(unsigned long resource_id,
// Sets the routing id to associate the ResourceRequest with the RenderView.
webframe_->dispatchWillSendRequest(info.request);
- if (WebDevToolsAgent* devtools_agent = webframe_->view()->devToolsAgent()) {
+ if (WebDevToolsAgent* devtools_agent = GetDevToolsAgent()) {
devtools_agent->identifierForInitialRequest(resource_id, webframe_,
info.request);
devtools_agent->willSendRequest(resource_id, info.request);
@@ -991,8 +991,7 @@ void WebPluginImpl::SetDeferResourceLoading(unsigned long resource_id,
resource_client->DidFail();
// Report that resource loading finished.
- WebDevToolsAgent* devtools_agent = webframe_->view()->devToolsAgent();
- if (devtools_agent)
+ if (WebDevToolsAgent* devtools_agent = GetDevToolsAgent())
devtools_agent->didFinishLoading(resource_id);
}
break;
@@ -1122,4 +1121,13 @@ void WebPluginImpl::SetReferrer(WebKit::WebURLRequest* request,
}
}
+WebDevToolsAgent* WebPluginImpl::GetDevToolsAgent() {
+ if (!webframe_)
+ return NULL;
+ WebView* view = webframe_->view();
+ if (!view)
+ return NULL;
+ return view->devToolsAgent();
+}
+
} // namespace webkit_glue
diff --git a/webkit/glue/webplugin_impl.h b/webkit/glue/webplugin_impl.h
index 7ed3e6f..f4e1108 100644
--- a/webkit/glue/webplugin_impl.h
+++ b/webkit/glue/webplugin_impl.h
@@ -25,6 +25,7 @@
class WebViewDelegate;
namespace WebKit {
+class WebDevToolsAgent;
class WebFrame;
class WebPluginContainer;
class WebURLResponse;
@@ -244,6 +245,9 @@ class WebPluginImpl : public WebPlugin,
// Helper function to set the referrer on the request passed in.
void SetReferrer(WebKit::WebURLRequest* request, Referrer referrer_flag);
+ // Returns DevToolsAgent for the frame or 0.
+ WebKit::WebDevToolsAgent* GetDevToolsAgent();
+
std::vector<ClientInfo> clients_;
bool windowless_;
diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt
index 00092b8..3b00f3b 100644
--- a/webkit/tools/layout_tests/test_expectations.txt
+++ b/webkit/tools/layout_tests/test_expectations.txt
@@ -1386,7 +1386,7 @@ BUG10666 LINUX : chrome/fast/forms/basic-selects.html = FAIL
// These tests are marked as failing on Linux because they depend on QuickTime.
// See the bug for more discussion.
BUG15797 LINUX : LayoutTests/fast/dom/object-embed-plugin-scripting.html = FAIL
-BUG15797 LINUX : LayoutTests/plugins/embed-attributes-setting.html = PASS CRASH
+BUG15797 LINUX : LayoutTests/plugins/embed-attributes-setting.html = FAIL CRASH
// Depends on plugin support.
BUG10351 MAC : LayoutTests/fast/dom/object-embed-plugin-scripting.html = PASS FAIL