OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/shell/renderer/test_runner/test_runner.h" | 5 #include "content/shell/renderer/test_runner/test_runner.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "content/shell/common/test_runner/test_preferences.h" | 10 #include "content/shell/common/test_runner/test_preferences.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 v8::Context::Scope context_scope(context); | 97 v8::Context::Scope context_scope(context); |
98 | 98 |
99 frame->callFunctionEvenIfScriptDisabled( | 99 frame->callFunctionEvenIfScriptDisabled( |
100 v8::Local<v8::Function>::New(isolate, callback_), | 100 v8::Local<v8::Function>::New(isolate, callback_), |
101 context->Global(), | 101 context->Global(), |
102 0, | 102 0, |
103 NULL); | 103 NULL); |
104 } | 104 } |
105 | 105 |
106 private: | 106 private: |
107 v8::Persistent<v8::Function> callback_; | 107 v8::UniquePersistent<v8::Function> callback_; |
108 }; | 108 }; |
109 | 109 |
110 class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> { | 110 class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> { |
111 public: | 111 public: |
112 static gin::WrapperInfo kWrapperInfo; | 112 static gin::WrapperInfo kWrapperInfo; |
113 | 113 |
114 static void Install(base::WeakPtr<TestRunner> controller, | 114 static void Install(base::WeakPtr<TestRunner> controller, |
115 WebFrame* frame); | 115 WebFrame* frame); |
116 | 116 |
117 private: | 117 private: |
(...skipping 2529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2647 } | 2647 } |
2648 | 2648 |
2649 void TestRunner::DidLosePointerLockInternal() { | 2649 void TestRunner::DidLosePointerLockInternal() { |
2650 bool was_locked = pointer_locked_; | 2650 bool was_locked = pointer_locked_; |
2651 pointer_locked_ = false; | 2651 pointer_locked_ = false; |
2652 if (was_locked) | 2652 if (was_locked) |
2653 web_view_->didLosePointerLock(); | 2653 web_view_->didLosePointerLock(); |
2654 } | 2654 } |
2655 | 2655 |
2656 } // namespace content | 2656 } // namespace content |
OLD | NEW |