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

Side by Side Diff: webkit/glue/webframe_impl.h

Issue 335019: Replace MessageLoop+ScopedRunnableMethodFactory with WebCore::Timer+Vector... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « webkit/glue/chrome_client_impl.cc ('k') | webkit/glue/webframe_impl.cc » ('j') | 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) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #ifndef WEBKIT_GLUE_WEBFRAME_IMPL_H_ 26 #ifndef WEBKIT_GLUE_WEBFRAME_IMPL_H_
27 #define WEBKIT_GLUE_WEBFRAME_IMPL_H_ 27 #define WEBKIT_GLUE_WEBFRAME_IMPL_H_
28 28
29 #include "Frame.h" 29 #include "Frame.h"
30 #include "PlatformString.h" 30 #include "PlatformString.h"
31 #include <wtf/OwnPtr.h> 31 #include <wtf/OwnPtr.h>
32 #include <wtf/RefCounted.h> 32 #include <wtf/RefCounted.h>
33 33
34 #include "base/task.h"
35 #include "webkit/api/public/WebFrame.h" 34 #include "webkit/api/public/WebFrame.h"
36 #include "webkit/glue/webframeloaderclient_impl.h" 35 #include "webkit/glue/webframeloaderclient_impl.h"
37 36
38 class ChromePrintContext; 37 class ChromePrintContext;
39 class WebViewImpl; 38 class WebViewImpl;
40 39
41 namespace gfx { 40 namespace gfx {
42 class BitmapPlatformDevice; 41 class BitmapPlatformDevice;
43 } 42 }
44 43
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 260
262 // Informs the WebFrame that the Frame is being closed, called by the 261 // Informs the WebFrame that the Frame is being closed, called by the
263 // WebFrameLoaderClient 262 // WebFrameLoaderClient
264 void Closing(); 263 void Closing();
265 264
266 // Used to check for leaks of this object. 265 // Used to check for leaks of this object.
267 static int live_object_count_; 266 static int live_object_count_;
268 267
269 WebFrameLoaderClient frame_loader_client_; 268 WebFrameLoaderClient frame_loader_client_;
270 269
271 // This is a factory for creating cancelable tasks for this frame that run
272 // asynchronously in order to scope string matches during a find operation.
273 ScopedRunnableMethodFactory<WebFrameImpl> scope_matches_factory_;
274
275 RefPtr<ClientHandle> client_handle_; 270 RefPtr<ClientHandle> client_handle_;
276 271
277 // This is a weak pointer to our corresponding WebCore frame. A reference to 272 // This is a weak pointer to our corresponding WebCore frame. A reference to
278 // ourselves is held while frame_ is valid. See our Closing method. 273 // ourselves is held while frame_ is valid. See our Closing method.
279 WebCore::Frame* frame_; 274 WebCore::Frame* frame_;
280 275
281 // A way for the main frame to keep track of which frame has an active 276 // A way for the main frame to keep track of which frame has an active
282 // match. Should be NULL for all other frames. 277 // match. Should be NULL for all other frames.
283 WebFrameImpl* active_match_frame_; 278 WebFrameImpl* active_match_frame_;
284 279
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 316
322 // Keeps track of whether the scoping effort was completed (the user may 317 // Keeps track of whether the scoping effort was completed (the user may
323 // interrupt it before it completes by submitting a new search). 318 // interrupt it before it completes by submitting a new search).
324 bool scoping_complete_; 319 bool scoping_complete_;
325 320
326 // Keeps track of when the scoping effort should next invalidate the scrollbar 321 // Keeps track of when the scoping effort should next invalidate the scrollbar
327 // and the frame area. 322 // and the frame area.
328 int next_invalidate_after_; 323 int next_invalidate_after_;
329 324
330 private: 325 private:
326 class DeferredScopeStringMatches;
327 friend class DeferredScopeStringMatches;
328
331 // A bit mask specifying area of the frame to invalidate. 329 // A bit mask specifying area of the frame to invalidate.
332 enum AreaToInvalidate { 330 enum AreaToInvalidate {
333 INVALIDATE_NOTHING = 0, 331 INVALIDATE_NOTHING = 0,
334 INVALIDATE_CONTENT_AREA = 1, 332 INVALIDATE_CONTENT_AREA = 1,
335 INVALIDATE_SCROLLBAR = 2, // vertical scrollbar only. 333 INVALIDATE_SCROLLBAR = 2, // vertical scrollbar only.
336 INVALIDATE_ALL = 3 // both content area and the scrollbar. 334 INVALIDATE_ALL = 3 // both content area and the scrollbar.
337 }; 335 };
338 336
339 // Notifies the delegate about a new selection rect. 337 // Notifies the delegate about a new selection rect.
340 void ReportFindInPageSelection( 338 void ReportFindInPageSelection(
(...skipping 14 matching lines...) Expand all
355 // not including) the frame passed in as a parameter and counts how many 353 // not including) the frame passed in as a parameter and counts how many
356 // matches have been found. 354 // matches have been found.
357 int OrdinalOfFirstMatchForFrame(WebFrameImpl* frame) const; 355 int OrdinalOfFirstMatchForFrame(WebFrameImpl* frame) const;
358 356
359 // Determines whether the scoping effort is required for a particular frame. 357 // Determines whether the scoping effort is required for a particular frame.
360 // It is not necessary if the frame is invisible, for example, or if this 358 // It is not necessary if the frame is invisible, for example, or if this
361 // is a repeat search that already returned nothing last time the same prefix 359 // is a repeat search that already returned nothing last time the same prefix
362 // was searched. 360 // was searched.
363 bool ShouldScopeMatches(const string16& search_text); 361 bool ShouldScopeMatches(const string16& search_text);
364 362
363 // Queue up a deferred call to scopeStringMatches.
364 void ScopeStringMatchesSoon(
365 int identifier, const WebKit::WebString& search_text,
366 const WebKit::WebFindOptions& options, bool reset);
367
368 // Called by a DeferredScopeStringMatches instance.
369 void CallScopeStringMatches(
370 DeferredScopeStringMatches* deferred,
371 int identifier, const WebKit::WebString& search_text,
372 const WebKit::WebFindOptions& options, bool reset);
373
365 // Determines whether to invalidate the content area and scrollbar. 374 // Determines whether to invalidate the content area and scrollbar.
366 void InvalidateIfNecessary(); 375 void InvalidateIfNecessary();
367 376
368 // Clears the map of password listeners. 377 // Clears the map of password listeners.
369 void ClearPasswordListeners(); 378 void ClearPasswordListeners();
370 379
371 void LoadJavaScriptURL(const WebCore::KURL& url); 380 void LoadJavaScriptURL(const WebCore::KURL& url);
372 381
382 // A list of all of the pending calls to scopeStringMatches.
383 Vector<DeferredScopeStringMatches*> deferred_scoping_work_;
384
373 // Valid between calls to BeginPrint() and EndPrint(). Containts the print 385 // Valid between calls to BeginPrint() and EndPrint(). Containts the print
374 // information. Is used by PrintPage(). 386 // information. Is used by PrintPage().
375 OwnPtr<ChromePrintContext> print_context_; 387 OwnPtr<ChromePrintContext> print_context_;
376 388
377 // The input fields that are interested in edit events and their associated 389 // The input fields that are interested in edit events and their associated
378 // listeners. 390 // listeners.
379 typedef HashMap<RefPtr<WebCore::HTMLInputElement>, 391 typedef HashMap<RefPtr<WebCore::HTMLInputElement>,
380 WebKit::PasswordAutocompleteListener*> PasswordListenerMap; 392 WebKit::PasswordAutocompleteListener*> PasswordListenerMap;
381 PasswordListenerMap password_listeners_; 393 PasswordListenerMap password_listeners_;
382 }; 394 };
383 395
384 #endif // WEBKIT_GLUE_WEBFRAME_IMPL_H_ 396 #endif // WEBKIT_GLUE_WEBFRAME_IMPL_H_
OLDNEW
« no previous file with comments | « webkit/glue/chrome_client_impl.cc ('k') | webkit/glue/webframe_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698