OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_IMPL_H_ | 5 #ifndef WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_IMPL_H_ |
6 #define WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_IMPL_H_ | 6 #define WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_IMPL_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 // Returns the raw data for a resource. This resource must have been | 116 // Returns the raw data for a resource. This resource must have been |
117 // specified as BINDATA in the relevant .rc file. | 117 // specified as BINDATA in the relevant .rc file. |
118 virtual base::StringPiece GetDataResource(int resource_id, | 118 virtual base::StringPiece GetDataResource(int resource_id, |
119 ui::ScaleFactor scale_factor) = 0; | 119 ui::ScaleFactor scale_factor) = 0; |
120 | 120 |
121 // Creates a ResourceLoaderBridge. | 121 // Creates a ResourceLoaderBridge. |
122 virtual ResourceLoaderBridge* CreateResourceLoader( | 122 virtual ResourceLoaderBridge* CreateResourceLoader( |
123 const ResourceLoaderBridge::RequestInfo& request_info) = 0; | 123 const ResourceLoaderBridge::RequestInfo& request_info) = 0; |
124 // Creates a WebSocketStreamHandleBridge. | 124 // Creates a WebSocketStreamHandleBridge. |
125 virtual WebSocketStreamHandleBridge* CreateWebSocketBridge( | 125 virtual WebSocketStreamHandleBridge* CreateWebSocketStreamBridge( |
126 WebKit::WebSocketStreamHandle* handle, | 126 WebKit::WebSocketStreamHandle* handle, |
127 WebSocketStreamHandleDelegate* delegate) = 0; | 127 WebSocketStreamHandleDelegate* delegate) = 0; |
128 | 128 |
129 void SuspendSharedTimer(); | 129 void SuspendSharedTimer(); |
130 void ResumeSharedTimer(); | 130 void ResumeSharedTimer(); |
131 virtual void OnStartSharedTimer(base::TimeDelta delay) {} | 131 virtual void OnStartSharedTimer(base::TimeDelta delay) {} |
132 | 132 |
133 private: | 133 private: |
134 void DoTimeout() { | 134 void DoTimeout() { |
135 if (shared_timer_func_ && !shared_timer_suspended_) | 135 if (shared_timer_func_ && !shared_timer_suspended_) |
136 shared_timer_func_(); | 136 shared_timer_func_(); |
137 } | 137 } |
138 | 138 |
139 base::MessageLoop* main_loop_; | 139 base::MessageLoop* main_loop_; |
140 base::OneShotTimer<WebKitPlatformSupportImpl> shared_timer_; | 140 base::OneShotTimer<WebKitPlatformSupportImpl> shared_timer_; |
141 void (*shared_timer_func_)(); | 141 void (*shared_timer_func_)(); |
142 double shared_timer_fire_time_; | 142 double shared_timer_fire_time_; |
143 bool shared_timer_fire_time_was_set_while_suspended_; | 143 bool shared_timer_fire_time_was_set_while_suspended_; |
144 int shared_timer_suspended_; // counter | 144 int shared_timer_suspended_; // counter |
145 }; | 145 }; |
146 | 146 |
147 } // namespace webkit_glue | 147 } // namespace webkit_glue |
148 | 148 |
149 #endif // WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_IMPL_H_ | 149 #endif // WEBKIT_CHILD_WEBKITPLATFORMSUPPORT_IMPL_H_ |
OLD | NEW |