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

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

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. 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"
118 #include "core/frame/FrameHost.h" 117 #include "core/frame/FrameHost.h"
119 #include "core/frame/FrameView.h" 118 #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"
140 #include "core/loader/DocumentLoader.h" 139 #include "core/loader/DocumentLoader.h"
141 #include "core/loader/FrameLoadRequest.h" 140 #include "core/loader/FrameLoadRequest.h"
142 #include "core/loader/FrameLoader.h" 141 #include "core/loader/FrameLoader.h"
143 #include "core/loader/HistoryItem.h" 142 #include "core/loader/HistoryItem.h"
144 #include "core/loader/MixedContentChecker.h" 143 #include "core/loader/MixedContentChecker.h"
145 #include "core/loader/NavigationScheduler.h" 144 #include "core/loader/NavigationScheduler.h"
146 #include "core/page/FocusController.h" 145 #include "core/page/FocusController.h"
147 #include "core/page/FrameTree.h" 146 #include "core/page/FrameTree.h"
148 #include "core/page/Page.h" 147 #include "core/page/Page.h"
149 #include "core/page/PrintContext.h" 148 #include "core/page/PrintContext.h"
150 #include "core/paint/PaintLayer.h" 149 #include "core/paint/PaintLayer.h"
151 #include "core/paint/TransformRecorder.h" 150 #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"
238 #include <algorithm> 239 #include <algorithm>
240 #include <memory>
239 241
240 namespace blink { 242 namespace blink {
241 243
242 static int frameCount = 0; 244 static int frameCount = 0;
243 245
244 static HeapVector<ScriptSourceCode> createSourcesVector(const WebScriptSource* s ourcesIn, unsigned numSources) 246 static HeapVector<ScriptSourceCode> createSourcesVector(const WebScriptSource* s ourcesIn, unsigned numSources)
245 { 247 {
246 HeapVector<ScriptSourceCode> sources; 248 HeapVector<ScriptSourceCode> sources;
247 sources.append(sourcesIn, numSources); 249 sources.append(sourcesIn, numSources);
248 return sources; 250 return sources;
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 491
490 static WebDataSource* DataSourceForDocLoader(DocumentLoader* loader) 492 static WebDataSource* DataSourceForDocLoader(DocumentLoader* loader)
491 { 493 {
492 return loader ? WebDataSourceImpl::fromDocumentLoader(loader) : 0; 494 return loader ? WebDataSourceImpl::fromDocumentLoader(loader) : 0;
493 } 495 }
494 496
495 // WebSuspendableTaskWrapper -------------------------------------------------- 497 // WebSuspendableTaskWrapper --------------------------------------------------
496 498
497 class WebSuspendableTaskWrapper: public SuspendableTask { 499 class WebSuspendableTaskWrapper: public SuspendableTask {
498 public: 500 public:
499 static PassOwnPtr<WebSuspendableTaskWrapper> create(PassOwnPtr<WebSuspendabl eTask> task) 501 static std::unique_ptr<WebSuspendableTaskWrapper> create(std::unique_ptr<Web SuspendableTask> task)
500 { 502 {
501 return adoptPtr(new WebSuspendableTaskWrapper(std::move(task))); 503 return wrapUnique(new WebSuspendableTaskWrapper(std::move(task)));
502 } 504 }
503 505
504 void run() override 506 void run() override
505 { 507 {
506 m_task->run(); 508 m_task->run();
507 } 509 }
508 510
509 void contextDestroyed() override 511 void contextDestroyed() override
510 { 512 {
511 m_task->contextDestroyed(); 513 m_task->contextDestroyed();
512 } 514 }
513 515
514 private: 516 private:
515 explicit WebSuspendableTaskWrapper(PassOwnPtr<WebSuspendableTask> task) 517 explicit WebSuspendableTaskWrapper(std::unique_ptr<WebSuspendableTask> task)
516 : m_task(std::move(task)) 518 : m_task(std::move(task))
517 { 519 {
518 } 520 }
519 521
520 OwnPtr<WebSuspendableTask> m_task; 522 std::unique_ptr<WebSuspendableTask> m_task;
521 }; 523 };
522 524
523 // WebFrame ------------------------------------------------------------------- 525 // WebFrame -------------------------------------------------------------------
524 526
525 int WebFrame::instanceCount() 527 int WebFrame::instanceCount()
526 { 528 {
527 return frameCount; 529 return frameCount;
528 } 530 }
529 531
530 WebLocalFrame* WebLocalFrame::frameForCurrentContext() 532 WebLocalFrame* WebLocalFrame::frameForCurrentContext()
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after
1940 if (!RuntimeEnabledFeatures::appBannerEnabled() || !frame()) 1942 if (!RuntimeEnabledFeatures::appBannerEnabled() || !frame())
1941 return; 1943 return;
1942 1944
1943 AppBannerController::willShowInstallBannerPrompt(requestId, client()->appBan nerClient(), frame(), platforms, reply); 1945 AppBannerController::willShowInstallBannerPrompt(requestId, client()->appBan nerClient(), frame(), platforms, reply);
1944 } 1946 }
1945 1947
1946 void WebLocalFrameImpl::requestRunTask(WebSuspendableTask* task) const 1948 void WebLocalFrameImpl::requestRunTask(WebSuspendableTask* task) const
1947 { 1949 {
1948 DCHECK(frame()); 1950 DCHECK(frame());
1949 DCHECK(frame()->document()); 1951 DCHECK(frame()->document());
1950 frame()->document()->postSuspendableTask(WebSuspendableTaskWrapper::create(a doptPtr(task))); 1952 frame()->document()->postSuspendableTask(WebSuspendableTaskWrapper::create(w rapUnique(task)));
1951 } 1953 }
1952 1954
1953 void WebLocalFrameImpl::didCallAddSearchProvider() 1955 void WebLocalFrameImpl::didCallAddSearchProvider()
1954 { 1956 {
1955 UseCounter::count(frame(), UseCounter::ExternalAddSearchProvider); 1957 UseCounter::count(frame(), UseCounter::ExternalAddSearchProvider);
1956 } 1958 }
1957 1959
1958 void WebLocalFrameImpl::didCallIsSearchProviderInstalled() 1960 void WebLocalFrameImpl::didCallIsSearchProviderInstalled()
1959 { 1961 {
1960 UseCounter::count(frame(), UseCounter::ExternalIsSearchProviderInstalled); 1962 UseCounter::count(frame(), UseCounter::ExternalIsSearchProviderInstalled);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
2114 { 2116 {
2115 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); 2117 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags));
2116 } 2118 }
2117 2119
2118 void WebLocalFrameImpl::clearActiveFindMatch() 2120 void WebLocalFrameImpl::clearActiveFindMatch()
2119 { 2121 {
2120 ensureTextFinder().clearActiveFindMatch(); 2122 ensureTextFinder().clearActiveFindMatch();
2121 } 2123 }
2122 2124
2123 } // namespace blink 2125 } // 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