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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2811863002: Move ScriptState::GetExecutionContext (Part 4) (Closed)
Patch Set: Fix Document.cpp Created 3 years, 8 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 /* 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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 4505 matching lines...) Expand 10 before | Expand all | Expand 10 after
4516 void Document::RegisterEventFactory( 4516 void Document::RegisterEventFactory(
4517 std::unique_ptr<EventFactoryBase> event_factory) { 4517 std::unique_ptr<EventFactoryBase> event_factory) {
4518 DCHECK(!EventFactories().Contains(event_factory.get())); 4518 DCHECK(!EventFactories().Contains(event_factory.get()));
4519 EventFactories().insert(std::move(event_factory)); 4519 EventFactories().insert(std::move(event_factory));
4520 } 4520 }
4521 4521
4522 Event* Document::createEvent(ScriptState* script_state, 4522 Event* Document::createEvent(ScriptState* script_state,
4523 const String& event_type, 4523 const String& event_type,
4524 ExceptionState& exception_state) { 4524 ExceptionState& exception_state) {
4525 Event* event = nullptr; 4525 Event* event = nullptr;
4526 ExecutionContext* execution_context = script_state->GetExecutionContext(); 4526 ExecutionContext* execution_context = ExecutionContext::From(script_state);
4527 for (const auto& factory : EventFactories()) { 4527 for (const auto& factory : EventFactories()) {
4528 event = factory->Create(execution_context, event_type); 4528 event = factory->Create(execution_context, event_type);
4529 if (event) { 4529 if (event) {
4530 // createEvent for TouchEvent should throw DOM exception if touch event 4530 // createEvent for TouchEvent should throw DOM exception if touch event
4531 // feature detection is not enabled. See crbug.com/392584#c22 4531 // feature detection is not enabled. See crbug.com/392584#c22
4532 if (DeprecatedEqualIgnoringCase(event_type, "TouchEvent") && 4532 if (DeprecatedEqualIgnoringCase(event_type, "TouchEvent") &&
4533 !RuntimeEnabledFeatures::touchEventFeatureDetectionEnabled()) 4533 !RuntimeEnabledFeatures::touchEventFeatureDetectionEnabled())
4534 break; 4534 break;
4535 return event; 4535 return event;
4536 } 4536 }
(...skipping 2127 matching lines...) Expand 10 before | Expand all | Expand 10 after
6664 } 6664 }
6665 6665
6666 void showLiveDocumentInstances() { 6666 void showLiveDocumentInstances() {
6667 WeakDocumentSet& set = liveDocumentSet(); 6667 WeakDocumentSet& set = liveDocumentSet();
6668 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6668 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6669 for (blink::Document* document : set) 6669 for (blink::Document* document : set)
6670 fprintf(stderr, "- Document %p URL: %s\n", document, 6670 fprintf(stderr, "- Document %p URL: %s\n", document,
6671 document->Url().GetString().Utf8().Data()); 6671 document->Url().GetString().Utf8().Data());
6672 } 6672 }
6673 #endif 6673 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFace.cpp ('k') | third_party/WebKit/Source/core/dom/MessagePort.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698