Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 |
| 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 "components/html_viewer/html_document.h" | 5 #include "components/html_viewer/html_document.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| 11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 blink::WebLocalFrame* parent, | 269 blink::WebLocalFrame* parent, |
| 270 blink::WebTreeScopeType scope, | 270 blink::WebTreeScopeType scope, |
| 271 const blink::WebString& frameName, | 271 const blink::WebString& frameName, |
| 272 blink::WebSandboxFlags sandboxFlags) { | 272 blink::WebSandboxFlags sandboxFlags) { |
| 273 blink::WebLocalFrame* web_frame = blink::WebLocalFrame::create(scope, this); | 273 blink::WebLocalFrame* web_frame = blink::WebLocalFrame::create(scope, this); |
| 274 parent->appendChild(web_frame); | 274 parent->appendChild(web_frame); |
| 275 return web_frame; | 275 return web_frame; |
| 276 } | 276 } |
| 277 | 277 |
| 278 void HTMLDocument::frameDetached(blink::WebFrame* frame) { | 278 void HTMLDocument::frameDetached(blink::WebFrame* frame) { |
| 279 frameDetached(frame, blink::WebFrameClient::DetachType::Remove); | |
|
dcheng
2015/06/01 21:15:54
Ditto. DetachType::Remove should work. Similar com
lfg
2015/06/01 21:34:19
Done.
| |
| 280 } | |
| 281 | |
| 282 void HTMLDocument::frameDetached(blink::WebFrame* frame, | |
| 283 blink::DetachType type) { | |
| 284 DCHECK(type == blink::DetachType::Remove); | |
|
dcheng
2015/06/01 21:15:54
DCHECK_EQ(DetatchType::Remove, type) here and else
lfg
2015/06/01 21:34:19
Yes, this assert is here because we don't support
| |
| 279 if (frame->parent()) | 285 if (frame->parent()) |
| 280 frame->parent()->removeChild(frame); | 286 frame->parent()->removeChild(frame); |
| 281 | 287 |
| 282 // |frame| is invalid after here. | 288 // |frame| is invalid after here. |
| 283 frame->close(); | 289 frame->close(); |
| 284 } | 290 } |
| 285 | 291 |
| 286 blink::WebCookieJar* HTMLDocument::cookieJar(blink::WebLocalFrame* frame) { | 292 blink::WebCookieJar* HTMLDocument::cookieJar(blink::WebLocalFrame* frame) { |
| 287 // TODO(darin): Blink does not fallback to the Platform provided WebCookieJar. | 293 // TODO(darin): Blink does not fallback to the Platform provided WebCookieJar. |
| 288 // Either it should, as it once did, or we should find another solution here. | 294 // Either it should, as it once did, or we should find another solution here. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 388 return media_permission_.get(); | 394 return media_permission_.get(); |
| 389 } | 395 } |
| 390 | 396 |
| 391 media::CdmFactory* HTMLDocument::GetCdmFactory() { | 397 media::CdmFactory* HTMLDocument::GetCdmFactory() { |
| 392 if (!cdm_factory_) | 398 if (!cdm_factory_) |
| 393 cdm_factory_.reset(new media::DefaultCdmFactory()); | 399 cdm_factory_.reset(new media::DefaultCdmFactory()); |
| 394 return cdm_factory_.get(); | 400 return cdm_factory_.get(); |
| 395 } | 401 } |
| 396 | 402 |
| 397 } // namespace html_viewer | 403 } // namespace html_viewer |
| OLD | NEW |