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

Side by Side Diff: content/shell/renderer/test_runner/test_runner.cc

Issue 232733002: InvokeCallbackTask should use UniquePersistent to hold callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « 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 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
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
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
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