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

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

Issue 1094393003: Revert of update chrome to handle temporary WEB_FRAME_USES_V8_LOCAL condition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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/public/test/layouttest_support.h" 10 #include "content/public/test/layouttest_support.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 v8::Isolate* isolate = blink::mainThreadIsolate(); 98 v8::Isolate* isolate = blink::mainThreadIsolate();
99 v8::HandleScope handle_scope(isolate); 99 v8::HandleScope handle_scope(isolate);
100 WebFrame* frame = object_->web_view_->mainFrame(); 100 WebFrame* frame = object_->web_view_->mainFrame();
101 101
102 v8::Handle<v8::Context> context = frame->mainWorldScriptContext(); 102 v8::Handle<v8::Context> context = frame->mainWorldScriptContext();
103 if (context.IsEmpty()) 103 if (context.IsEmpty())
104 return; 104 return;
105 105
106 v8::Context::Scope context_scope(context); 106 v8::Context::Scope context_scope(context);
107 107
108 #ifdef WEB_FRAME_USES_V8_LOCAL
109 scoped_ptr<v8::Local<v8::Value>[]> local_argv;
110 if (argc_) {
111 local_argv.reset(new v8::Local<v8::Value>[argc_]);
112 #else
113 scoped_ptr<v8::Handle<v8::Value>[]> local_argv; 108 scoped_ptr<v8::Handle<v8::Value>[]> local_argv;
114 if (argc_) { 109 if (argc_) {
115 local_argv.reset(new v8::Handle<v8::Value>[argc_]); 110 local_argv.reset(new v8::Handle<v8::Value>[argc_]);
116 #endif
117 for (int i = 0; i < argc_; ++i) 111 for (int i = 0; i < argc_; ++i)
118 local_argv[i] = v8::Local<v8::Value>::New(isolate, argv_[i]); 112 local_argv[i] = v8::Local<v8::Value>::New(isolate, argv_[i]);
119 } 113 }
120 114
121 frame->callFunctionEvenIfScriptDisabled( 115 frame->callFunctionEvenIfScriptDisabled(
122 v8::Local<v8::Function>::New(isolate, callback_), 116 v8::Local<v8::Function>::New(isolate, callback_),
123 context->Global(), 117 context->Global(),
124 argc_, 118 argc_,
125 local_argv.get()); 119 local_argv.get());
126 } 120 }
(...skipping 2914 matching lines...) Expand 10 before | Expand all | Expand 10 after
3041 } 3035 }
3042 3036
3043 void TestRunner::DidLosePointerLockInternal() { 3037 void TestRunner::DidLosePointerLockInternal() {
3044 bool was_locked = pointer_locked_; 3038 bool was_locked = pointer_locked_;
3045 pointer_locked_ = false; 3039 pointer_locked_ = false;
3046 if (was_locked) 3040 if (was_locked)
3047 web_view_->didLosePointerLock(); 3041 web_view_->didLosePointerLock();
3048 } 3042 }
3049 3043
3050 } // namespace content 3044 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698