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/api/src/WebMediaPlayerClientImpl.cpp

Issue 183038: Fixes crash when switching to new tabs containing audio/video elements. (Closed)
Patch Set: Created 11 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
« no previous file with comments | « no previous file | 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 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "config.h" 5 #include "config.h"
6 #include "WebMediaPlayerClientImpl.h" 6 #include "WebMediaPlayerClientImpl.h"
7 7
8 #if ENABLE(VIDEO) 8 #if ENABLE(VIDEO)
9 9
10 #include "TemporaryGlue.h" 10 #include "TemporaryGlue.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 } 323 }
324 324
325 void WebMediaPlayerClientImpl::setSize(const IntSize& size) 325 void WebMediaPlayerClientImpl::setSize(const IntSize& size)
326 { 326 {
327 if (m_webMediaPlayer.get()) 327 if (m_webMediaPlayer.get())
328 m_webMediaPlayer->setSize(WebSize(size.width(), size.height())); 328 m_webMediaPlayer->setSize(WebSize(size.width(), size.height()));
329 } 329 }
330 330
331 void WebMediaPlayerClientImpl::paint(GraphicsContext* context, const IntRect& rect) 331 void WebMediaPlayerClientImpl::paint(GraphicsContext* context, const IntRect& rect)
332 { 332 {
333 if (m_webMediaPlayer.get()) { 333 // Normally GraphicsContext operations do nothing when painting is disabled.
334 // Since we're accessing platformContext() directly we have to manually
335 // check.
336 if (m_webMediaPlayer.get() && !context->paintingDisabled()) {
334 #if WEBKIT_USING_SKIA 337 #if WEBKIT_USING_SKIA
335 m_webMediaPlayer->paint(context->platformContext()->canvas(), rect); 338 m_webMediaPlayer->paint(context->platformContext()->canvas(), rect);
336 #elif WEBKIT_USING_CG 339 #elif WEBKIT_USING_CG
337 m_webMediaPlayer->paint(context->platformContext(), rect); 340 m_webMediaPlayer->paint(context->platformContext(), rect);
338 #else 341 #else
339 notImplemented(); 342 notImplemented();
340 #endif 343 #endif
341 } 344 }
342 } 345 }
343 346
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 } 410 }
408 411
409 WebMediaPlayerClientImpl::WebMediaPlayerClientImpl() 412 WebMediaPlayerClientImpl::WebMediaPlayerClientImpl()
410 : m_mediaPlayer(0) 413 : m_mediaPlayer(0)
411 { 414 {
412 } 415 }
413 416
414 } // namespace WebKit 417 } // namespace WebKit
415 418
416 #endif // ENABLE(VIDEO) 419 #endif // ENABLE(VIDEO)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698