OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 3203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3214 | 3214 |
3215 void RenderFrameImpl::didFinishResourceLoad(blink::WebLocalFrame* frame, | 3215 void RenderFrameImpl::didFinishResourceLoad(blink::WebLocalFrame* frame, |
3216 unsigned identifier) { | 3216 unsigned identifier) { |
3217 DCHECK(!frame_ || frame_ == frame); | 3217 DCHECK(!frame_ || frame_ == frame); |
3218 InternalDocumentStateData* internal_data = | 3218 InternalDocumentStateData* internal_data = |
3219 InternalDocumentStateData::FromDataSource(frame->dataSource()); | 3219 InternalDocumentStateData::FromDataSource(frame->dataSource()); |
3220 if (!internal_data->use_error_page()) | 3220 if (!internal_data->use_error_page()) |
3221 return; | 3221 return; |
3222 | 3222 |
3223 // Do not show error page when DevTools is attached. | 3223 // Do not show error page when DevTools is attached. |
3224 if (render_view_->devtools_agent_->IsAttached()) | 3224 if (render_view_->devtools_agent_ && |
| 3225 render_view_->devtools_agent_->IsAttached()) { |
3225 return; | 3226 return; |
| 3227 } |
3226 | 3228 |
3227 // Display error page, if appropriate. | 3229 // Display error page, if appropriate. |
3228 std::string error_domain = "http"; | 3230 std::string error_domain = "http"; |
3229 int http_status_code = internal_data->http_status_code(); | 3231 int http_status_code = internal_data->http_status_code(); |
3230 if (GetContentClient()->renderer()->HasErrorPage( | 3232 if (GetContentClient()->renderer()->HasErrorPage( |
3231 http_status_code, &error_domain)) { | 3233 http_status_code, &error_domain)) { |
3232 WebURLError error; | 3234 WebURLError error; |
3233 error.unreachableURL = frame->document().url(); | 3235 error.unreachableURL = frame->document().url(); |
3234 error.domain = WebString::fromUTF8(error_domain); | 3236 error.domain = WebString::fromUTF8(error_domain); |
3235 error.reason = http_status_code; | 3237 error.reason = http_status_code; |
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4539 | 4541 |
4540 #if defined(ENABLE_BROWSER_CDMS) | 4542 #if defined(ENABLE_BROWSER_CDMS) |
4541 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4543 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
4542 if (!cdm_manager_) | 4544 if (!cdm_manager_) |
4543 cdm_manager_ = new RendererCdmManager(this); | 4545 cdm_manager_ = new RendererCdmManager(this); |
4544 return cdm_manager_; | 4546 return cdm_manager_; |
4545 } | 4547 } |
4546 #endif // defined(ENABLE_BROWSER_CDMS) | 4548 #endif // defined(ENABLE_BROWSER_CDMS) |
4547 | 4549 |
4548 } // namespace content | 4550 } // namespace content |
OLD | NEW |