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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 #include "core/editing/Editor.h" 107 #include "core/editing/Editor.h"
108 #include "core/editing/FrameSelection.h" 108 #include "core/editing/FrameSelection.h"
109 #include "core/editing/InputMethodController.h" 109 #include "core/editing/InputMethodController.h"
110 #include "core/editing/PlainTextRange.h" 110 #include "core/editing/PlainTextRange.h"
111 #include "core/editing/TextAffinity.h" 111 #include "core/editing/TextAffinity.h"
112 #include "core/editing/iterators/TextIterator.h" 112 #include "core/editing/iterators/TextIterator.h"
113 #include "core/editing/serializers/Serialization.h" 113 #include "core/editing/serializers/Serialization.h"
114 #include "core/editing/spellcheck/SpellChecker.h" 114 #include "core/editing/spellcheck/SpellChecker.h"
115 #include "core/fetch/ResourceFetcher.h" 115 #include "core/fetch/ResourceFetcher.h"
116 #include "core/fetch/SubstituteData.h" 116 #include "core/fetch/SubstituteData.h"
117 #include "core/frame/LocalDOMWindow.h"
117 #include "core/frame/FrameHost.h" 118 #include "core/frame/FrameHost.h"
118 #include "core/frame/FrameView.h" 119 #include "core/frame/FrameView.h"
119 #include "core/frame/LocalDOMWindow.h"
120 #include "core/frame/RemoteFrame.h" 120 #include "core/frame/RemoteFrame.h"
121 #include "core/frame/Settings.h" 121 #include "core/frame/Settings.h"
122 #include "core/frame/UseCounter.h" 122 #include "core/frame/UseCounter.h"
123 #include "core/html/HTMLAnchorElement.h" 123 #include "core/html/HTMLAnchorElement.h"
124 #include "core/html/HTMLCollection.h" 124 #include "core/html/HTMLCollection.h"
125 #include "core/html/HTMLFormElement.h" 125 #include "core/html/HTMLFormElement.h"
126 #include "core/html/HTMLFrameElementBase.h" 126 #include "core/html/HTMLFrameElementBase.h"
127 #include "core/html/HTMLFrameOwnerElement.h" 127 #include "core/html/HTMLFrameOwnerElement.h"
128 #include "core/html/HTMLHeadElement.h" 128 #include "core/html/HTMLHeadElement.h"
129 #include "core/html/HTMLImageElement.h" 129 #include "core/html/HTMLImageElement.h"
130 #include "core/html/HTMLInputElement.h" 130 #include "core/html/HTMLInputElement.h"
131 #include "core/html/HTMLLinkElement.h" 131 #include "core/html/HTMLLinkElement.h"
132 #include "core/html/PluginDocument.h" 132 #include "core/html/PluginDocument.h"
133 #include "core/input/EventHandler.h" 133 #include "core/input/EventHandler.h"
134 #include "core/inspector/ConsoleMessage.h" 134 #include "core/inspector/ConsoleMessage.h"
135 #include "core/layout/HitTestResult.h" 135 #include "core/layout/HitTestResult.h"
136 #include "core/layout/LayoutObject.h" 136 #include "core/layout/LayoutObject.h"
137 #include "core/layout/LayoutPart.h" 137 #include "core/layout/LayoutPart.h"
138 #include "core/layout/api/LayoutViewItem.h" 138 #include "core/layout/api/LayoutViewItem.h"
139 #include "core/style/StyleInheritedData.h"
139 #include "core/loader/DocumentLoader.h" 140 #include "core/loader/DocumentLoader.h"
140 #include "core/loader/FrameLoadRequest.h" 141 #include "core/loader/FrameLoadRequest.h"
141 #include "core/loader/FrameLoader.h" 142 #include "core/loader/FrameLoader.h"
142 #include "core/loader/HistoryItem.h" 143 #include "core/loader/HistoryItem.h"
143 #include "core/loader/MixedContentChecker.h" 144 #include "core/loader/MixedContentChecker.h"
144 #include "core/loader/NavigationScheduler.h" 145 #include "core/loader/NavigationScheduler.h"
145 #include "core/page/FocusController.h" 146 #include "core/page/FocusController.h"
146 #include "core/page/FrameTree.h" 147 #include "core/page/FrameTree.h"
147 #include "core/page/Page.h" 148 #include "core/page/Page.h"
148 #include "core/page/PrintContext.h" 149 #include "core/page/PrintContext.h"
149 #include "core/paint/PaintLayer.h" 150 #include "core/paint/PaintLayer.h"
150 #include "core/paint/TransformRecorder.h" 151 #include "core/paint/TransformRecorder.h"
151 #include "core/style/StyleInheritedData.h"
152 #include "core/timing/DOMWindowPerformance.h" 152 #include "core/timing/DOMWindowPerformance.h"
153 #include "core/timing/Performance.h" 153 #include "core/timing/Performance.h"
154 #include "modules/app_banner/AppBannerController.h" 154 #include "modules/app_banner/AppBannerController.h"
155 #include "modules/audio_output_devices/AudioOutputDeviceClient.h" 155 #include "modules/audio_output_devices/AudioOutputDeviceClient.h"
156 #include "modules/bluetooth/BluetoothSupplement.h" 156 #include "modules/bluetooth/BluetoothSupplement.h"
157 #include "modules/installedapp/InstalledAppController.h" 157 #include "modules/installedapp/InstalledAppController.h"
158 #include "modules/notifications/NotificationPermissionClient.h" 158 #include "modules/notifications/NotificationPermissionClient.h"
159 #include "modules/permissions/PermissionController.h" 159 #include "modules/permissions/PermissionController.h"
160 #include "modules/presentation/PresentationController.h" 160 #include "modules/presentation/PresentationController.h"
161 #include "modules/push_messaging/PushController.h" 161 #include "modules/push_messaging/PushController.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 #include "web/SuspendableScriptExecutor.h" 228 #include "web/SuspendableScriptExecutor.h"
229 #include "web/TextFinder.h" 229 #include "web/TextFinder.h"
230 #include "web/WebDataSourceImpl.h" 230 #include "web/WebDataSourceImpl.h"
231 #include "web/WebDevToolsAgentImpl.h" 231 #include "web/WebDevToolsAgentImpl.h"
232 #include "web/WebFrameWidgetImpl.h" 232 #include "web/WebFrameWidgetImpl.h"
233 #include "web/WebPluginContainerImpl.h" 233 #include "web/WebPluginContainerImpl.h"
234 #include "web/WebRemoteFrameImpl.h" 234 #include "web/WebRemoteFrameImpl.h"
235 #include "web/WebViewImpl.h" 235 #include "web/WebViewImpl.h"
236 #include "wtf/CurrentTime.h" 236 #include "wtf/CurrentTime.h"
237 #include "wtf/HashMap.h" 237 #include "wtf/HashMap.h"
238 #include "wtf/PtrUtil.h"
239 #include <algorithm> 238 #include <algorithm>
240 #include <memory>
241 239
242 namespace blink { 240 namespace blink {
243 241
244 static int frameCount = 0; 242 static int frameCount = 0;
245 243
246 static HeapVector<ScriptSourceCode> createSourcesVector(const WebScriptSource* s ourcesIn, unsigned numSources) 244 static HeapVector<ScriptSourceCode> createSourcesVector(const WebScriptSource* s ourcesIn, unsigned numSources)
247 { 245 {
248 HeapVector<ScriptSourceCode> sources; 246 HeapVector<ScriptSourceCode> sources;
249 sources.append(sourcesIn, numSources); 247 sources.append(sourcesIn, numSources);
250 return sources; 248 return sources;
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 489
492 static WebDataSource* DataSourceForDocLoader(DocumentLoader* loader) 490 static WebDataSource* DataSourceForDocLoader(DocumentLoader* loader)
493 { 491 {
494 return loader ? WebDataSourceImpl::fromDocumentLoader(loader) : 0; 492 return loader ? WebDataSourceImpl::fromDocumentLoader(loader) : 0;
495 } 493 }
496 494
497 // WebSuspendableTaskWrapper -------------------------------------------------- 495 // WebSuspendableTaskWrapper --------------------------------------------------
498 496
499 class WebSuspendableTaskWrapper: public SuspendableTask { 497 class WebSuspendableTaskWrapper: public SuspendableTask {
500 public: 498 public:
501 static std::unique_ptr<WebSuspendableTaskWrapper> create(std::unique_ptr<Web SuspendableTask> task) 499 static PassOwnPtr<WebSuspendableTaskWrapper> create(PassOwnPtr<WebSuspendabl eTask> task)
502 { 500 {
503 return wrapUnique(new WebSuspendableTaskWrapper(std::move(task))); 501 return adoptPtr(new WebSuspendableTaskWrapper(std::move(task)));
504 } 502 }
505 503
506 void run() override 504 void run() override
507 { 505 {
508 m_task->run(); 506 m_task->run();
509 } 507 }
510 508
511 void contextDestroyed() override 509 void contextDestroyed() override
512 { 510 {
513 m_task->contextDestroyed(); 511 m_task->contextDestroyed();
514 } 512 }
515 513
516 private: 514 private:
517 explicit WebSuspendableTaskWrapper(std::unique_ptr<WebSuspendableTask> task) 515 explicit WebSuspendableTaskWrapper(PassOwnPtr<WebSuspendableTask> task)
518 : m_task(std::move(task)) 516 : m_task(std::move(task))
519 { 517 {
520 } 518 }
521 519
522 std::unique_ptr<WebSuspendableTask> m_task; 520 OwnPtr<WebSuspendableTask> m_task;
523 }; 521 };
524 522
525 // WebFrame ------------------------------------------------------------------- 523 // WebFrame -------------------------------------------------------------------
526 524
527 int WebFrame::instanceCount() 525 int WebFrame::instanceCount()
528 { 526 {
529 return frameCount; 527 return frameCount;
530 } 528 }
531 529
532 WebLocalFrame* WebLocalFrame::frameForCurrentContext() 530 WebLocalFrame* WebLocalFrame::frameForCurrentContext()
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after
1942 if (!RuntimeEnabledFeatures::appBannerEnabled() || !frame()) 1940 if (!RuntimeEnabledFeatures::appBannerEnabled() || !frame())
1943 return; 1941 return;
1944 1942
1945 AppBannerController::willShowInstallBannerPrompt(requestId, client()->appBan nerClient(), frame(), platforms, reply); 1943 AppBannerController::willShowInstallBannerPrompt(requestId, client()->appBan nerClient(), frame(), platforms, reply);
1946 } 1944 }
1947 1945
1948 void WebLocalFrameImpl::requestRunTask(WebSuspendableTask* task) const 1946 void WebLocalFrameImpl::requestRunTask(WebSuspendableTask* task) const
1949 { 1947 {
1950 DCHECK(frame()); 1948 DCHECK(frame());
1951 DCHECK(frame()->document()); 1949 DCHECK(frame()->document());
1952 frame()->document()->postSuspendableTask(WebSuspendableTaskWrapper::create(w rapUnique(task))); 1950 frame()->document()->postSuspendableTask(WebSuspendableTaskWrapper::create(a doptPtr(task)));
1953 } 1951 }
1954 1952
1955 void WebLocalFrameImpl::didCallAddSearchProvider() 1953 void WebLocalFrameImpl::didCallAddSearchProvider()
1956 { 1954 {
1957 UseCounter::count(frame(), UseCounter::ExternalAddSearchProvider); 1955 UseCounter::count(frame(), UseCounter::ExternalAddSearchProvider);
1958 } 1956 }
1959 1957
1960 void WebLocalFrameImpl::didCallIsSearchProviderInstalled() 1958 void WebLocalFrameImpl::didCallIsSearchProviderInstalled()
1961 { 1959 {
1962 UseCounter::count(frame(), UseCounter::ExternalIsSearchProviderInstalled); 1960 UseCounter::count(frame(), UseCounter::ExternalIsSearchProviderInstalled);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 { 2114 {
2117 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); 2115 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags));
2118 } 2116 }
2119 2117
2120 void WebLocalFrameImpl::clearActiveFindMatch() 2118 void WebLocalFrameImpl::clearActiveFindMatch()
2121 { 2119 {
2122 ensureTextFinder().clearActiveFindMatch(); 2120 ensureTextFinder().clearActiveFindMatch();
2123 } 2121 }
2124 2122
2125 } // namespace blink 2123 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.h ('k') | third_party/WebKit/Source/web/WebNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698