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

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

Issue 1830883002: Add blink::ServiceRegistry and expose it from LocalFrame and Platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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) 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 #include "platform/graphics/paint/DrawingRecorder.h" 178 #include "platform/graphics/paint/DrawingRecorder.h"
179 #include "platform/graphics/paint/SkPictureBuilder.h" 179 #include "platform/graphics/paint/SkPictureBuilder.h"
180 #include "platform/graphics/skia/SkiaUtils.h" 180 #include "platform/graphics/skia/SkiaUtils.h"
181 #include "platform/heap/Handle.h" 181 #include "platform/heap/Handle.h"
182 #include "platform/network/ResourceRequest.h" 182 #include "platform/network/ResourceRequest.h"
183 #include "platform/scroll/ScrollTypes.h" 183 #include "platform/scroll/ScrollTypes.h"
184 #include "platform/scroll/ScrollbarTheme.h" 184 #include "platform/scroll/ScrollbarTheme.h"
185 #include "platform/weborigin/KURL.h" 185 #include "platform/weborigin/KURL.h"
186 #include "platform/weborigin/SchemeRegistry.h" 186 #include "platform/weborigin/SchemeRegistry.h"
187 #include "platform/weborigin/SecurityPolicy.h" 187 #include "platform/weborigin/SecurityPolicy.h"
188 #include "public/platform/ServiceRegistry.h"
188 #include "public/platform/WebFloatPoint.h" 189 #include "public/platform/WebFloatPoint.h"
189 #include "public/platform/WebFloatRect.h" 190 #include "public/platform/WebFloatRect.h"
190 #include "public/platform/WebLayer.h" 191 #include "public/platform/WebLayer.h"
191 #include "public/platform/WebPoint.h" 192 #include "public/platform/WebPoint.h"
192 #include "public/platform/WebRect.h" 193 #include "public/platform/WebRect.h"
193 #include "public/platform/WebSecurityOrigin.h" 194 #include "public/platform/WebSecurityOrigin.h"
194 #include "public/platform/WebSize.h" 195 #include "public/platform/WebSize.h"
195 #include "public/platform/WebSuspendableTask.h" 196 #include "public/platform/WebSuspendableTask.h"
196 #include "public/platform/WebURLError.h" 197 #include "public/platform/WebURLError.h"
197 #include "public/platform/WebVector.h" 198 #include "public/platform/WebVector.h"
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 RawPtr<WebLocalFrameImpl> webFrame = new WebLocalFrameImpl(oldWebFrame, clie nt); 1421 RawPtr<WebLocalFrameImpl> webFrame = new WebLocalFrameImpl(oldWebFrame, clie nt);
1421 Frame* oldFrame = oldWebFrame->toImplBase()->frame(); 1422 Frame* oldFrame = oldWebFrame->toImplBase()->frame();
1422 webFrame->setParent(oldWebFrame->parent()); 1423 webFrame->setParent(oldWebFrame->parent());
1423 webFrame->setOpener(oldWebFrame->opener()); 1424 webFrame->setOpener(oldWebFrame->opener());
1424 // Note: this *always* temporarily sets a frame owner, even for main frames! 1425 // Note: this *always* temporarily sets a frame owner, even for main frames!
1425 // When a core Frame is created with no owner, it attempts to set itself as 1426 // When a core Frame is created with no owner, it attempts to set itself as
1426 // the main frame of the Page. However, this is a provisional frame, and may 1427 // the main frame of the Page. However, this is a provisional frame, and may
1427 // disappear, so Page::m_mainFrame can't be updated just yet. 1428 // disappear, so Page::m_mainFrame can't be updated just yet.
1428 RawPtr<FrameOwner> tempOwner = DummyFrameOwner::create(); 1429 RawPtr<FrameOwner> tempOwner = DummyFrameOwner::create();
1429 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to r euse it here. 1430 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to r euse it here.
1430 RawPtr<LocalFrame> frame = LocalFrame::create(webFrame->m_frameLoaderClientI mpl.get(), oldFrame->host(), tempOwner.get()); 1431 RawPtr<LocalFrame> frame = LocalFrame::create(webFrame->m_frameLoaderClientI mpl.get(), oldFrame->host(), tempOwner.get(), client ? client->serviceRegistry() : nullptr);
1431 // Set the name and unique name directly, bypassing any of the normal logic 1432 // Set the name and unique name directly, bypassing any of the normal logic
1432 // to calculate unique name. 1433 // to calculate unique name.
1433 frame->tree().setPrecalculatedName(toWebRemoteFrameImpl(oldWebFrame)->frame( )->tree().name(), toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().uniqueName( )); 1434 frame->tree().setPrecalculatedName(toWebRemoteFrameImpl(oldWebFrame)->frame( )->tree().name(), toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().uniqueName( ));
1434 webFrame->setCoreFrame(frame); 1435 webFrame->setCoreFrame(frame);
1435 1436
1436 frame->setOwner(oldFrame->owner()); 1437 frame->setOwner(oldFrame->owner());
1437 1438
1438 if (frame->owner() && frame->owner()->isRemote()) { 1439 if (frame->owner() && frame->owner()->isRemote()) {
1439 toRemoteFrameOwner(frame->owner())->setSandboxFlags(static_cast<SandboxF lags>(flags)); 1440 toRemoteFrameOwner(frame->owner())->setSandboxFlags(static_cast<SandboxF lags>(flags));
1440 // Since a remote frame doesn't get the notifications about frame owner 1441 // Since a remote frame doesn't get the notifications about frame owner
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 if (RuntimeEnabledFeatures::wakeLockEnabled()) 1546 if (RuntimeEnabledFeatures::wakeLockEnabled())
1546 ScreenWakeLock::provideTo(*m_frame, m_client ? m_client->wakeLockClient( ) : nullptr); 1547 ScreenWakeLock::provideTo(*m_frame, m_client ? m_client->wakeLockClient( ) : nullptr);
1547 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) 1548 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled())
1548 provideAudioOutputDeviceClientTo(*m_frame, AudioOutputDeviceClientImpl:: create()); 1549 provideAudioOutputDeviceClientTo(*m_frame, AudioOutputDeviceClientImpl:: create());
1549 if (RuntimeEnabledFeatures::installedAppEnabled()) 1550 if (RuntimeEnabledFeatures::installedAppEnabled())
1550 InstalledAppController::provideTo(*m_frame, m_client ? m_client->install edAppClient() : nullptr); 1551 InstalledAppController::provideTo(*m_frame, m_client ? m_client->install edAppClient() : nullptr);
1551 } 1552 }
1552 1553
1553 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& uniqueName) 1554 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& uniqueName)
1554 { 1555 {
1555 setCoreFrame(LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner)) ; 1556 setCoreFrame(LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner, client() ? client()->serviceRegistry() : nullptr));
1556 frame()->tree().setPrecalculatedName(name, uniqueName); 1557 frame()->tree().setPrecalculatedName(name, uniqueName);
1557 // We must call init() after m_frame is assigned because it is referenced 1558 // We must call init() after m_frame is assigned because it is referenced
1558 // during init(). Note that this may dispatch JS events; the frame may be 1559 // during init(). Note that this may dispatch JS events; the frame may be
1559 // detached after init() returns. 1560 // detached after init() returns.
1560 frame()->init(); 1561 frame()->init();
1561 if (frame() && frame()->loader().stateMachine()->isDisplayingInitialEmptyDoc ument() && !parent() && !opener() && frame()->settings()->shouldReuseGlobalForUn ownedMainFrame()) 1562 if (frame() && frame()->loader().stateMachine()->isDisplayingInitialEmptyDoc ument() && !parent() && !opener() && frame()->settings()->shouldReuseGlobalForUn ownedMainFrame())
1562 frame()->document()->getSecurityOrigin()->grantUniversalAccess(); 1563 frame()->document()->getSecurityOrigin()->grantUniversalAccess();
1563 } 1564 }
1564 1565
1565 RawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const FrameLoadRequest& r equest, 1566 RawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const FrameLoadRequest& r equest,
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 return WebSandboxFlags::None; 2175 return WebSandboxFlags::None;
2175 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2176 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2176 } 2177 }
2177 2178
2178 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) 2179 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags)
2179 { 2180 {
2180 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); 2181 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags));
2181 } 2182 }
2182 2183
2183 } // namespace blink 2184 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp ('k') | third_party/WebKit/public/blink_headers.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698