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

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

Issue 1811753004: Webkit/Source/web/WebLocalFrameImpl microcleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 WebFrame::traceFrames(visitor, this); 1517 WebFrame::traceFrames(visitor, this);
1518 WebFrameImplBase::trace(visitor); 1518 WebFrameImplBase::trace(visitor);
1519 } 1519 }
1520 #endif 1520 #endif
1521 1521
1522 void WebLocalFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<LocalFrame> frame) 1522 void WebLocalFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<LocalFrame> frame)
1523 { 1523 {
1524 m_frame = frame; 1524 m_frame = frame;
1525 1525
1526 // FIXME: we shouldn't add overhead to every frame by registering these obje cts when they're not used. 1526 // FIXME: we shouldn't add overhead to every frame by registering these obje cts when they're not used.
1527 if (m_frame) { 1527 if (!m_frame)
1528 if (m_client) 1528 return;
1529 providePushControllerTo(*m_frame, m_client->pushClient());
1530 1529
1531 provideNotificationPermissionClientTo(*m_frame, NotificationPermissionCl ientImpl::create()); 1530 if (m_client)
1532 provideUserMediaTo(*m_frame, &m_userMediaClientImpl); 1531 providePushControllerTo(*m_frame, m_client->pushClient());
1533 provideGeolocationTo(*m_frame, m_geolocationClientProxy.get());
1534 m_geolocationClientProxy->setController(GeolocationController::from(m_fr ame.get()));
1535 provideMIDITo(*m_frame, MIDIClientProxy::create(m_client ? m_client->web MIDIClient() : nullptr));
1536 provideLocalFileSystemTo(*m_frame, LocalFileSystemClient::create());
1537 provideNavigatorContentUtilsTo(*m_frame, NavigatorContentUtilsClientImpl ::create(this));
1538 1532
1539 bool enableWebBluetooth = RuntimeEnabledFeatures::webBluetoothEnabled(); 1533 provideNotificationPermissionClientTo(*m_frame, NotificationPermissionClient Impl::create());
1534 provideUserMediaTo(*m_frame, &m_userMediaClientImpl);
1535 provideGeolocationTo(*m_frame, m_geolocationClientProxy.get());
1536 m_geolocationClientProxy->setController(GeolocationController::from(m_frame. get()));
1537 provideMIDITo(*m_frame, MIDIClientProxy::create(m_client ? m_client->webMIDI Client() : nullptr));
1538 provideLocalFileSystemTo(*m_frame, LocalFileSystemClient::create());
1539 provideNavigatorContentUtilsTo(*m_frame, NavigatorContentUtilsClientImpl::cr eate(this));
1540
1541 bool enableWebBluetooth = RuntimeEnabledFeatures::webBluetoothEnabled();
1540 #if OS(CHROMEOS) || OS(ANDROID) 1542 #if OS(CHROMEOS) || OS(ANDROID)
1541 // TODO(https://crbug.com/584113) Enable Web Bluetooth Experiment. 1543 // TODO(https://crbug.com/584113) Enable Web Bluetooth Experiment.
1542 // enableWebBluetooth = true; 1544 // enableWebBluetooth = true;
1543 #endif 1545 #endif
1544 1546
1545 if (enableWebBluetooth) { 1547 if (enableWebBluetooth)
1546 BluetoothSupplement::provideTo(*m_frame, m_client ? m_client->blueto oth() : nullptr); 1548 BluetoothSupplement::provideTo(*m_frame, m_client ? m_client->bluetooth( ) : nullptr);
1547 }
1548 1549
1549 if (RuntimeEnabledFeatures::screenOrientationEnabled()) 1550 if (RuntimeEnabledFeatures::screenOrientationEnabled())
1550 ScreenOrientationController::provideTo(*m_frame, m_client ? m_client ->webScreenOrientationClient() : nullptr); 1551 ScreenOrientationController::provideTo(*m_frame, m_client ? m_client->we bScreenOrientationClient() : nullptr);
1551 if (RuntimeEnabledFeatures::presentationEnabled()) 1552 if (RuntimeEnabledFeatures::presentationEnabled())
1552 PresentationController::provideTo(*m_frame, m_client ? m_client->pre sentationClient() : nullptr); 1553 PresentationController::provideTo(*m_frame, m_client ? m_client->present ationClient() : nullptr);
1553 if (RuntimeEnabledFeatures::permissionsEnabled()) 1554 if (RuntimeEnabledFeatures::permissionsEnabled())
1554 PermissionController::provideTo(*m_frame, m_client ? m_client->permi ssionClient() : nullptr); 1555 PermissionController::provideTo(*m_frame, m_client ? m_client->permissio nClient() : nullptr);
1555 if (RuntimeEnabledFeatures::webUSBEnabled()) 1556 if (RuntimeEnabledFeatures::webUSBEnabled())
1556 USBController::provideTo(*m_frame, m_client ? m_client->usbClient() : nullptr); 1557 USBController::provideTo(*m_frame, m_client ? m_client->usbClient() : nu llptr);
1557 if (RuntimeEnabledFeatures::webVREnabled()) 1558 if (RuntimeEnabledFeatures::webVREnabled())
1558 VRController::provideTo(*m_frame, m_client ? m_client->webVRClient() : nullptr); 1559 VRController::provideTo(*m_frame, m_client ? m_client->webVRClient() : n ullptr);
1559 if (RuntimeEnabledFeatures::wakeLockEnabled()) 1560 if (RuntimeEnabledFeatures::wakeLockEnabled())
1560 ScreenWakeLock::provideTo(*m_frame, m_client ? m_client->wakeLockCli ent() : nullptr); 1561 ScreenWakeLock::provideTo(*m_frame, m_client ? m_client->wakeLockClient( ) : nullptr);
1561 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) 1562 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled())
1562 provideAudioOutputDeviceClientTo(*m_frame, AudioOutputDeviceClientIm pl::create()); 1563 provideAudioOutputDeviceClientTo(*m_frame, AudioOutputDeviceClientImpl:: create());
1563 if (RuntimeEnabledFeatures::installedAppEnabled()) { 1564 if (RuntimeEnabledFeatures::installedAppEnabled())
1564 InstalledAppController::provideTo(*m_frame, m_client ? m_client->ins talledAppClient() : nullptr); 1565 InstalledAppController::provideTo(*m_frame, m_client ? m_client->install edAppClient() : nullptr);
1565 }
1566 }
1567 } 1566 }
1568 1567
1569 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& uniqueName) 1568 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& uniqueName)
1570 { 1569 {
1571 setCoreFrame(LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner)) ; 1570 setCoreFrame(LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner)) ;
1572 frame()->tree().setPrecalculatedName(name, uniqueName); 1571 frame()->tree().setPrecalculatedName(name, uniqueName);
1573 // We must call init() after m_frame is assigned because it is referenced 1572 // We must call init() after m_frame is assigned because it is referenced
1574 // during init(). Note that this may dispatch JS events; the frame may be 1573 // during init(). Note that this may dispatch JS events; the frame may be
1575 // detached after init() returns. 1574 // detached after init() returns.
1576 frame()->init(); 1575 frame()->init();
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
2188 return WebSandboxFlags::None; 2187 return WebSandboxFlags::None;
2189 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2188 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2190 } 2189 }
2191 2190
2192 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) 2191 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags)
2193 { 2192 {
2194 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); 2193 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags));
2195 } 2194 }
2196 2195
2197 } // namespace blink 2196 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698