Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: components/html_viewer/html_document.cc

Issue 1149793002: Detach old frame on WebFrame::swap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: print Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "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"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 blink::WebLocalFrame* parent, 266 blink::WebLocalFrame* parent,
267 blink::WebTreeScopeType scope, 267 blink::WebTreeScopeType scope,
268 const blink::WebString& frameName, 268 const blink::WebString& frameName,
269 blink::WebSandboxFlags sandboxFlags) { 269 blink::WebSandboxFlags sandboxFlags) {
270 blink::WebLocalFrame* web_frame = blink::WebLocalFrame::create(scope, this); 270 blink::WebLocalFrame* web_frame = blink::WebLocalFrame::create(scope, this);
271 parent->appendChild(web_frame); 271 parent->appendChild(web_frame);
272 return web_frame; 272 return web_frame;
273 } 273 }
274 274
275 void HTMLDocument::frameDetached(blink::WebFrame* frame) { 275 void HTMLDocument::frameDetached(blink::WebFrame* frame) {
276 frameDetached(frame, blink::WebDetachReason::Remove);
dcheng 2015/06/01 21:15:54 Once this is defined inside WebFrameClient, we sho
277 }
278
279 void HTMLDocument::frameDetached(blink::WebFrame* frame,
280 blink::WebDetachReason reason) {
281 DCHECK(reason == blink::WebDetachReason::Remove);
dcheng 2015/06/01 21:15:54 DCHECK_EQ
276 if (frame->parent()) 282 if (frame->parent())
277 frame->parent()->removeChild(frame); 283 frame->parent()->removeChild(frame);
278 284
279 // |frame| is invalid after here. 285 // |frame| is invalid after here.
280 frame->close(); 286 frame->close();
281 } 287 }
282 288
283 blink::WebCookieJar* HTMLDocument::cookieJar(blink::WebLocalFrame* frame) { 289 blink::WebCookieJar* HTMLDocument::cookieJar(blink::WebLocalFrame* frame) {
284 // TODO(darin): Blink does not fallback to the Platform provided WebCookieJar. 290 // TODO(darin): Blink does not fallback to the Platform provided WebCookieJar.
285 // Either it should, as it once did, or we should find another solution here. 291 // Either it should, as it once did, or we should find another solution here.
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 return media_permission_.get(); 397 return media_permission_.get();
392 } 398 }
393 399
394 media::CdmFactory* HTMLDocument::GetCdmFactory() { 400 media::CdmFactory* HTMLDocument::GetCdmFactory() {
395 if (!cdm_factory_) 401 if (!cdm_factory_)
396 cdm_factory_.reset(new media::DefaultCdmFactory()); 402 cdm_factory_.reset(new media::DefaultCdmFactory());
397 return cdm_factory_.get(); 403 return cdm_factory_.get();
398 } 404 }
399 405
400 } // namespace html_viewer 406 } // namespace html_viewer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698