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

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: adding comments 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 blink::WebLocalFrame* parent, 248 blink::WebLocalFrame* parent,
249 blink::WebTreeScopeType scope, 249 blink::WebTreeScopeType scope,
250 const blink::WebString& frameName, 250 const blink::WebString& frameName,
251 blink::WebSandboxFlags sandboxFlags) { 251 blink::WebSandboxFlags sandboxFlags) {
252 blink::WebLocalFrame* web_frame = blink::WebLocalFrame::create(scope, this); 252 blink::WebLocalFrame* web_frame = blink::WebLocalFrame::create(scope, this);
253 parent->appendChild(web_frame); 253 parent->appendChild(web_frame);
254 return web_frame; 254 return web_frame;
255 } 255 }
256 256
257 void HTMLDocument::frameDetached(blink::WebFrame* frame) { 257 void HTMLDocument::frameDetached(blink::WebFrame* frame) {
258 frameDetached(frame, DetachType::Remove);
259 }
260
261 void HTMLDocument::frameDetached(blink::WebFrame* frame, DetachType type) {
262 DCHECK(type == DetachType::Remove);
sky 2015/06/02 23:01:40 nit: DCHECK_EQ
258 if (frame->parent()) 263 if (frame->parent())
259 frame->parent()->removeChild(frame); 264 frame->parent()->removeChild(frame);
260 265
261 // |frame| is invalid after here. 266 // |frame| is invalid after here.
262 frame->close(); 267 frame->close();
263 } 268 }
264 269
265 blink::WebCookieJar* HTMLDocument::cookieJar(blink::WebLocalFrame* frame) { 270 blink::WebCookieJar* HTMLDocument::cookieJar(blink::WebLocalFrame* frame) {
266 // TODO(darin): Blink does not fallback to the Platform provided WebCookieJar. 271 // TODO(darin): Blink does not fallback to the Platform provided WebCookieJar.
267 // Either it should, as it once did, or we should find another solution here. 272 // Either it should, as it once did, or we should find another solution here.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 touch_handler_->OnTouchEvent(*event); 355 touch_handler_->OnTouchEvent(*event);
351 return; 356 return;
352 } 357 }
353 scoped_ptr<blink::WebInputEvent> web_event = 358 scoped_ptr<blink::WebInputEvent> web_event =
354 event.To<scoped_ptr<blink::WebInputEvent>>(); 359 event.To<scoped_ptr<blink::WebInputEvent>>();
355 if (web_event) 360 if (web_event)
356 web_view_->handleInputEvent(*web_event); 361 web_view_->handleInputEvent(*web_event);
357 } 362 }
358 363
359 } // namespace html_viewer 364 } // namespace html_viewer
OLDNEW
« no previous file with comments | « components/html_viewer/html_document.h ('k') | components/printing/renderer/print_web_view_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698