| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 #ifndef NDEBUG | 370 #ifndef NDEBUG |
| 371 typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<Document> > WeakDocumentSet; | 371 typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<Document> > WeakDocumentSet; |
| 372 static WeakDocumentSet& liveDocumentSet() | 372 static WeakDocumentSet& liveDocumentSet() |
| 373 { | 373 { |
| 374 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WeakDocumentSet>, set, (adoptPtrW
illBeNoop(new WeakDocumentSet()))); | 374 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WeakDocumentSet>, set, (adoptPtrW
illBeNoop(new WeakDocumentSet()))); |
| 375 return *set; | 375 return *set; |
| 376 } | 376 } |
| 377 #endif | 377 #endif |
| 378 | 378 |
| 379 // This class doesn't work with non-Document ExecutionContext. | 379 // This class doesn't work with non-Document ExecutionContext. |
| 380 class AutofocusTask FINAL : public ExecutionContextTask { | 380 class AutofocusTask final : public ExecutionContextTask { |
| 381 public: | 381 public: |
| 382 static PassOwnPtr<AutofocusTask> create() | 382 static PassOwnPtr<AutofocusTask> create() |
| 383 { | 383 { |
| 384 return adoptPtr(new AutofocusTask()); | 384 return adoptPtr(new AutofocusTask()); |
| 385 } | 385 } |
| 386 virtual ~AutofocusTask() { } | 386 virtual ~AutofocusTask() { } |
| 387 | 387 |
| 388 private: | 388 private: |
| 389 AutofocusTask() { } | 389 AutofocusTask() { } |
| 390 virtual void performTask(ExecutionContext* context) OVERRIDE | 390 virtual void performTask(ExecutionContext* context) override |
| 391 { | 391 { |
| 392 Document* document = toDocument(context); | 392 Document* document = toDocument(context); |
| 393 if (RefPtrWillBeRawPtr<Element> element = document->autofocusElement())
{ | 393 if (RefPtrWillBeRawPtr<Element> element = document->autofocusElement())
{ |
| 394 document->setAutofocusElement(0); | 394 document->setAutofocusElement(0); |
| 395 element->focus(); | 395 element->focus(); |
| 396 } | 396 } |
| 397 } | 397 } |
| 398 }; | 398 }; |
| 399 | 399 |
| 400 DocumentVisibilityObserver::DocumentVisibilityObserver(Document& document) | 400 DocumentVisibilityObserver::DocumentVisibilityObserver(Document& document) |
| (...skipping 5453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5854 using namespace blink; | 5854 using namespace blink; |
| 5855 void showLiveDocumentInstances() | 5855 void showLiveDocumentInstances() |
| 5856 { | 5856 { |
| 5857 WeakDocumentSet& set = liveDocumentSet(); | 5857 WeakDocumentSet& set = liveDocumentSet(); |
| 5858 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5858 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 5859 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it
) { | 5859 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it
) { |
| 5860 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut
f8().data()); | 5860 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut
f8().data()); |
| 5861 } | 5861 } |
| 5862 } | 5862 } |
| 5863 #endif | 5863 #endif |
| OLD | NEW |