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

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 10699045: Fix PPB_MouseLock.LockMouse crash and add tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: change in response to Dave's suggestions. Created 8 years, 5 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
« ppapi/tests/test_mouse_lock.h ('K') | « ppapi/thunk/enter.cc ('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 // 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 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 bool PluginInstance::IsProcessingUserGesture() { 1595 bool PluginInstance::IsProcessingUserGesture() {
1596 PP_TimeTicks now = 1596 PP_TimeTicks now =
1597 ::ppapi::TimeTicksToPPTimeTicks(base::TimeTicks::Now()); 1597 ::ppapi::TimeTicksToPPTimeTicks(base::TimeTicks::Now());
1598 // Give a lot of slack so tests won't be flaky. Well behaved plugins will 1598 // Give a lot of slack so tests won't be flaky. Well behaved plugins will
1599 // close the user gesture. 1599 // close the user gesture.
1600 const PP_TimeTicks kUserGestureDurationInSeconds = 10.0; 1600 const PP_TimeTicks kUserGestureDurationInSeconds = 10.0;
1601 return (now - pending_user_gesture_ < kUserGestureDurationInSeconds); 1601 return (now - pending_user_gesture_ < kUserGestureDurationInSeconds);
1602 } 1602 }
1603 1603
1604 void PluginInstance::OnLockMouseACK(bool succeeded) { 1604 void PluginInstance::OnLockMouseACK(bool succeeded) {
1605 if (TrackedCallback::IsPending(lock_mouse_callback_)) { 1605 if (!TrackedCallback::IsPending(lock_mouse_callback_)) {
1606 NOTREACHED(); 1606 NOTREACHED();
1607 return; 1607 return;
1608 } 1608 }
1609 TrackedCallback::ClearAndRun(&lock_mouse_callback_, 1609 TrackedCallback::ClearAndRun(&lock_mouse_callback_,
1610 succeeded ? PP_OK : PP_ERROR_FAILED); 1610 succeeded ? PP_OK : PP_ERROR_FAILED);
1611 } 1611 }
1612 1612
1613 void PluginInstance::OnMouseLockLost() { 1613 void PluginInstance::OnMouseLockLost() {
1614 if (LoadMouseLockInterface()) 1614 if (LoadMouseLockInterface())
1615 plugin_mouse_lock_interface_->MouseLockLost(pp_instance()); 1615 plugin_mouse_lock_interface_->MouseLockLost(pp_instance());
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 screen_size_for_fullscreen_ = gfx::Size(); 2210 screen_size_for_fullscreen_ = gfx::Size();
2211 WebElement element = container_->element(); 2211 WebElement element = container_->element();
2212 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 2212 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
2213 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 2213 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
2214 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 2214 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
2215 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 2215 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
2216 } 2216 }
2217 2217
2218 } // namespace ppapi 2218 } // namespace ppapi
2219 } // namespace webkit 2219 } // namespace webkit
OLDNEW
« ppapi/tests/test_mouse_lock.h ('K') | « ppapi/thunk/enter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698