Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 24 matching lines...) Expand all Loading... | |
| 35 #include "wtf/FastAllocBase.h" | 35 #include "wtf/FastAllocBase.h" |
| 36 #include "wtf/Noncopyable.h" | 36 #include "wtf/Noncopyable.h" |
| 37 #include "wtf/OwnPtr.h" | 37 #include "wtf/OwnPtr.h" |
| 38 #include "wtf/PassOwnPtr.h" | 38 #include "wtf/PassOwnPtr.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 class Chrome; | 42 class Chrome; |
| 43 class EventHandlerRegistry; | 43 class EventHandlerRegistry; |
| 44 class Page; | 44 class Page; |
| 45 class ServiceProvider; | |
| 45 class Settings; | 46 class Settings; |
| 46 class UseCounter; | 47 class UseCounter; |
| 47 class Visitor; | 48 class Visitor; |
| 48 | 49 |
| 49 // FrameHost is the set of global data shared between multiple frames | 50 // FrameHost is the set of global data shared between multiple frames |
| 50 // and is provided by the embedder to each frame when created. | 51 // and is provided by the embedder to each frame when created. |
| 51 // FrameHost currently corresponds to the Page object in core/page | 52 // FrameHost currently corresponds to the Page object in core/page |
| 52 // however the concept of a Page is moving up out of Blink. | 53 // however the concept of a Page is moving up out of Blink. |
| 53 // In an out-of-process iframe world, a single Page may have | 54 // In an out-of-process iframe world, a single Page may have |
| 54 // multiple frames in different process, thus Page becomes a | 55 // multiple frames in different process, thus Page becomes a |
| 55 // browser-level concept and Blink core/ only knows about its LocalFrame (and Fr ameHost). | 56 // browser-level concept and Blink core/ only knows about its LocalFrame (and Fr ameHost). |
| 56 // Separating Page from the rest of core/ through this indirection | 57 // Separating Page from the rest of core/ through this indirection |
| 57 // allows us to slowly refactor Page without breaking the rest of core. | 58 // allows us to slowly refactor Page without breaking the rest of core. |
| 58 class FrameHost final : public DummyBase<FrameHost> { | 59 class FrameHost final : public DummyBase<FrameHost> { |
| 59 WTF_MAKE_NONCOPYABLE(FrameHost); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 60 WTF_MAKE_NONCOPYABLE(FrameHost); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 60 public: | 61 public: |
| 61 static PassOwnPtr<FrameHost> create(Page&); | 62 static PassOwnPtr<FrameHost> create(Page&, ServiceProvider*); |
| 62 ~FrameHost(); | 63 ~FrameHost(); |
| 63 | 64 |
| 64 // Careful: This function will eventually be removed. | 65 // Careful: This function will eventually be removed. |
| 65 Page& page() const { return *m_page; } | 66 Page& page() const { return *m_page; } |
| 66 Settings& settings() const; | 67 Settings& settings() const; |
| 67 Chrome& chrome() const; | 68 Chrome& chrome() const; |
| 68 UseCounter& useCounter() const; | 69 UseCounter& useCounter() const; |
| 69 | 70 |
| 71 ServiceProvider* services() const { return m_services; } | |
|
eseidel
2014/10/31 17:48:57
Why poitner?
| |
| 72 | |
| 70 // Corresponds to pixel density of the device where this Page is | 73 // Corresponds to pixel density of the device where this Page is |
| 71 // being displayed. In multi-monitor setups this can vary between pages. | 74 // being displayed. In multi-monitor setups this can vary between pages. |
| 72 // This value does not account for Page zoom, use LocalFrame::devicePixelRat io instead. | 75 // This value does not account for Page zoom, use LocalFrame::devicePixelRat io instead. |
| 73 float deviceScaleFactor() const; | 76 float deviceScaleFactor() const; |
| 74 | 77 |
| 75 EventHandlerRegistry& eventHandlerRegistry() const; | 78 EventHandlerRegistry& eventHandlerRegistry() const; |
| 76 | 79 |
| 77 void trace(Visitor*); | 80 void trace(Visitor*); |
| 78 | 81 |
| 79 private: | 82 private: |
| 80 explicit FrameHost(Page&); | 83 FrameHost(Page&, ServiceProvider*); |
| 81 | 84 |
| 82 RawPtr<Page> m_page; | 85 RawPtr<Page> m_page; |
| 86 ServiceProvider* m_services; | |
| 83 const OwnPtr<EventHandlerRegistry> m_eventHandlerRegistry; | 87 const OwnPtr<EventHandlerRegistry> m_eventHandlerRegistry; |
| 84 }; | 88 }; |
| 85 | 89 |
| 86 } | 90 } |
| 87 | 91 |
| 88 #endif // FrameHost_h | 92 #endif // FrameHost_h |
| OLD | NEW |