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

Side by Side Diff: Source/core/html/forms/FormController.cpp

Issue 277753003: Oilpan: Prepare to move FormController and DocumentState to Oilpan heap, and remove RefPtrs to HTML… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010, 2011, 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2010, 2011, 2012 Google Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 } 367 }
368 368
369 void FormKeyGenerator::willDeleteForm(HTMLFormElement* form) 369 void FormKeyGenerator::willDeleteForm(HTMLFormElement* form)
370 { 370 {
371 ASSERT(form); 371 ASSERT(form);
372 m_formToKeyMap.remove(form); 372 m_formToKeyMap.remove(form);
373 } 373 }
374 374
375 // ---------------------------------------------------------------------------- 375 // ----------------------------------------------------------------------------
376 376
377 PassRefPtr<DocumentState> DocumentState::create() 377 PassRefPtrWillBeRawPtr<DocumentState> DocumentState::create()
378 { 378 {
379 return adoptRef(new DocumentState); 379 return adoptRefWillBeNoop(new DocumentState);
380 } 380 }
381 381
382 DocumentState::~DocumentState() 382 DocumentState::~DocumentState()
383 { 383 {
384 } 384 }
385 385
386 void DocumentState::trace(Visitor* visitor)
387 {
388 visitor->trace(m_formControls);
389 }
390
386 void DocumentState::addControl(HTMLFormControlElementWithState* control) 391 void DocumentState::addControl(HTMLFormControlElementWithState* control)
387 { 392 {
388 ASSERT(!m_formControls.contains(control)); 393 ASSERT(!m_formControls.contains(control));
389 m_formControls.add(control); 394 m_formControls.add(control);
390 } 395 }
391 396
392 void DocumentState::removeControl(HTMLFormControlElementWithState* control) 397 void DocumentState::removeControl(HTMLFormControlElementWithState* control)
393 { 398 {
394 RELEASE_ASSERT(m_formControls.contains(control)); 399 RELEASE_ASSERT(m_formControls.contains(control));
395 m_formControls.remove(control); 400 m_formControls.remove(control);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 441
437 FormController::FormController() 442 FormController::FormController()
438 : m_documentState(DocumentState::create()) 443 : m_documentState(DocumentState::create())
439 { 444 {
440 } 445 }
441 446
442 FormController::~FormController() 447 FormController::~FormController()
443 { 448 {
444 } 449 }
445 450
451 void FormController::trace(Visitor* visitor)
452 {
453 visitor->trace(m_documentState);
454 }
455
446 DocumentState* FormController::formElementsState() const 456 DocumentState* FormController::formElementsState() const
447 { 457 {
448 return m_documentState.get(); 458 return m_documentState.get();
449 } 459 }
450 460
451 void FormController::setStateForNewFormElements(const Vector<String>& stateVecto r) 461 void FormController::setStateForNewFormElements(const Vector<String>& stateVecto r)
452 { 462 {
453 formStatesFromStateVector(stateVector, m_savedFormStateMap); 463 formStatesFromStateVector(stateVector, m_savedFormStateMap);
454 } 464 }
455 465
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 { 550 {
541 m_documentState->addControl(&control); 551 m_documentState->addControl(&control);
542 } 552 }
543 553
544 void FormController::unregisterStatefulFormControl(HTMLFormControlElementWithSta te& control) 554 void FormController::unregisterStatefulFormControl(HTMLFormControlElementWithSta te& control)
545 { 555 {
546 m_documentState->removeControl(&control); 556 m_documentState->removeControl(&control);
547 } 557 }
548 558
549 } // namespace WebCore 559 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698