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