OLD | NEW |
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 class WebPluginContainerImpl; | 65 class WebPluginContainerImpl; |
66 class WebView; | 66 class WebView; |
67 class WebViewImpl; | 67 class WebViewImpl; |
68 struct FrameLoadRequest; | 68 struct FrameLoadRequest; |
69 struct WebPrintParams; | 69 struct WebPrintParams; |
70 struct WindowFeatures; | 70 struct WindowFeatures; |
71 | 71 |
72 template <typename T> class WebVector; | 72 template <typename T> class WebVector; |
73 | 73 |
74 // Implementation of WebFrame, note that this is a reference counted object. | 74 // Implementation of WebFrame, note that this is a reference counted object. |
75 class WebLocalFrameImpl FINAL | 75 class WebLocalFrameImpl FINAL : public RefCountedWillBeGarbageCollectedFinalized
<WebLocalFrameImpl>, public WebLocalFrame { |
76 : public WebLocalFrame | |
77 , public RefCounted<WebLocalFrameImpl> { | |
78 public: | 76 public: |
79 // WebFrame methods: | 77 // WebFrame methods: |
80 virtual bool isWebLocalFrame() const OVERRIDE; | 78 virtual bool isWebLocalFrame() const OVERRIDE; |
81 virtual WebLocalFrame* toWebLocalFrame() OVERRIDE; | 79 virtual WebLocalFrame* toWebLocalFrame() OVERRIDE; |
82 virtual bool isWebRemoteFrame() const OVERRIDE; | 80 virtual bool isWebRemoteFrame() const OVERRIDE; |
83 virtual WebRemoteFrame* toWebRemoteFrame() OVERRIDE; | 81 virtual WebRemoteFrame* toWebRemoteFrame() OVERRIDE; |
84 virtual void close() OVERRIDE; | 82 virtual void close() OVERRIDE; |
85 virtual WebString uniqueName() const OVERRIDE; | 83 virtual WebString uniqueName() const OVERRIDE; |
86 virtual WebString assignedName() const OVERRIDE; | 84 virtual WebString assignedName() const OVERRIDE; |
87 virtual void setName(const WebString&) OVERRIDE; | 85 virtual void setName(const WebString&) OVERRIDE; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 virtual WebString layerTreeAsText(bool showDebugInfo = false) const OVERRIDE
; | 228 virtual WebString layerTreeAsText(bool showDebugInfo = false) const OVERRIDE
; |
231 | 229 |
232 // WebLocalFrame methods: | 230 // WebLocalFrame methods: |
233 virtual void addStyleSheetByURL(const WebString& url) OVERRIDE; | 231 virtual void addStyleSheetByURL(const WebString& url) OVERRIDE; |
234 | 232 |
235 void willDetachParent(); | 233 void willDetachParent(); |
236 | 234 |
237 static WebLocalFrameImpl* create(WebFrameClient*); | 235 static WebLocalFrameImpl* create(WebFrameClient*); |
238 virtual ~WebLocalFrameImpl(); | 236 virtual ~WebLocalFrameImpl(); |
239 | 237 |
240 PassRefPtr<LocalFrame> initializeCoreFrame(FrameHost*, FrameOwner*, const At
omicString& name, const AtomicString& fallbackName); | 238 PassRefPtrWillBeRawPtr<LocalFrame> initializeCoreFrame(FrameHost*, FrameOwne
r*, const AtomicString& name, const AtomicString& fallbackName); |
241 | 239 |
242 PassRefPtr<LocalFrame> createChildFrame( | 240 PassRefPtrWillBeRawPtr<LocalFrame> createChildFrame(const FrameLoadRequest&,
HTMLFrameOwnerElement*); |
243 const FrameLoadRequest&, HTMLFrameOwnerElement*); | |
244 | 241 |
245 void didChangeContentsSize(const IntSize&); | 242 void didChangeContentsSize(const IntSize&); |
246 | 243 |
247 void createFrameView(); | 244 void createFrameView(); |
248 | 245 |
249 static WebLocalFrameImpl* fromFrame(LocalFrame*); | 246 static WebLocalFrameImpl* fromFrame(LocalFrame*); |
250 static WebLocalFrameImpl* fromFrame(LocalFrame&); | 247 static WebLocalFrameImpl* fromFrame(LocalFrame&); |
251 static WebLocalFrameImpl* fromFrameOwnerElement(Element*); | 248 static WebLocalFrameImpl* fromFrameOwnerElement(Element*); |
252 | 249 |
253 // If the frame hosts a PluginDocument, this method returns the WebPluginCon
tainerImpl | 250 // If the frame hosts a PluginDocument, this method returns the WebPluginCon
tainerImpl |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 306 |
310 // Invalidates vertical scrollbar only. | 307 // Invalidates vertical scrollbar only. |
311 void invalidateScrollbar() const; | 308 void invalidateScrollbar() const; |
312 | 309 |
313 // Invalidates both content area and the scrollbar. | 310 // Invalidates both content area and the scrollbar. |
314 void invalidateAll() const; | 311 void invalidateAll() const; |
315 | 312 |
316 // Returns a hit-tested VisiblePosition for the given point | 313 // Returns a hit-tested VisiblePosition for the given point |
317 VisiblePosition visiblePositionForWindowPoint(const WebPoint&); | 314 VisiblePosition visiblePositionForWindowPoint(const WebPoint&); |
318 | 315 |
| 316 void trace(Visitor*); |
| 317 |
319 private: | 318 private: |
320 friend class FrameLoaderClientImpl; | 319 friend class FrameLoaderClientImpl; |
321 | 320 |
322 explicit WebLocalFrameImpl(WebFrameClient*); | 321 explicit WebLocalFrameImpl(WebFrameClient*); |
323 | 322 |
324 // Sets the local core frame and registers destruction observers. | 323 // Sets the local core frame and registers destruction observers. |
325 void setCoreFrame(PassRefPtr<LocalFrame>); | 324 void setCoreFrame(PassRefPtrWillBeRawPtr<LocalFrame>); |
326 | 325 |
327 void loadJavaScriptURL(const KURL&); | 326 void loadJavaScriptURL(const KURL&); |
328 | 327 |
329 WebPlugin* focusedPluginIfInputMethodSupported(); | 328 WebPlugin* focusedPluginIfInputMethodSupported(); |
330 | 329 |
331 FrameLoaderClientImpl m_frameLoaderClientImpl; | 330 FrameLoaderClientImpl m_frameLoaderClientImpl; |
332 | 331 |
333 // The embedder retains a reference to the WebCore LocalFrame while it is ac
tive in the DOM. This | 332 // The embedder retains a reference to the WebCore LocalFrame while it is ac
tive in the DOM. This |
334 // reference is released when the frame is removed from the DOM or the entir
e page is closed. | 333 // reference is released when the frame is removed from the DOM or the entir
e page is closed. |
335 // FIXME: These will need to change to WebFrame when we introduce WebFramePr
oxy. | 334 // FIXME: These will need to change to WebFrame when we introduce WebFramePr
oxy. |
336 RefPtr<LocalFrame> m_frame; | 335 RefPtrWillBeMember<LocalFrame> m_frame; |
337 | 336 |
338 // Indicate whether the current LocalFrame is local or remote. Remote frames
are | 337 // Indicate whether the current LocalFrame is local or remote. Remote frames
are |
339 // rendered in a different process from their parent frames. | 338 // rendered in a different process from their parent frames. |
340 bool m_isRemote; | 339 bool m_isRemote; |
341 | 340 |
342 WebFrameClient* m_client; | 341 WebFrameClient* m_client; |
343 WebPermissionClient* m_permissionClient; | 342 WebPermissionClient* m_permissionClient; |
344 OwnPtr<SharedWorkerRepositoryClientImpl> m_sharedWorkerRepositoryClient; | 343 OwnPtr<SharedWorkerRepositoryClientImpl> m_sharedWorkerRepositoryClient; |
345 | 344 |
346 // Will be initialized after first call to find() or scopeStringMatches(). | 345 // Will be initialized after first call to find() or scopeStringMatches(). |
347 OwnPtr<TextFinder> m_textFinder; | 346 OwnPtr<TextFinder> m_textFinder; |
348 | 347 |
349 // Valid between calls to BeginPrint() and EndPrint(). Containts the print | 348 // Valid between calls to BeginPrint() and EndPrint(). Containts the print |
350 // information. Is used by PrintPage(). | 349 // information. Is used by PrintPage(). |
351 OwnPtrWillBePersistent<ChromePrintContext> m_printContext; | 350 OwnPtrWillBeMember<ChromePrintContext> m_printContext; |
352 | 351 |
353 // Stores the additional input events offset and scale when device metrics e
mulation is enabled. | 352 // Stores the additional input events offset and scale when device metrics e
mulation is enabled. |
354 IntSize m_inputEventsOffsetForEmulation; | 353 IntSize m_inputEventsOffsetForEmulation; |
355 float m_inputEventsScaleFactorForEmulation; | 354 float m_inputEventsScaleFactorForEmulation; |
356 | 355 |
357 UserMediaClientImpl m_userMediaClientImpl; | 356 UserMediaClientImpl m_userMediaClientImpl; |
358 | 357 |
359 OwnPtrWillBePersistent<GeolocationClientProxy> m_geolocationClientProxy; | 358 OwnPtrWillBeMember<GeolocationClientProxy> m_geolocationClientProxy; |
| 359 |
| 360 #if ENABLE(OILPAN) |
| 361 // Oilpan: to provide the guarantee of having the frame live until |
| 362 // close() is called, an instance keep a self-persistent. It is |
| 363 // cleared upon calling close(). This avoids having to assume that |
| 364 // an embedder's WebFrame references are all discovered via thread |
| 365 // state (stack, registers) should an Oilpan GC strike while we're |
| 366 // in the process of detaching. |
| 367 GC_PLUGIN_IGNORE("340522") |
| 368 Persistent<WebLocalFrameImpl> m_selfKeepAlive; |
| 369 #endif |
360 }; | 370 }; |
361 | 371 |
362 DEFINE_TYPE_CASTS(WebLocalFrameImpl, WebFrame, frame, frame->isWebLocalFrame(),
frame.isWebLocalFrame()); | 372 DEFINE_TYPE_CASTS(WebLocalFrameImpl, WebFrame, frame, frame->isWebLocalFrame(),
frame.isWebLocalFrame()); |
363 | 373 |
364 } // namespace blink | 374 } // namespace blink |
365 | 375 |
366 #endif | 376 #endif |
OLD | NEW |