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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 1316663004: [Oilpan] De-oilpanize ScopedPageLoadDeferrer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 months 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 | « Source/core/page/ScopedPageLoadDeferrer.cpp ('k') | no next file » | 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 // Change the text zoom level by kTextSizeMultiplierRatio each time the user 215 // Change the text zoom level by kTextSizeMultiplierRatio each time the user
216 // zooms text in or out (ie., change by 20%). The min and max values limit 216 // zooms text in or out (ie., change by 20%). The min and max values limit
217 // text zoom to half and 3x the original text size. These three values match 217 // text zoom to half and 3x the original text size. These three values match
218 // those in Apple's port in WebKit/WebKit/WebView/WebView.mm 218 // those in Apple's port in WebKit/WebKit/WebView/WebView.mm
219 const double WebView::textSizeMultiplierRatio = 1.2; 219 const double WebView::textSizeMultiplierRatio = 1.2;
220 const double WebView::minTextSizeMultiplier = 0.5; 220 const double WebView::minTextSizeMultiplier = 0.5;
221 const double WebView::maxTextSizeMultiplier = 3.0; 221 const double WebView::maxTextSizeMultiplier = 3.0;
222 222
223 // Used to defer all page activity in cases where the embedder wishes to run 223 // Used to defer all page activity in cases where the embedder wishes to run
224 // a nested event loop. Using a stack enables nesting of message loop invocation s. 224 // a nested event loop. Using a stack enables nesting of message loop invocation s.
225 static WillBeHeapVector<RawPtrWillBeMember<ScopedPageLoadDeferrer>>& pageLoadDef errerStack() 225 static Vector<OwnPtr<ScopedPageLoadDeferrer>>& pageLoadDeferrerStack()
226 { 226 {
227 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WillBeHeapVector<RawPtrWillBeMemb er<ScopedPageLoadDeferrer>>>, deferrerStack, (adoptPtrWillBeNoop(new WillBeHeapV ector<RawPtrWillBeMember<ScopedPageLoadDeferrer>>()))); 227 DEFINE_STATIC_LOCAL(Vector<OwnPtr<ScopedPageLoadDeferrer>>, deferrerStack, ( ));
228 return *deferrerStack; 228 return deferrerStack;
229 } 229 }
230 230
231 // Ensure that the WebDragOperation enum values stay in sync with the original 231 // Ensure that the WebDragOperation enum values stay in sync with the original
232 // DragOperation constants. 232 // DragOperation constants.
233 #define STATIC_ASSERT_MATCHING_ENUM(coreName) \ 233 #define STATIC_ASSERT_MATCHING_ENUM(coreName) \
234 static_assert(int(coreName) == int(Web##coreName), "DragOperation and WebDra gOperation enum mismatch: " #coreName) 234 static_assert(int(coreName) == int(Web##coreName), "DragOperation and WebDra gOperation enum mismatch: " #coreName)
235 STATIC_ASSERT_MATCHING_ENUM(DragOperationNone); 235 STATIC_ASSERT_MATCHING_ENUM(DragOperationNone);
236 STATIC_ASSERT_MATCHING_ENUM(DragOperationCopy); 236 STATIC_ASSERT_MATCHING_ENUM(DragOperationCopy);
237 STATIC_ASSERT_MATCHING_ENUM(DragOperationLink); 237 STATIC_ASSERT_MATCHING_ENUM(DragOperationLink);
238 STATIC_ASSERT_MATCHING_ENUM(DragOperationGeneric); 238 STATIC_ASSERT_MATCHING_ENUM(DragOperationGeneric);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 Page::visitedStateChanged(linkHash); 349 Page::visitedStateChanged(linkHash);
350 } 350 }
351 351
352 void WebView::resetVisitedLinkState() 352 void WebView::resetVisitedLinkState()
353 { 353 {
354 Page::allVisitedStateChanged(); 354 Page::allVisitedStateChanged();
355 } 355 }
356 356
357 void WebView::willEnterModalLoop() 357 void WebView::willEnterModalLoop()
358 { 358 {
359 pageLoadDeferrerStack().append(new ScopedPageLoadDeferrer()); 359 pageLoadDeferrerStack().append(adoptPtr(new ScopedPageLoadDeferrer()));
360 } 360 }
361 361
362 void WebView::didExitModalLoop() 362 void WebView::didExitModalLoop()
363 { 363 {
364 ASSERT(pageLoadDeferrerStack().size()); 364 ASSERT(pageLoadDeferrerStack().size());
365
366 ScopedPageLoadDeferrer* deferrer = pageLoadDeferrerStack().last();
367 #if ENABLE(OILPAN)
368 deferrer->dispose();
369 #else
370 delete deferrer;
371 #endif
372 pageLoadDeferrerStack().removeLast(); 365 pageLoadDeferrerStack().removeLast();
373 } 366 }
374 367
375 void WebViewImpl::setMainFrame(WebFrame* frame) 368 void WebViewImpl::setMainFrame(WebFrame* frame)
376 { 369 {
377 if (frame->isWebLocalFrame()) { 370 if (frame->isWebLocalFrame()) {
378 WebLocalFrameImpl* localFrame = toWebLocalFrameImpl(frame); 371 WebLocalFrameImpl* localFrame = toWebLocalFrameImpl(frame);
379 localFrame->initializeCoreFrame(&page()->frameHost(), 0, nullAtom, nullA tom); 372 localFrame->initializeCoreFrame(&page()->frameHost(), 0, nullAtom, nullA tom);
380 // Composited WebViews want repaints outside the frame visible rect. 373 // Composited WebViews want repaints outside the frame visible rect.
381 localFrame->frame()->view()->setClipsRepaints(!m_layerTreeView); 374 localFrame->frame()->view()->setClipsRepaints(!m_layerTreeView);
(...skipping 4037 matching lines...) Expand 10 before | Expand all | Expand 10 after
4419 if (m_pageColorOverlay) 4412 if (m_pageColorOverlay)
4420 m_pageColorOverlay->update(); 4413 m_pageColorOverlay->update();
4421 if (InspectorOverlayImpl* overlay = inspectorOverlay()) { 4414 if (InspectorOverlayImpl* overlay = inspectorOverlay()) {
4422 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); 4415 PageOverlay* inspectorPageOverlay = overlay->pageOverlay();
4423 if (inspectorPageOverlay) 4416 if (inspectorPageOverlay)
4424 inspectorPageOverlay->update(); 4417 inspectorPageOverlay->update();
4425 } 4418 }
4426 } 4419 }
4427 4420
4428 } // namespace blink 4421 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/ScopedPageLoadDeferrer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698